Counting Techniques
Counting Techniques
S.E.(COMPUTER/IT)(SEM.-IV)
COUNTING TECHNIQUES
➢PIGEONHOLE PRINCIPLE
➢BINOMIAL THEOREM
BASICS OF COUNTING
• Sum Rule: If an event can occur in m ways and another event can occur
in n ways, and if these two events cannot occur simultaneously, then one
of the two events can occur in 𝒎 + 𝒏 ways.
• Example 1: If there are 9 boys and 10 girls in a class, there are 9 + 10 =
19 ways of selecting one student as a class representative.
Example 6: Find the number of ways in which 6 boys and 6 girls can be arranged in a row under the
following conditions:
a. All boys are to be seated together and all girls are to be seated together.
Solution: Consider the group of 6 boys as one unit and the group of 6 girls as one unit. We have to find
the number of arrangements of these two units and the internal arrangement of the boys and girls
Total number of arrangements = 6! ∙ 6! ∙ 2! = 1036800
PERMUTATIONS AND COMBINATIONS
b. Boys and girls take their seats alternately.
Solution: The 6 boys can be arranged in 6! ways. The 6 girls can be arranged between the 6 boys in
6! ways. Since we can start with a boy or girl, for each of these arrangements, there are two ways.
Total number of arrangements = 6! ∙ 6! ∙ 2! = 1036800
c. Two girls should not be seated together
The 6 boys can be arranged in 6! ways. Place the girls between the boys in seven places in 7𝑃2 ways
Total number of arrangements = 6! ∙ 7𝑃6 = 3628800
d. Boys occupy the extreme positions
Two boys can be seated in the extreme positions in 6𝑃2 ways.
The remaining students can be arranged in 10! Ways
Total number of arrangements = 10! ∙ 6𝑃2 = 108864000
PERMUTATIONS AND COMBINATIONS
Example 7: In how many ways can 3 diamonds and 2 clubs be selected from a pack of cards?
Solution: There are 13 diamonds and 13 clubs in a pack of cards. Thus, the number of ways to select 3
cards is 13𝐶3 ∙ 13𝐶2 = 22308
Example 9: There are 5 girls and 4 boys in a group. Find the number of ways in which a committee of 5
students can be formed under the following conditions:
a. There is no restriction
Solution: Number of ways to form the committee = 9𝐶5 = 126
PERMUTATIONS AND COMBINATIONS
b. There are two boys in the committee
Solution: Since there are two boys, remaining three are girls
Number of ways to form the committee = 4𝐶2 ∙ 5𝐶3 = 60
c. There are at least two girls in the committee
5
Solution: (i) 2 girls, 3 boys = 𝐶2 ∙ 4𝐶3 = 40
(ii) 3 girls, 2 boys = 5𝐶3 ∙ 4𝐶2 = 60
(iii)4 girls, 1 boy = 5𝐶4 ∙ 4𝐶1 = 20
(iv) all 5 girls = 5𝐶5 = 1
Number of ways to form the committee = 40 + 60 + 20 + 1 = 121
d. There are at most two girls in the committee
5
Solution: (i) 2 girls, 3 boys = 𝐶2 ∙ 4𝐶3 = 40
(ii) 1 girl, 4 boys = 5𝐶1 ∙ 4𝐶4 = 5
Number of ways to form the committee = 40 + 5 = 45
GENERALIZED PERMUTATIONS AND COMBINATIONS
Theorem: The number of r-permutations of a set of n objects with repetition allowed is 𝑛𝑟 .
Example: The number of strings of length 4 that can be generated from the set 𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓 if
repetition is allowed= 64 = 1296
Theorem: The number of different permutations of n objects where there are n1
𝑛!
indistinguishable objects of type 1, n2 of type 2, and … nk of type k is
𝑛1 !𝑛2 !⋯𝑛𝑘 !
• An equivalent ways of interpreting this theorem is the number of ways to distribute n
distinguishable objects into k distinguishable boxes so that ni objects are place into box i for
i=1,2,3,…,k
Example 1: In how many ways 6 letters can be placed in 6 envelopes such that no letter
is placed in its corresponding envelope?
1 1 1 1 1 1
Solution: Number of ways = 𝐷6 = 6! 1 − + − + − + = 265
1! 2! 3! 4! 5! 6!
GENERALIZED PERMUTATIONS AND COMBINATIONS
• Theorem: There are 𝑛+𝑟−1
𝑟
r-combinations from a set with n elements
when repetition of elements is allowed
Example 1: The number of ways to select three balls from a bag that contain
balls of 4 different colors, if repetition is allowed is 4+3−1
3
= 6
3
= 20
Example 2: There are some cans of Coke, Pepsi and sprite in a refrigerator.
In how many ways can 5 cans be selected?
Solution: Here n = 3 and 𝑟 = 5. Therefore, the total combinations are
3+5−1 7
5
= 5
= 21
GENERALIZED PERMUTATIONS AND COMBINATIONS
Example 3: How many solutions does the equation 𝑥1 + 𝑥2 + 𝑥3 = 10 have if 𝑥1 , 𝑥2 , 𝑥3
are non-negative integers?
Solution: The problem is similar to finding number of ways to select 10 objects from a
set of 3 objects where each element can be repeated any number of times. Here n =
3 and 𝑟 = 10. Therefore, the total combinations are 3+10−1
10
= 12
10
= 66
Example 2: In a group of 27 English words, there must be at least two that begin with the same alphabet.
Consider 27 English words – 27 pigeons
26 Alphabets – 26 pigeonholes
Therefore, by Pigeonhole principle, there are at least two who that begin with the same alphabet.
Example 3: Show that if any 5 numbers from 1 to 8 are chosen, then the sum of at least one pair among
them is 9.
Solution: Construct pairs of numbers from 1 to 8 that add to 9.
PIGEONHOLE PRINCIPLE
1,8 , 2,7 , 3,6 4,5
There are four such pairs.
Consider these four pairs as 4 pigeonholes and the 5 numbers to be chosen as 5 pigeons
By pigeonhole principle, two numbers will belong to the same pair and these numbers add to 9.
Example 4: If 51 numbers are chosen from the integers between 1 and 100, prove that 2 of the chosen
numbers are consecutive.
Solution: There are 50 pairs of consecutive numbers
1,2 , 3,4 , 5,6 , ⋯ 99,100
Consider these 50 pairs as 50 pigeonholes and the 51 numbers chosen as 51 pigeons.
By pigeonhole principle, two numbers will belong to the same pair and these numbers are consecutive.
PIGEONHOLE PRINCIPLE
Example 5: Show that in any set of 11 integers, there are at least two integers whose difference is divisible
by 10.
Solution: The possible remainders on dividing a number by 10 are 0, 1, 2, 3, … ,9.
Consider these 10 remainders as 10 pigeonholes and 11 integers as 11 pigeons.
If we divide the 11 integers by 10, by Pigeonhole principle, at least two of the integers will have the same
remainder.
Let 𝑎1 and 𝑎2 be these integers .
𝑎1 = 10𝑞1 + 𝑟 and
𝑎2 = 10𝑞2 + 𝑟
∴ 𝑎1 − 𝑎2 = 10(𝑞1 −𝑞2 )
i.e. 𝑎1 − 𝑎2 = 10𝑚
∴ 𝑎1 − 𝑎2 is divisible by 10.
PIGEONHOLE PRINCIPLE
Example 6: Every positive integer n can be written as 𝑛 = 2𝑘 ∙ 𝑚 where m is odd and k is a non-negative
integer. Using this fact or otherwise, show that if 101 integers are chosen from the set {1, 2, 3, … ,200},
then at least one of them is a multiple of some other number in the chosen collection of numbers.
Solution: Since there are 101 integers(pigeons) but only 100 odd numbers between 1 to 200(pigeonholes)
that can be odd parts of these numbers, by pigeonhole principle, there will be at least two integers with
the same odd part.
Let 𝑛1 and 𝑛2 be these integers .
𝑛1 = 2𝑘1 ∙ 𝑚 and 𝑛2 = 2𝑘2 ∙ 𝑚 for some 𝑘1 , 𝑘2 > 0.
𝑛1
If 𝑘1 > 𝑘2 , = 2𝑘1 −𝑘2 = 𝑝(integer)
𝑛2
⟹ 𝑛1 is a multiple of 𝑛2
𝑛2
If 𝑘1 < 𝑘2 , = 2𝑘2 −𝑘1 = 𝑞(integer)
𝑛1
⟹ 𝑛2 is a multiple of 𝑛1
PIGEONHOLE PRINCIPLE
Example 7: Show that in any room of n persons 𝑛 ≥ 2 who have been doing handshaking,
there will be at least two persons who have shaken hand the same number of times.
Solution: Minimum number of handshakes any person can have is 0
Maximum number of handshakes any person can have is n-1.
Consider number of handshakes as pigeonholes and n persons as n pigeons.
The labels on pigeonholes will go from 0 to n-1
i.e we have n pigeons and n pigeonholes.
But, it is not possible for the 0th and (n-1)th hole to be occupied together, because if one person
has not shaken hands with anybody, then there cannot be any other person who have shaken
hands with every other person. Thus, we have (n-1) holes occupied at any given time.
Hence, by pigeonhole principle, at least two of the holes have at least two occupants, which
shows that there are at least two persons with the same number of handshakes.
PIGEONHOLE PRINCIPLE
Example 8:Use the pigeonhole principle to show that if any 5 points are chosen at
random within a square of length 2, there are at least two points whose distance apart is
at most 2 units. 1 1
Solution: Divide the square into 4 smaller sub-squares
2
by bisecting each side and joining these points. 1 1 1
Consider these 4 sub-squares as 4 pigeonholes and
the 5 points as 5 pigeons. 1 1
Hence, by pigeonhole principle, at least two points 1 1 1
will be in the same sub-square and the distance between
them will be at most 2 units.
1 1
PIGEONHOLE PRINCIPLE
Example 9: Consider 5 distinct points (xi, yi) with integer values, where i = 1, 2, 3, 4, 5.
Show that the midpoint of at least one pair of these five points also has integer coordinates.
Solution: The midpoint of a segment from (a,b) to (c,d) is ( (a+c)/2, (b+d)/2 )
Note that the midpoint will be integers if a and c have the same parity: are either both even or
both odd. Same applies to integers b and d.
There are four parity possibilities which we consider 4 pigeonholes
(even, even), (even, odd), (odd, even), (odd, odd)
Since we have 5 points(5 pigeons), by the pigeonhole principle, there must be two points that
have the same parity possibility
Thus, the midpoint of those two points will have integer coordinates.
PIGEONHOLE PRINCIPLE PRACTICE PROBLEMS
1. Use pigeonhole principle to show that, if any five points are
randomly placed in an equilateral triangle of length 2 cms, then
there are atleast two points which are at most 1 cm apart.
100
Example 1: Amongst 100 people, there must be at least = 9, who were born in the
12
same month.
Example 2: If 9 books are to be arranged on 4 shelves, then there must be at least one
shelf containing at least 3 books.
Solution: 9 books – 9 pigeons
4 shelves – 4 pigeonholes
9
By extended pigeonhole principle, at least one shelf will contain = 3 books
4
EXTENDED PIGEONHOLE PRINCIPLE
Example 3: Suppose 8 integers from 1 to 20 are selected at random. From these eight
integers, if we form groups of three, then show that at least two groups will have the
same sum.
Solution: There are 8𝐶3 = 56 groups of three (56 pigeons) that can be formed from
the 8 integers.
Minimum sum possible = 1+2+3=6
Maximum sum possible =18+19+20=57
There are 52 sums possible which are considered 52 pigeonholes
56
By extended pigeonhole principle, at least = 2 groups will have the same sum.
52
EXTENDED PIGEONHOLE PRINCIPLE
Example 3: What is the minimum number of students required in a discrete Math class
to be sure that at least six will receive the same grade, if there are five possible grades, A,
B, C, D, and F?
Solution: Let n be the number of students(pigeons) required
5 grades - 5 pigeonholes
𝑛
= 6 ⟹ n=26
5
OR
𝑘 = 5 and 𝑛 + 1 = 6 ⟹ 𝑛 = 5
Therefore, number of students(pigeons)= 𝑛𝑘 + 1 = 5 ∙ 5 + 1 = 26
EXTENDED PIGEONHOLE PRINCIPLE
Example 4: A bowl contains 10 red and 10 yellow balls. How many balls must be selected
to ensure 3 balls of the same color?
Solution: Let n be the number of balls(pigeons) to be selected
2 colors - 2 pigeonholes
𝑛
= 3 ⟹ n=5
2
OR
𝑘 = 2 and 𝑛 + 1 = 3 ⟹ 𝑛 = 2
Therefore, number of balls(pigeons) to be selected = 𝑛𝑘 + 1 = 2 ∙ 2 + 1 = 5
PRINCIPLE OF INCLUSION-EXCLUSION
• Let A and B be finite sets and 𝑛(𝐴) denotes the number of elements in A. Then
𝑛 𝐴 ∪ 𝐵 = 𝑛 𝐴 + 𝑛 𝐵 − 𝑛(𝐴 ∩ 𝐵)
Note: (i) 𝑛 𝐴 − 𝐵 = 𝑛 𝐴 ∩ 𝐵ത = 𝑛 𝐴 − 𝑛(𝐴 ∩ 𝐵)
(ii) 𝑛 𝐵 − 𝐴 = 𝑛 𝐴ҧ ∩ 𝐵 = 𝑛 𝐵 − 𝑛(𝐴 ∩ 𝐵)
(iii) 𝑛 𝐴ҧ ∩ 𝐵ത = 𝑛 𝑈 − 𝑛(𝐴 ∪ 𝐵)
• If A, B and C are three sets, then
𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 = 𝑛 𝐴 + 𝑛 𝐵 + 𝑛 𝐶 − 𝑛 𝐴 ∩ 𝐵 − 𝑛 𝐴 ∩ 𝐶 − 𝑛 𝐵 ∩ 𝐶 + 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶)
• In general, if 𝐴1 , 𝐴2 , 𝐴3 , ⋯ , 𝐴𝑛 are n finite sets, then
𝑛 =𝑖𝑛ڂ1 𝐴𝑖 = σ𝑛𝑖=1 𝑛(𝐴𝑖 ) − σ𝑛𝑖,𝑗=1 𝑛 𝐴𝑖 ∩ 𝐴𝑗 + σ𝑛𝑖,𝑗,𝑘=1 𝑛 𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘
𝑖<𝑗 𝑖<𝑗<𝑘
− ⋯ + (−1)𝑛+1 𝑛 =𝑖𝑛ځ1 𝐴𝑖
PRINCIPLE OF INCLUSION-EXCLUSION
Example 1: How may bit strings of length eight start with 1 or end with 00?
Solution: Let A be the set of bit strings of length eight that start with 1
𝑛 𝐴 = 27 = 128
Let B be the set of bit strings of length eight that end with 00
𝑛 𝐵 = 26 = 64
𝑛 𝐴 ∩ 𝐵 = 25 = 32
𝑛 𝐴 ∪ 𝐵 = 𝑛 𝐴 + 𝑛 𝐵 − 𝑛 𝐴 ∩ 𝐵 = 128 + 64 − 32 = 160
𝑛
Note: The number of positive integer from 1 to n divisible by k is
𝑘
𝑛
The number of positive integer from 1 to n divisible by k and l is
𝐿𝐶𝑀(𝑘,𝑙)
PRINCIPLE OF INCLUSION-EXCLUSION
Example 3: In a class of 75 students, the number of students who passed in Mathematics is equal to the number
of students who passed in Electronics. The total number of students who passed in exactly one subject is 60. It
was also found that 5 students did not pass any subject. Find the number of students who passed in
(i) both the subjects
(ii) Mathematics only
Solution: Let A be the set of students who passed in Mathematics
Let B be the set of students who passed in Electronics
𝑛 𝑈 = 75; 𝑛 𝐴 = 𝑛 𝐵
𝑛 𝐴 ∩ 𝐵ത + 𝑛 𝐴ҧ ∩ 𝐵 = 60 ; 𝑛 𝐴ҧ ∩ 𝐵ത = 5
𝑛 𝐴 ∪ 𝐵 = 𝑛 𝑈 − 𝑛 𝐴ҧ ∩ 𝐵ത = 75 − 5 = 70
𝑛 𝐴 ∪ 𝐵 = 𝑛 𝐴 ∩ 𝐵ത + 𝑛 𝐴ҧ ∩ 𝐵 + 𝑛 𝐴 ∩ 𝐵
(i) 70 = 60 + 𝑛 𝐴 ∩ 𝐵 ⟹ 𝑛 𝐴 ∩ 𝐵 = 10
𝑛 𝐴 ∪ 𝐵 = 𝑛 𝐴 + 𝑛 𝐵 − 𝑛 𝐴 ∩ 𝐵 ⟹ 𝑛 𝐴 ∪ 𝐵 = 2𝑛 𝐴 − 𝑛 𝐴 ∩ 𝐵 ⟹ 𝑛 𝐴 = 40
(ii) 𝑛 𝐴 ∩ 𝐵ത = 𝑛 𝐴 − 𝑛 𝐴 ∩ 𝐵 = 40 − 10 = 30
PRINCIPLE OF INCLUSION-EXCLUSION
Example 3: A large software development company employs 100 computer programmers. Of them, 45 are
proficient in Java, 30 in C#, 20 in Python, six in C# and Java, one in Java and Python, five in C# and Python,
and just one programmer is proficient in all three languages above. Determine the number of computer
programmers that are not proficient in any of these three languages.
Solution: Let A be the set of computer programmers proficient in Java
Let B be the set of computer programmers proficient in C#
Let C be the set of computer programmers proficient in Python
𝑛 𝑈 = 100; 𝑛 𝐴 = 45, 𝑛 𝐵 = 30, 𝑛 𝐶 = 20
𝑛 𝐴 ∩ 𝐵 = 6 , 𝑛 𝐴 ∩ 𝐶 = 1 , 𝑛 𝐵 ∩ 𝐶 = 5, 𝑛 𝐴 ∩ 𝐵 ∩ 𝐶 = 1
𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 = 𝑛 𝐴 + 𝑛 𝐵 + 𝑛 𝐶 − 𝑛 𝐴 ∩ 𝐵 − 𝑛 𝐴 ∩ 𝐶 − 𝑛 𝐵 ∩ 𝐶 + 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶)
= 45 + 30 + 20 − 6 − 1 − 5 + 1 = 84
𝑛 𝐴ҧ ∩ 𝐵ത ∩ 𝐶ҧ = 𝑛 𝑈 − 𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 = 100 − 84 = 16
PRINCIPLE OF INCLUSION-EXCLUSION
Example 2: How many integers between 1 and 300 (inclusive) are divisible by
(i) at least one of 3,5,7?
(ii) none of 3,5,7?
Solution: Let A = {nZ | (1 n 300) (3|n)}
B = {nZ | (1 n 300) (5|n)}
C = {nZ | (1 n 300) (7|n)}
𝑛 𝐴 = 300/3 = 100 𝑛 𝐴 ∩ 𝐵 = 300/15 = 20 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶) = 300/105 = 2
𝑛 𝐵 = 300/5 = 60 𝑛 𝐴 ∩ 𝐶 = 300/21 =14
𝑛 𝐶 = 300/7 = 42 𝑛 𝐵 ∩ 𝐶 = 300/35 = 8
Therefore, 𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 = 𝑛 𝐴 + 𝑛 𝐵 + 𝑛 𝐶 − 𝑛 𝐴 ∩ 𝐵 − 𝑛 𝐴 ∩ 𝐶 − 𝑛 𝐵 ∩ 𝐶 + 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶)
= 100 + 60 + 42 - (20+14+8) + 2 = 162
(ii) 𝑛 𝐴ҧ ∩ 𝐵ത ∩ 𝐶ҧ = 𝑛 𝑈 − 𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 = 300 − 162 = 138
PRINCIPLE OF INCLUSION-EXCLUSION
Example 4: At a construction site, Jorge is in charge of hiring skilled workers for the project. Out of 80 candidates
that he interviewed, he found that 45 were painters, 50 were electricians, 50 were plumbers,
15 had skills in all three areas, and all of them had skills in at least one of these areas.
If he hired everyone who was skilled in exactly 2 areas, how many candidates were hired?
Solution: Let A be the set of workers who are painters
Let B be the set of workers who are electricians
Let C be the set of workers who are plumbers
𝑛 𝑈 = 80 = 𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 ; 𝑛 𝐴 = 45, 𝑛 𝐵 = 50, 𝑛 𝐶 = 50, 𝑛 𝐴 ∩ 𝐵 ∩ 𝐶 = 15
𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 = 𝑛 𝐴 + 𝑛 𝐵 + 𝑛 𝐶 − 𝑛 𝐴 ∩ 𝐵 − 𝑛 𝐴 ∩ 𝐶 − 𝑛 𝐵 ∩ 𝐶 + 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶)
80 = 45 + 50 + 50 − 𝑛 𝐴 ∩ 𝐵 − 𝑛 𝐴 ∩ 𝐶 − 𝑛 𝐵 ∩ 𝐶 + 15
𝑛 𝐴 ∩ 𝐵 + 𝑛 𝐴 ∩ 𝐶 + 𝑛 𝐵 ∩ 𝐶 = 160 − 80 = 80
𝑛 𝐴 ∩ 𝐵 ∩ 𝐶ҧ + 𝑛 𝐴 ∩ 𝐵ത ∩ 𝐶 + 𝑛 𝐴ҧ ∩ 𝐵 ∩ 𝐶 = 𝑛 𝐴 ∩ 𝐵 − 𝑛 𝐴 ∩ 𝐵 ∩ 𝐶 + 𝑛 𝐴 ∩ 𝐶
−𝑛 𝐴 ∩ 𝐵 ∩ 𝐶 + 𝑛 𝐵 ∩ 𝐶 − 𝑛 𝐴 ∩ 𝐵 ∩ 𝐶
= 𝑛 𝐴 ∩ 𝐵 + 𝑛 𝐴 ∩ 𝐶 + 𝑛 𝐵 ∩ 𝐶 − 3𝑛 𝐴 ∩ 𝐵 ∩ 𝐶
= 80 − 3 × 15 = 35 candidates were hired
PRINCIPLE OF INCLUSION-EXCLUSION
Example 5: Find the number of primes not exceeding 100?
Solution: We first find the number of composites not exceeding 100 using the fact that if n > 1 is a
composite number, then n has a prime divisor not exceeding 𝑛.
100 = 10 and the prime factors less than or equal to 10 are 2, 3, 5, 7.
Any composite number not exceeding 100 must be divisible by at least one of 2, 3, 5, 7
Let A be the set of integers not exceeding 100 divisible by 2
Let B be the set of integers not exceeding 100 divisible by 3
Let C be the set of integers not exceeding 100 divisible by 5
Let D be the set of integers not exceeding 100 divisible by 7
𝑛 𝐴 = 100/2 = 50 𝑛 𝐵 = 100/3 = 33 𝑛 𝐶 = 100/5 = 20 𝑛 𝐷 = 100/7 = 14
𝑛 𝐴 ∩ 𝐵 = 100/6 = 16 𝑛 𝐴 ∩ 𝐶 = 100/10 =10 𝑛 𝐴 ∩ 𝐷 = 100/14 =7
𝑛 𝐵 ∩ 𝐶 = 100/15 = 6 𝑛 𝐵 ∩ 𝐷 = 100/21 = 4 𝑛 𝐶 ∩ 𝐷 = 100/35 = 2
𝑛(𝐴 ∩ 𝐵 ∩ 𝐶) = 100/30 = 3 𝑛(𝐴 ∩ 𝐵 ∩ 𝐷) = 100/42 = 2
𝑛(𝐴 ∩ 𝐶 ∩ 𝐷) = 100/70 = 1 𝑛(𝐵 ∩ 𝐶 ∩ 𝐷) = 100/105 = 0
𝑛(𝐴 ∩ 𝐵 ∩ 𝐶 ∩ 𝐷) = 100/210 = 0
PRINCIPLE OF INCLUSION-EXCLUSION
𝑛 𝐴∪𝐵∪𝐶∪𝐷 =𝑛 𝐴 +𝑛 𝐵 +𝑛 𝐶 +𝑛 𝐷 −𝑛 𝐴∩𝐵 −𝑛 𝐴∩𝐶 −𝑛 𝐴∩𝐷
−𝑛 𝐵 ∩ 𝐶 − 𝑛 𝐵 ∩ 𝐷 − 𝑛 𝐶 ∩ 𝐷 + 𝑛 𝐴 ∩ 𝐵 ∩ 𝐶 + 𝑛 𝐴 ∩ 𝐵 ∩ 𝐷
+𝑛 𝐴 ∩ 𝐶 ∩ 𝐷 + 𝑛 𝐵 ∩ 𝐶 ∩ 𝐷 − 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶 ∩ 𝐷)
= 50 + 33 + 20 + 14 − 16 − 10 − 7 − 6 − 4 − 2 + 3 + 2 + 1 + 0 − 0
= 78
𝑛 𝐴 ∪ 𝐵 ∪ 𝐶 ∪ 𝐷 includes the numbers 2, 3, 5, 7 which are not composite.
Number of composites not exceeding 100 = 78 − 4 = 74
Also, 1 is neither prime nor composite.
Therefore, number of primes not exceeding 100 = 99 − 74 = 25
PASCAL’S IDENTITY
Theorem: Let 𝑛, 𝑘 ∈ 𝑍 + with 𝑛 ≥ 𝑘. Then
𝑛 𝑛 𝑛+1
𝑘−1
+ 𝑘
= 𝑘
𝑛 𝑛 𝑛! 𝑛!
Proof: 𝑘−1
+ 𝑘
= +
𝑛− 𝑘−1 ! (𝑘−1)! 𝑛−𝑘 ! 𝑘!
𝑛! 𝑛!
= +
𝑛− 𝑘−1 𝑛−𝑘 ! (𝑘−1)! 𝑛−𝑘 ! 𝑘(𝑘−1)!
𝑛! 1 1
= +
𝑛−𝑘 ! (𝑘−1)! 𝑛− 𝑘−1 𝑘
𝑛! 𝑘+𝑛−𝑘+1
=
𝑛−𝑘 ! (𝑘−1)! 𝑘 𝑛− 𝑘−1
𝑛! 𝑛+1
=
𝑛−𝑘 ! (𝑘−1)! 𝑘 𝑛− 𝑘−1
(𝑛+1)!
=
𝑛+1−𝑘 ! 𝑘!
𝑛+1
= 𝑘
BINOMIAL THEOREM
Theorem: Let x and y be variables and 𝑛 ∈ 𝑍 + . Then
(𝑥 + 𝑦)𝑛 = σ𝑛𝑖=0 𝑛𝑖 𝑥 𝑛−𝑖 𝑦 𝑖 = 𝑛0 𝑥 𝑛 + 𝑛1 𝑥 𝑛−1 𝑦 + 𝑛
2
𝑥 𝑛−2 𝑦 2 + 𝑛
3
𝑥 𝑛−3 𝑦 3 + ⋯ + 𝑛
𝑛
𝑦𝑛
𝑛 𝑛 𝑛−1 𝑛 𝑛 𝑛
Proof: Let P(n): (𝑥 + 𝑦)𝑛 = 0
𝑥𝑛 + 1
𝑥 𝑦 + 2
𝑥 𝑛−2 𝑦 2 + 3
𝑥 𝑛−3 𝑦 3 + ⋯ + 𝑛
𝑦𝑛
1 1 1
𝑛 = 1 (𝑥 + 𝑦)1 = 𝑥 + 𝑦 = 0
𝑥1 + 1
𝑦
∴ P(1) is true
Assume P(k) is true
(𝑥 + 𝑦)𝑘 = 𝑘0 𝑥 𝑘 + 𝑘1 𝑥 𝑘−1 𝑦 + 𝑘
2
𝑥 𝑘−2 𝑦 2 + 𝑘
3
𝑥 𝑘−3 𝑦 3 + ⋯ + 𝑘
𝑘−1
𝑥𝑦 𝑘−1 + 𝑘
𝑘
𝑦𝑘
Multiply both sides with (𝑥 + 𝑦)
𝑘 𝑘 𝑘 𝑘 𝑘 𝑘
(𝑥 + 𝑦) ∙ (𝑥 + 𝑦)𝑘 = (𝑥 + 𝑦) 0
𝑥𝑘 + 1
𝑥 𝑘−1 𝑦 + 2
𝑥 𝑘−2 𝑦 2 + 3
𝑥 𝑘−3 𝑦 3 + ⋯ + 𝑘−1
𝑥𝑦 𝑘−1 + 𝑘
𝑦𝑘
𝑘 𝑘+1 𝑘 𝑘 𝑘 𝑘 𝑘 𝑘−1 2 𝑘 𝑘−1 2 𝑘 𝑘−2 3
(𝑥 + 𝑦)𝑘+1 = 𝑥 + 𝑥 𝑦+ 𝑥 𝑦+ 𝑥 𝑦 + 𝑥 𝑦 + 𝑥 𝑦
0 0 1 1 2 2
𝑘 𝑘 𝑘 𝑘
+⋯+ 𝑘−1
𝑥 2 𝑦 𝑘−1 + 𝑘−1
𝑥𝑦 𝑘 + 𝑘
𝑥𝑦 𝑘 + 𝑘
𝑦 𝑘+1
BINOMIAL THEOREM
𝑘 𝑘+1 𝑘 𝑘 𝑘 𝑘 𝑘 𝑘 𝑘
(𝑥 + 𝑦)𝑘+1 = 0
𝑥 + 0
+ 1
𝑥 𝑘
𝑦 + 1
+ 2
𝑥 𝑘−1 2
𝑦 + ⋯ + 𝑘−1
+ 𝑘
𝑥𝑦 𝑘
+ 𝑘
𝑦 𝑘+1
= 𝑥 𝑘+1 + 𝑘+1
1
𝑥 𝑘
𝑦 + 𝑘+1 𝑘−1 2
2
𝑥 𝑦 + ⋯ + 𝑘+1
𝑘
𝑥𝑦 𝑘
+ 𝑦 𝑘+1
𝑦 1 6 6 𝑦 6 6 𝑦 5 1 1 6 𝑦 4 1 2 6 𝑦 3 1 3
2. + = 0
+ 1 + 2 + 3
+
𝑥 𝑦 𝑥 𝑥 𝑦 𝑥 𝑦 𝑥 𝑦
6 𝑦 2 1 4 6 𝑦 1 5 6 1 6
4
+ 5
+ 6
𝑥 𝑦 𝑥 𝑦 𝑦
𝑦 6 𝑦4 𝑦2 1 1 1 1 6
= + 6 5 + 15 4 + 20 3 + 15 2 2 + 6 4 +
𝑥 𝑥 𝑥 𝑥 𝑥 𝑦 𝑥𝑦 𝑦
BINOMIAL THEOREM
3. Find the fourth term in the expansion of (3𝑥 − 𝑦)7
7
𝑇4 = 3
(3𝑥)7−(4−1) (−𝑦)3
= −2835𝑥 4 𝑦 3
2 3 6
4. Find the fifth term in the expansion of 1 − 𝑥
3
6 2 3 4
𝑇5 = 4
− 𝑥
3
80 12
= 𝑥
27
9
𝑇6 = 5
(𝑥 2 )4 (3𝑦)5 = 30618𝑥 8 𝑦 5
= 5404164480
BINOMIAL THEOREM
𝑛
8. If the 9th term in the expansion of 𝑥 1Τ3 + 𝑥 −1Τ3 does not contain x, then determine the value of n.
𝑛 10−(𝑟−1) 𝑟−1
Solution: 𝑇𝑟 = 𝑟−1
𝑥 1Τ3 𝑥 −1Τ3
𝑛 𝑛−8 8
𝑇9 = 8
𝑥 1Τ3 𝑥 −1Τ3
𝑛−8 1 8
𝑛
𝑇9 = 𝑥 1Τ3
8 𝑥 1Τ3
𝑛 𝑛−8−8
𝑇9 = 8
𝑥 1Τ3
𝑛 𝑛−16
𝑇9 = 8
𝑥 1Τ3
𝑛−16
𝑛
𝑇9 = 8
𝑥 3
𝑛−16
⟹ =0
3
⟹ 𝑛 = 16
BINOMIAL THEOREM
1 1 10
9. Evaluate the values of x, for which the fifth term of the expansion 2 x
− 2 is equal to 105 ?
1 10−(𝑟−1) 1 𝑟−1
10
Solution: 𝑇𝑟 = 𝑟−1 2 x
−2
10 1 10−(5−1) 1 5−1
𝑇5 = 5−1
−
2 x 2
1 6 1 4
10
𝑇5 = 4 2 x
− 2
1 6 1 6 1 4
105 = 210 x 2 2
1 1 10
105 = 210 𝑥3 2
210 1 10
𝑥 3 = 105 2
1 10
𝑥3 = 2 ∙ 2
1 9
𝑥3 = 2
1 3
𝑥3 =
23
1 1
𝑥3 = 23 = 8
= 0.125
BINOMIAL THEOREM
• If 𝑦 < 𝑥 and n is negative or fractional index, then
𝑛 𝑛 𝑛−1 𝑛(𝑛−1) 𝑛−2 2 𝑛(𝑛−1)(𝑛−2) 𝑛−3 3
(𝑥 + 𝑦) = 𝑥 + 𝑛𝑥 𝑦 + 𝑥 𝑦 + 𝑥 𝑦 +⋯
2! 3!
• If 𝑥 < 1, then
𝑛(𝑛−1) 2 𝑛(𝑛−1)(𝑛−2) 3 𝑛(𝑛−1)(𝑛−2)(𝑛−3) 4
(1 + 𝑥)𝑛 = 1 + 𝑛𝑥 + 𝑥 + 𝑥 + 𝑥 +⋯
2! 3! 4!