Fixed cardinality calculations for bidirectional patterns