Discord

INAIO Guide Stage 1 7Combinatorics and Discrete Reasoning

7.3 Counting with restrictions

Count only the arrangements that obey a condition, using blocks, complementary counts, or disjoint cases.

The counting rule in Module 7.1 and the permutation formula in Module 7.2 count arrangements when choices are freely available. A restriction changes the problem: perhaps two objects must stay together, the first digit cannot be zero, or the last digit must be even. We need to count valid outcomes, without including forbidden ones or counting any valid one twice.

This is intermediate combinatorics. Start with OpenStax's restricted selection examples; MIT's counting notes provide further practice. First decide what makes two arrangements different, then describe the restriction in those terms.

A basic idea: build only what is allowed

Suppose five distinct books include AA and BB, which must be adjacent on a shelf. Treat AA and BB temporarily as one block. We now arrange four objects: the block and the other three books. That gives 4!4! orders. Inside the block, AA and BB can appear as ABAB or BABA, so the valid total is 2⋅4!=482\cdot4!=48.

A and B are joined into one block alongside three other books, giving four objects to arrange; the block has two internal orders, AB and BA.A and B are joined into one block alongside three other books, giving four objects to arrange; the block has two internal orders, AB and BA.
Group a required adjacent pair, arrange the resulting objects, then count the pair's internal orders.

A quick tour of methods

Make a block when specified objects must be together. Count their internal orders separately. This works only when the block really occupies consecutive positions.

Split into disjoint cases when a restriction changes later choices. For an even last digit, the cases “last digit is 00” and “last digit is 22” do not overlap; multiply within each case, then add. A single product would be wrong if the first-digit choices differ between those cases.

Use the complement when forbidden arrangements are easier to count: valid == all −- forbidden. If there are several forbidden conditions that overlap, subtracting each separately can remove some outcomes twice. Use the overlap rule from Module 8.5 or make disjoint cases instead.

There is no formula that replaces this setup step. Before doing arithmetic, state what each case counts and why every valid outcome belongs to exactly one case.

Application 1: adjacent books

Five distinct books A,B,C,D,EA,B,C,D,E are arranged on a shelf. How many orders have AA and BB together?

  1. Replace A,BA,B by one block. The block, CC, DD, and EE can be arranged in 4!=244!=24 ways.
  2. Within the block, choose ABAB or BABA: 22 ways.
  3. Multiply to get 24⋅2=4824\cdot2=48. Each shelf order gives one block position and one internal order, so none is duplicated.

Application 2: even four-digit numbers

Use each of the digits 0,1,2,30,1,2,3 exactly once to make a four-digit even number. How many are possible?

  1. If the last digit is 00, arrange 1,2,31,2,3 in front: 3!=63!=6 numbers.
  2. If the last digit is 22, the first digit is 11 or 33 (22 choices); arrange the other two digits in the middle (2!2! choices): 2⋅2=42\cdot2=4 numbers.
  3. The cases are separate and complete, so the answer is 6+4=106+4=10. Counting 3!3! in the second case would wrongly allow a leading zero.

Resources

SourceTitleWhy read it
OpenStaxCombinationsWork through selections with membership restrictions.
MIT OpenCourseWareLecture 17: More CountingPractise splitting counting problems into valid cases.

Finished this module? Mark it done.

Comments

Stuck on something, spotted a mistake, or found a resource that helped you? Tell us below.

Loading comments