UcenlyOpen in the app

Discrete Mathematics and Graphs · BE5B01DMG · Topic 10 of 12

Counting, repetition and inclusion–exclusion

Decide whether order and repetition matter, then encode the objects without double counting.

Open the interactive lesson

Key ideas

Ordered or unordered

Choose k different objects from n: ordered choices give n!/(n−k)!; unordered choices divide by k!. With repetition and order, there are n^k sequences.

Repeated types

For k identical objects distributed among r labelled boxes, encode a count vector using k stars and r−1 separators. Zero counts are allowed.

Repeated symbols

A word with n letters and multiplicities m₁,…,mᵣ has n!/(m₁!⋯mᵣ!) distinct arrangements. The binomial theorem similarly counts ways to choose terms from factors.

Correct overlaps

Add single-set sizes, subtract pairwise overlaps, add triple overlaps. For permutations with no fixed points, inclusion–exclusion gives the derangement formula.

In one line: State what makes two outcomes different before choosing a counting formula.

Formulas

Practice with worked solutions

Question 1

How many different arrangements (words, with or without meaning) can be made using all the letters of STATISTICS?

Worked solution

Answer: 50400

  1. (103,3,1,2,1)=10!3! 3! 1! 2! 1!=362880072=50400\binom{10}{3,3,1,2,1}=\frac{10!}{3!\,3!\,1!\,2!\,1!}=\frac{3628800}{72}=50400

The 10 letters are S×3, T×3, A×1, I×2, C×1. Arrangements of a multiset are counted by the multinomial coefficient 10!/(3!·3!·1!·2!·1!)=3628800/72=50400.

Question 2

A club has 60 members. 28 play chess, 25 play go and 22 play bridge. 9 play chess and go, 8 play chess and bridge, 6 play go and bridge, and 3 play all three games. How many members play none of the games?

Worked solution

Answer: 5

  1. ∣C∪G∪B∣=28+25+22−9−8−6+3=55|C\cup G\cup B|=28+25+22-9-8-6+3=55
  2. 60−55=560-55=5

By inclusion–exclusion |C∪G∪B|=28+25+22−9−8−6+3=55. The members outside the union are 60−55=5.

Question 3

Seven letters are put at random into seven addressed envelopes, one letter per envelope. In how many ways does no letter land in its own envelope?

Worked solution

Answer: 1854

  1. Dn=n!∑i=0n(−1)ii!D_n=n!\sum_{i=0}^{n}\frac{(-1)^i}{i!}
  2. D7=5040−5040+2520−840+210−42+7−1=1854D_7=5040-5040+2520-840+210-42+7-1=1854

These are permutations without fixed points (derangements): D₇=7!·(1−1+1/2!−1/3!+1/4!−1/5!+1/6!−1/7!)=5040−5040+2520−840+210−42+7−1=1854.

More Discrete Mathematics and Graphs practice in Ucenly

Sources

Written by Ucenly. Based on the BE5B01DMG course materials: