Chap5 Combinatorics 20-11-24
Chap5 Combinatorics 20-11-24
Subtopics
5.0 Introduction Solution:
5.1 Counting Problems Task 1 coin {h, t}. Task 2 die {1, 2, 3, 4, 5, 6}
5.2 Permutations & Combinations Multiplication principle
5.3 Binomial Theorem 𝑇𝑜𝑡𝑎𝑙 𝑜𝑝𝑡𝑖𝑜𝑛𝑠 = 2 × 3 = 6
5.0 Introduction Q1. Construct a tree diagram.
Combinatorics is a branch of Mathematics Example 5.1c
that deals with combinations of objects. You are to create 3-digit even numbers.
Objects belong to a finite set How many options are possible?
Given restrictions or constraints Solution:
Mainly counting and arrangement Repetition is allowed.
Applications 10 digits: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
1. Programming i.e analyse algorithms 1st: {1, 2, 3, 4, 5, 6, 7, 8, 9} = 9 ways
2. Computer networking i.e IP addresses 2nd: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} = 10 ways
3. Probability Theory i.e compute probs 3rd: {0, 2, 4, 6, 8} = 5 ways
4. Gambling i.e count configurations Multiplication Principle.
5. Proof technique i.e combinatorial proof Total = 9 x 10 x 5 = 450
Addition Principle
5.1 Counting Problems
1. Mutually exclusive tasks
Multiplication Principle
Both tasks cannot be done together.
𝑇𝑎𝑠𝑘 1 ℎ𝑎𝑠 𝑚 𝑤𝑎𝑦𝑠. 𝑇𝑎𝑠𝑘 2 ℎ𝑎𝑠 𝑛 𝑤𝑎𝑦𝑠.
Compare disjoint sets i.e no intersection.
𝑇𝑜𝑡𝑎𝑙 𝑜𝑝𝑡𝑖𝑜𝑛𝑠 = 𝑚 × 𝑛
𝑇𝑎𝑠𝑘 1 ℎ𝑎𝑠 𝑚 𝑤𝑎𝑦𝑠. 𝑇𝑎𝑠𝑘 2 ℎ𝑎𝑠 𝑛 𝑤𝑎𝑦𝑠.
Example 5.1a
𝑇𝑜𝑡𝑎𝑙 𝑜𝑝𝑡𝑖𝑜𝑛𝑠 = 𝑚 + 𝑛 𝑤𝑎𝑦𝑠.
A man has 2 shirts (red, white), 3 trousers
2. Intersecting tasks
(black, grey, purple). How many options
Both tasks can be done together.
does he have to wear in a day?
𝑇𝑎𝑠𝑘 1 ℎ𝑎𝑠 𝑚 𝑤𝑎𝑦𝑠. 𝑇𝑎𝑠𝑘 2 ℎ𝑎𝑠 𝑛 𝑤𝑎𝑦𝑠.
Solution:
𝐵𝑜𝑡ℎ 𝑡𝑎𝑠𝑘𝑠 𝑐𝑎𝑛 ℎ𝑎𝑝𝑝𝑒𝑛 𝑘 𝑤𝑎𝑦𝑠.
Listing 𝑇𝑜𝑡𝑎𝑙 = 𝑚 + 𝑛 − 𝑘 𝑤𝑎𝑦𝑠.
Start with shirts Refer to Set Theory & Probability Theory.
RB, RG, RP or WB, WG, WP = 6 options Example 5.1d
Tree diagram B In some countries, car number plates have
G 3 letters followed by 3 numbers, and also
R
P 3 numbers followed by 3 letters. How many
6 ways
B permutations are available?
w
G Solution:
P 3 letters followed by 3 numbers:
𝑚 = 26 × 26 × 26 × 10 × 10 × 10
Task 1 shirt {R, W}. Task 2 trouser {B, G, R} 3 numbers followed by 3 letters
Multiplication principle 𝑛 = 10 × 10 × 10 × 26 × 26 × 26
𝑇𝑜𝑡𝑎𝑙 𝑜𝑝𝑡𝑖𝑜𝑛𝑠 = 2 × 3 = 6 Addition Principle
Alt: 𝑇𝑜𝑡𝑎𝑙 = 𝑚 + 𝑛 = 35,052,000
3 trousers followed by 2 shirts. Exercise 5.1
BR, BW or GR, GW or PR, PW = 6 options 1. How many outcomes are possible?
Example 5.1b (a) A die is rolled twice
Toss a coin and then throw a die. How many (b) A coin is tossed 3 times
possible outcomes are there?
Musingo Stephen Mutenyo 0782-506878 Lecturer ICT & Eng. Dept. UICT Nakawa Page 1 of 7
CHAPTER 5 COMBINATORICS
2. At a function there is: Applications
Food (posho, matooke, cassava) 1. Pin numbers i.e permutations
Sauce (beef, fish, peas) 2. Passwords i.e permutations
Drinks (water, soda, juice) 3. Car number plates i.e permutations
You are supposed to serve more than 4. Lottery numbers i.e combinations
one item from each category. Factorial notation
How many options are possible? 𝑛! = 𝑛 × (𝑛 − 1) × (𝑛 − 2) … × 1
3. Bag A has beads (3 red, 4 blue) 𝑒. 𝑔 5 factorial: 5! = 5 × 4 × 3 × 2 × 1
Bag B has beads (5 red, 3 blue) 𝑛! = 𝑛 × (𝑛 − 1)! 𝑒𝑔 5! = 5 × 4!
Pick 2 beads, one from each bag.
How many options of colours are Note:
expected? By formula 1! = 1.
4. Car number plates have 3 letters By definition also 0! = 1.
followed by 3 digits. How many Permutations with repetition
permutations are available? An item is used more than once.
5. A young married couple wishes to have 6 These are easy to calculate. Why?
children, balancing gender. How many Options of items continue remaining same.
sequences of gender are possible? Let 𝑛 = number of unique items
6. A box contains 8 blue socks and 6 red 1st: n ways. 2nd: n ways. 3rd: n ways etc.
socks. Find the number of ways two 𝑃𝑒𝑟𝑚𝑢𝑡𝑎𝑡𝑖𝑜𝑛𝑠 = 𝑛 × 𝑛 × 𝑛 …
socks can be drawn from the box if they For example, choosing only 3:
are of: 𝑇𝑜𝑡𝑎𝑙 = 𝑛 × 𝑛 × 𝑛 = 𝑛3
(a) any color (b) same color. General:
7. A family consists of mother, father, Let 𝑟 be picked from 𝑛 items.
3 girls and 5 boys. How many ways can 𝑇𝑜𝑡𝑎𝑙 = 𝑛 × 𝑛 × 𝑛 … (𝑟 𝑡𝑖𝑚𝑒𝑠) = 𝑛𝑟
they choose: Example 5.2a
(a) one girl to wash the dishes and one MTN mobile money pin number consists of
boy to dry the dishes? 5 digits. How many permutations are there?
(b) a boy, a girl, and a parent to go Solution:
grocery shopping? 10 digits {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
(c) one child and one parent to sweep Repetition is allowed eg 33333.
the garage? 𝑇𝑜𝑡𝑎𝑙 = 10 × 10 × 10 × 10 × 10 = 105
(d) a father or a girl to take out the Permutations without repetition
trash? An item is not used more than once.
(e) a female or a child to wash the car? These are tricky to calculate. Why?
5.2 Permutations & Combinations Options of items keep on reducing.
Compare: Let 𝑛 = number of items to arrange
1. Permutations i.e order considered 1st: n ways. 2nd: n-1 ways. 3rd: n -2 ways
2. Combinations i.e order not considered etc.
For example, 2 letters taken from A B C. 𝑇𝑜𝑡𝑎𝑙 = 𝑛 × (𝑛 − 1) × (𝑛 − 2) … × 1 = 𝑛!
Permutations: order considered. Example 5.2b
AB AC BC Find the number of permutations of the
BA CA CB Total = 6 ways. 3 letters A B C.
Combinations: order not considered. Solution:
AB AC BC Listing. Order considered
BA CA CB Total = 3 ways. ABC ACB BAC BCA CAB, CBA Total = 6 ways
Musingo Stephen Mutenyo 0782-506878 Lecturer ICT & Eng. Dept. UICT Nakawa Page 2 of 7
CHAPTER 5 COMBINATORICS
Multiplication principle Permutations with restrictions/constraints
1st: 3 ways, 2nd: 2 ways, 3rd: 1 way. Example 5.2e
𝑇𝑜𝑡𝑎𝑙 = 3 × 2 × 1 = 6 𝑤𝑎𝑦𝑠 Find the number of different ways the
𝑁𝑜𝑡𝑒: 3 × 2 × 1 = 3! (3 𝑓𝑎𝑐𝑡𝑜𝑟𝑖𝑎𝑙) letters of the word SUPER are to be
Example 5.2c arranged so that the vowels U E stay
Find the number of permutations of together.
3 letters taken from 5 letters A B C D E. Solution:
Solution: Trick: Let UE represent only 1 letter.
1st: 5 ways. 2nd: 4 ways. 3rd: 3 ways SPR[UE] equivalent to 4 letters i.e 4!.
5 × 4 × 3 × 2 × 1 5! But UE also has permutations i.e 2!
5 × 4 × 3= = 𝑇𝑜𝑡𝑎𝑙 = 4! × 2! = 48
2×1 2!
Combinations
Permutation Formula 1. Combinations without repetition
Let 𝑟 items be picked from 𝑛 items. These are easy to calculate. Why?
No. of permutations is given by: To be considered here. See examples.
n n!
Pr = P(n, r) = (n−r)! 2. Combinations with Repetition
For example, 3 items picked from 5 items. These are harder to calculate. Why?
5 5! 5! They will not be considered here.
P3 = P(5,3) = (5−3)! = = 60 Combination Formula
2!
Let 𝑟 items be picked from 𝑛 items.
Note: No. of combinations is given by:
n n n
P0 = 1 P1 = n Pn = n! n!
n
Cr = C(n, r) = (nr) = (n−r)!r!
Permutations with repeated items For example, 3 items from 5 items:
Repetitions of only 1 item 5!
𝑛!
5
C3 = C(5,3) = (5) = (5−3)!3! = 10
𝑝𝑒𝑟𝑚𝑢𝑡𝑎𝑖𝑜𝑛𝑠 = 3
𝑛1 ! On simplification:
n
Repetitions of 2 items C0 = nCn = 1 nC1 = nCn-1 = n nCr = nCn-r
𝑛! Example 5.2f
𝑝𝑒𝑟𝑚𝑢𝑡𝑎𝑖𝑜𝑛𝑠 =
𝑛1 ! 𝑛2 ! Out of a group of 10 athletes, the best 3
Example 5.2d (1st, 2nd, 3rd) are to be given trophies.
Find the number of distinct ways the letters In how many ways can this be done?
of the word ALL can be arranged. Solution:
Solution: Order is required i.e permutations.
Permutations required. 10 10!
Listing P3 = P(10,3) = (10−3)! = 720
1st Ls together. ALL LLA 2 ways Example 5.2g
2nd Ls separate. LAL 1 way only A committee of 10 members wants to select
𝑝𝑒𝑟𝑚𝑢𝑡𝑎𝑖𝑜𝑛𝑠 = 2 + 1 = 3 𝑤𝑎𝑦𝑠 3 executive members (chair, secretary,
treasurer). In how many ways can they do
Factorial formula
this?
1st all the 3 letters. 3! ways
Solution:
2nd the 2 repeated letters. 2! ways
3! Order is not required ie combinations.
𝑝𝑒𝑟𝑚𝑢𝑡𝑎𝑖𝑜𝑛𝑠 = = 3
2!
10
C3 = C(10,3) = (10
3
10!
) = (10−3)!3! = 120
Q2. Find permutations for letters in the
words: (a) BUSINESS (b) COMMUNICATION
Musingo Stephen Mutenyo 0782-506878 Lecturer ICT & Eng. Dept. UICT Nakawa Page 3 of 7
CHAPTER 5 COMBINATORICS
Example 5.2h 6. A pass word is to have 5 characters,
A group has 3 women and 4 men. with 3 letters and 2 digits. How many
A committee consisting of 1 woman and different sequences are possible?
3 men is to be formed. In how many ways 7. Out of 7 consonants and 4 vowels, how
can this be done? many words of 3 consonants and 2
Solution: vowels can be formed?
Order not required i.e combinations. 8. A class has 10 students (6 boys, 4 girls).
Selecting 1 woman from 3 women; 3C1 Find the number of ways to:
Selecting 3 men from 4 men; 4C3 (a) Select a 4-member committee
Total = 3C1 x 4C3 = 3 x 4= 12 (b) Select a 4-member committee of
Example 5.2i (c) 2 boys and 2 girls
A box has 5 black balls and 3 red balls. (d) Elect a president, secretary, and
5 balls are to be selected such that at least treasurer who are all boys.
3 are black. In how many ways can this be 9. A class has 9 boys and 3 girls. A teacher
done? wants to select a committee of 4
Solution: students. Find the number of ways for:
At least 3 black balls means: (a) no restrictions
3B 2R, 4B 1R, 5B 0R (b) 2 boys and 2 girls
3B from 5B and 2R from 3R: 5C3 x 3C2 (c) exactly one girl
4B from 5B and 1R from 3R: 5C4 x 3C1 (d) at least one girl.
5B from 5B and 0R from 3R: 5C5 x 3C0 5.3 Binomial Theorem
5C x 3C + 5C Refers to expansion of Binomial
3 2 4 x 3C1 + 5C5 x3C0 = 46
expressions. Used to find coefficients.
Exercise 5.2 For example, expansion of (a + b)8.
1. Find the number of permutations that
Applications
can be obtained from the letters of the
1. Binomial probabilities
word:
2. Binomial expressions
(a) HELLO (b) SUCCESS (c) SWIMMING
The 2 methods for expansion are:
2. Find the number of distinct ways the
1. Pascal’s Triangle i.e lower indices ≤5
letters of the words given are to be
2. Binomial Expansion i.e higher indices >5
arranged so that the vowels stay
together. Pascal Triangle
(a) LEADING (b) CORPORATION
3. How many ways can the letters in the 𝑛 = 0 1
word PARALLEL be arranged if the 𝑛 = 1 1 1
letters P and R are together? 𝑛 = 2 1 2 1
4. How many 4 digit numbers divisible by 𝑛 = 3 1 3 3 1
10 can be formed from the numbers 𝑛 = 4 1 4 6 4 1
{0, 3, 5, 7, 8, 9} such that no number
repeats? Where 𝑛 refers to index/power of
5. You are to create 4-digit numbers. How expression. Each row shows coefficients of
many options are there if the number is terms. For example, expansion of (a + b)4
odd and larger than 3000? for 5 terms, with coefficients 1 4 6 4 1.
Musingo Stephen Mutenyo 0782-506878 Lecturer ICT & Eng. Dept. UICT Nakawa Page 4 of 7
CHAPTER 5 COMBINATORICS
Example 5.3a 8C ⇒ 𝑏s = 8 and 𝑎s = 0
8
Expand the expressions: Expressions: a8b0 a7b1 a6b2 . . . a0b8
(𝑖) (𝑎 + 𝑏)2 (ii) (𝑎 + 𝑏)3 (a + b)8
Solution: = 8C0.a8b0 + 8C1.a7b1 + 8C2.a6b2 +...+ 8C8.a0b8
Indices are small (≤5). Use Pascal’s Triangle.
= 8C0a8 + 8C1. a7b + 8C2. a6b2 +... + 8C8b8
(𝑖) (𝑎 + 𝑏)2
Coefficients; 1 2 1 8!
8C
0 = (8−0)!0! = 1
Terms; a2b0 a1b1 a0b2
(𝑎 + 𝑏)2 = 1. 𝑎2 + 2. 𝑎𝑏 + 1. 𝑏 2 8!
= 𝑎2 + 2𝑎𝑏 + 𝑏 2
8C
1 = (8−1)!1! = 8
(𝑖𝑖) (𝑎 + 𝑏)3
8!
Coefficients; 1 3 3 1 8C
2 = (8−2)!2! = 28 e.t.c
Terms; a3b0 a2b1 a1b3 a0b3
(𝑎 + 𝑏)3 (a + b)8 = a8 + 8a7b + 28 a6b2 + ...
= 1. 𝑎3 + 3. 𝑎2 𝑏1 + 3. 𝑎1 𝑏 2 + 1. 𝑏 3
= 𝑎3 + 3𝑎2 𝑏 + 3𝑎𝑏 2 + 𝑏 3 (𝑖𝑖) (𝑎 + 𝑏)9
Note: (a + b )(a + b)(a + b) … 9 groups.
Index of 𝑎 decreases & that of 𝑏 increases Consider combinations of 𝑏s from 9 groups.
Sum of indices of terms Coefficients: 9C0 9C1 9C2 … 9C9
9C ⇒ 𝑏s = 0 and 𝑎s = 9
= Index of expression 0
9C ⇒ 𝑏s = 1 and 𝑎s = 8
Index of 1st + Index of last 1
9C ⇒ 𝑏s = 2 and 𝑎s = 7
2
= Index of expression
Coefficient of 1st = Coefficient of last = 1 e.t.c
9C ⇒ 𝑏s = 9 and 𝑎s = 0
Coefficient of 3rd = Index of expression 9
Terms: a9b0 a8b1 a7b2 . . . a0b9
Binomial Expansion (a + b)9
Use Binomial coefficients.
Example 5.3b = 9C0.a9b0 + 9C1. a8b1 + 9C2. a7b2 +...+ 9C9 a0b9
(a) Expand up to the 3rd term: = 9C0. a9 + 9C1. a8b + 9C2. a7b2 +...+ 9C9 b9
(i) (a + b)8 (ii) (a + b)9
9!
(b) Find the 6th term of (a + b)8 9C
0 = (9−0)!0! = 1
Solution:
Indices are big (>5). Use Binomial Theorem. 9!
9C
1 = (9−1)!1! = 9
Indices of 𝑎 decrease, those of 𝑏 increase.
(a) 9!
(i) (a + b)8
9C
2 = (9−2)!2! = 36 e.t.c
(a + b )(a + b)(a + b) … 8 groups. (a + b)9 = a9 + 9a8b + 36 a7b2 + ...
Consider combinations of 𝑏s from 8 groups. (b)
Coefficients: 8C0 8C1 8C2 … 8C8 8!
(i) 6th term = 8C6. a2b6 = a2b6 = 28a2b6
8C
2!6!
0 ⇒ 𝑏s = 0 and 𝑎s = 8 Q3.
8C
1 ⇒ 𝑏s = 1 and 𝑎s = 7 (a) Show that 9C9 = 9C0 = 1.
(b) Compute all other coefficients.
8C ⇒ 𝑏s = 2 and 𝑎s = 6
2 (c) Find the 7th term of (a + b)9.
e.t.c
Musingo Stephen Mutenyo 0782-506878 Lecturer ICT & Eng. Dept. UICT Nakawa Page 5 of 7
CHAPTER 5 COMBINATORICS
General Binomial Theorem Example 5.3d
(𝑎 + 𝑏)𝑛 (a) Expand up to the 4th term:
(a + b )(a + b)(a + b) … 9 groups. (i) 1/(1 + 𝑥) (ii) √1 + 𝑥
Coefficients: nC0 nC nC … nCn State the range of 𝑥 for validitity.
1 2
(b) Find the 8th term of 1/(1 + 𝑥).
Expressions: anb0 an-1b1 an-2b2. . . a0bn Solution:
(a + b)n (a) 1/(1 + 𝑥) = (1 + 𝑥)−1
= nC0. anb0 + nC1. an-1b1 + nC2. an-2b2 + ... + (a + b)n
(1 + 𝑥)−1
n n n-1 n n-2 2 n
= a + C1. a b + C2. a b + ... + b (−1)(−2) 2 (−1)(−2)(−3) 3
=1−𝑥+ 𝑥 + 𝑥 +⋯
Alt: Summation format 2! 3!
𝑛
𝑛 = 1 − 𝑥 + 𝑥2 − 𝑥3 + …
(𝑎 + 𝑏) = ∑ ( ) 𝑎𝑛−𝑟 𝑏 𝑟
𝑛
𝑟 Range/Condition for validity:
𝑟=0
Q4. Find the expression for the 𝑛𝑡ℎ term. −1 < 𝑥 < +1 |𝑥| < 1
(b) √1 + 𝑥 = (1 + 𝑥)1/2
Example 5.3c
1
Expand (1 − 𝑥)10 up to 3rd term. (1 + 𝑥)2
Hence estimate (0.99)10 to 4 dp. 1 1 1 1 3
1 ( ) (− ) ( ) (− ) (− )
Solution: =1+ 𝑥+
2 2 2
𝑥 +
2 2 2 𝑥3
(1 − 𝑥)10 2 2! 3!
+⋯
= 1+ 10C (−𝑥) + 10C (−𝑥)2 +... 1 1 1
1 2 = 1 + 𝑥 − 𝑥2 + 𝑥3 + …
2 8 16
= 1 - 10𝑥 + 45𝑥2 + … Condition for validity:
10! 10! |𝑥| < 1 −1 < 𝑥 < +1
10C
1 = = 10 10C
2 = = 45
9!1! 8!2! General Binomial Theorem
(0.99)10= (1 − 0.01)10 1
= (1 + 𝑥)−𝑛
(1 + 𝑥)𝑛
≅ 1 − 10 × 0.01 + 45 × (0.01)2 = 0.9045
Check Calculator: (0.99)10 ≅ 0.904382 Where 𝑛 is a positive integer.
√0.99 = (1 − 0.01)1/2
Then 𝑥 = 0.01
1
(1 − 0.01)2
1 1
≅ 1 − (0.01) − (0.01)2
2 8
= 1 − 0.005 − 0.0000125
= 0.994985 ≅ 0.995 3 𝑑. 𝑝
Exercise 5.3
1. (a) Use Pascal’s triangle and expand:
(𝑖) (𝑎 + 𝑏)4 (𝑖𝑖) (𝑎 + 𝑏)5
(b) Use Binomial theorem and expand
up to the 3rd term:
(𝑖) (𝑎 + 𝑏)10 (𝑖𝑖) (𝑎 + 𝑏)20
2. Find:
(a) third term on expansion of
(2𝑥 − 3𝑦)4
(a) a constant term on expansion of
2
𝑥 (𝑥 − 𝑥)8
Musingo Stephen Mutenyo 0782-506878 Lecturer ICT & Eng. Dept. UICT Nakawa Page 7 of 7