A counting problem asRs
“how many ways” some
event can occur.
How many three-letter codes are
there using letters A, B, C, and D
if no letter can be repeated?
One way to solve is to list all
possibilities.
Combinatorics
• Combinatorics deals with arrangements of objects
according to some pattern and counting the number of
ways it can be done.
• Mostly it deals with finite number of objects and finite
number of ways of arranging them according to some
pattern.
Basic of Counting
There are two fundamental principles of counting called
the addition principle or the principle of disjunctive
counting. And the multiplication principle called the
principle of sequential counting.
Sum Rule or the principle of Disjunctive
counting(or)
If a set S is the union of disjoint non empty
subsets A1, A2,…..An then |s| = |A1 |+|A2|,….+|An|
Product rule or The principle of
sequential counting(and)
If S1, S2,….Sn is the product ( ) i.e., for any
two sets A and B. If A has m elements and B
has n elements then the Cartesian product A *
B will have mn elements.
1. In how many ways can a CR be elected from 16 boys,
18girls(either boy or girl).
No of ways of choosing boys =16
No of ways of choosing girls =18
No of ways of choosing a CR is = 16+18 = 34
2. In how many booRs can be selected from 12 math booRs
10 physics booRs 16 CSE booRs and 11 electronic booRs.
No of ways of choosing maths=12
=10
=16
=11
=12+10+16+11=49
1. In how many ways a person can choose a pair
from 3 shirts and 5 ties.
A. number of ways of choosing shirts =3
number of ways of choosing ties =5
number of ways of choosing a pair= 3*5=15
2. There are 20 married couples in a party find
out the number of ways of choosing a man a
women says that two are not married to each
other.
A. number of ways of choosing man=20
number of ways of choosing woman who is not
married to particular person=19
Total =20*19=380
2.
1) 26 26 26 10 10
L L L D D
26 * 26 * 26 * 10 * 10 = 262 * 102 = 1,757,600
2) 26 25 24 10 9
L L L D D
26 * 25 * 24 * 10 * 9 = 1,404,000
In how many ways is sequence of four
symbols can be constructed in which 1 st and
2nd are english letters and the next 2 are
single digit numbers. find with & without
repetition.
L L D D
26 26 10 10
With repetation =262*102=
2)
L L D D
26 25 10 9
Without repetation=26*25*10*9=58500
An r-permutation of a set of n
elements is an ordered selection of r
elements from the set of n elements
n!
n Pr
n r !
Calculate
4 P2
6 P 5
4 P 4
Solution:
4 P 2 = 4! / (4 - 2)! = 24/2 = 12
6 P 5 = 6! / (6 - 5)! = 6×5×4×3×2×1 / 1! =
720
4 P 4 = 4! / (4 - 4)! = 4! / 0! = 4! = 4×3×2×1
= 24
1) P(n,2) = 72
n!/(n-2)!=72
n(n-1)(n-2)!/(n-2)! = 72
n2-n = 72
n2- n -72 = 0
n2 - 9n +8n -72 = 0
n(n-9)+8(n-9) = 0
(n-9) (n+8) = 0
n = 9,-8
2) P(n,2) = 90
3. P(n,3) = 3p(n,2)
n!/(n-3)!=3.n!/(n-2)!
n(n-1)(n-2)=3.n(n-1)
n-2=3
n=5
4. p(n,4) = 42 p(n,2)
1
How many different strings of length 4 can
be formed using the letters of the word
‘flower’
n=6, r=4
P(n, r) = 6!/2!
=6*5*4*3*2*1/2*1
=6*5*4*3
= 360
How many ways the word can be arranged
i)non repeated letters ii) repeated letters
i) 1)BASIC
P=5!
2) Srilok
P=6!
ii)1)PASCAL
P= 6!/2!= 360
3)Corporation
p= 11!/2!3!
4)Engineering
11!/3!3!2!2!
3)SUCCESS
=7!/3!2!
4)BANANA
=6!/2!3!
5)PEPPER
=6!/3!2!
6)MISSISSIPPI
=11!/4!4!2!1!
7)DIFFICULT
=9!/2!21
how many ways the word can be arranged ?
i)repetition allowed ii) repetition not allowed
RNA RA
crystal 7! 77
booR 4!/2! 44/2!
officers 8!/2! 88 /2!
vijaya 6!/2! 66 /2!
how many ways the word can be arranged ?
i)odd position/even position
how many ways the word BASIC be arranged
in such a way that vowels occupy only odd
position?
_ _ _ _ _
B A S I C
1 2 3 4 5
(AI) (BSC)
=3p2* 3!= 3*2*1*3*2*1=36
MACHINE
- - - - - - -
M A C H I N E
1 2 3 4 5 6 7
(AIE) (MCHN) 1,3,5,7
=4P3* 4!=576
VIJAYA
- - - - - -
V I J A Y A
1 2 3 4 5 6
(IAA)(VJY)
3P3 *3!/2!
How many ways the word PLAYGROUND can
be
arranged such that
1)If the word starts with letter ‘Y’
- - - - - - - - - -
Y 1*9!=9!=
2) If the word starts with ‘Y’ and end at ‘G’
- - - - - - - - - -
Y G
1* 8! *1=8!=
3)If the word should end with a vowel?
(PLAYGROUND)
- - - - - - - - - -
(AOU)
9!*3=
4)The word start with a vowel and ends with a
consonant?
- - - - - - - - - -
(AOU) (PLYGRND)
=3*8!*7=
Exercise
Find the number of distinct
permutations that can be formed using
the letters of the word “BENZENE”.
Solution
The word “BENZENE” contains seven letters of which three are alike (the 3 E’s) and two are
alike (the 2 N’s) 7!
420
Hence, the number of distinct permutations are: 3!2!
Exercise
(i)Find the number of “words” that can be formed of
the letters of the word ELEVEN.
(ii)Find, if the words are to begin with L.
- - - - - - 1*5!/3!
(iii)Find, if the words are to beginE and end in E.
- - - - - - 1*4!*1=4!
(iv)Find, if the words are to begin with E and end in
N.
4!/2!
Solution
(i)There are six letters of which three are E; hence required number of “words” are
6!
120
3!
(ii)If the first letter is L, then there are five positions left to fill where three are E; hence
required number of words are 5! 20
3!
(iii)If the words are to begin and end in E, then there are only four positions to fill with
four distinct letters.
Hence required number of words = 4! = 24
(iv)If the words are to begin with E and end in N, then there are four positions left to fill
where two are E. 4!
Hence required number of words = 12
2!
How many three-letter codes are
there using letters A, B, C, and D
if no letter can be repeated?
Note: The order does matter
4!
4 P3 24
1!
In how many ways can 9
horses place 1st, 2nd, or 3rd in a
race?
9 P3 504
Exercise
Find the number of ways that a party of
seven persons can arrange themselves
in a row of seven chairs.
Exercise
How many 2-permutation are there of
{W, X, Y, Z}? Write them all.
SOLUTION:
Number of 2-permutation of 4 elements is
4 4!
P(4, 2) p
2 (4 2)!
4 3 2!
2!
4 3 12
These 12 permutations are:
WX, WY, WZ,
XW, XY, XZ,
YW, YX, YZ,
ZW, ZX, ZY.
The number of combinations of n elements
taken r at a time is n!
n Cr
r!n r !
Where n & r are nonnegative integers & r < n
Evaluate
1)9C4 =9!/4! (9-4)!= 9!/4!5!= 126
2)6C3 =6!/3!3!=20
Example
Compute C(9, 6).
Solution:
Prove that c(n,r)=c(n,n-r)
n
cr=n!/r!(n-r)!----------1
nc =n!/(n-r)!(n-n+r)!
n-r
=n!/(n-r)! r!------------2
(1)=(2)
How many committees of three can
be selected from four people?
Use A, B, C, and D to represent the people?
A) 4
C3=4!/3!1!=4
How many five-card hands are
possible from a standard deck of
cards?
52 C5 2,598,960
2)How many five card hands consist of only
heart?
13
C5 =13*12*11*10*9*8*7*6*5*4*3*2*2/5!*8!=
=1,287
3)How many five card hands consist of cards
from a single suit?
there are C(13,5)
hence, there are total of 4*13c5=4*13!/5!8!
=5148
4) How many ways to draw 2 clubs and 3
hearts?
C(13,2) c(13,3)
13
c2 13c3 =
5) How many ways to draw 2 aces and 3
Kings?
C(4,2)c(4,3)= 4c2 4c3=
Let X = {a, b, c, d, e}.
List all 3-combinations of the 5 elements of
the set X, and hence find the value of
C(5,3).
SOLUTION:
Then 3-combinations of the 5 elements of the
set X are:
{a, b, c}, {a, b, d}, {a, b, e}, {a, c, d}, {a, c,
e},
{a, d, e}, {b, c, d}, {b, c, e}, {b, d, e}, {c, d,
e}
Hence C(5, 3) = 10
PERMUTATIONS AND COMBINATIONS
pr=506 and ncr =253 find n and r?
n
npr=n!/(n-r)!=506
ncr=n!/r!(n-r)!=253
=506/r!=253
=506/253=r!
r=2
n!/(n-2)!=506
n(n-1)(n-2)!/(n-2)!=506
n(n-1)=506
n2-n-506=0
(N-23)(n+22)=0
N=23,-22 n=23
np2=56 solve for n ?
n!/(n-2)!=56
n(n-1)(n-2)!/(n-2)!=56
n(n-1)=56
n=8,-7
n=8
1. In how many ways can a committee of 5
teachers
and 4 Students be chosen from 9 teachers and
15 students
The teachers can be selected in C(9,5) ways
The students can be chosen in c(15,4)ways
The committee can be formed in C(9,5) C(15,4)
n
cr= n!/(n-r)! r!
2. There are 21 consonants and 5 vowels in the
English alphabet. consider only 8 letter words
with 3 different vowels and 5-diferent
consonants.
1) how many such words can be formed.
5C3*21C5*8!
2) how many such words contains the letters
a.
4C2*21C5*8!
3) how many such words contains the letters
a &b.
4C2*20C4*8!
4)how many begin with a and end with b?
4C2.20C4.6!
5) how many begin with b and end with c?
5C3.19C3.6!
6) how many such words contains the letters
a,b &c.
4C2.19C3.8!
EXERCISE
A student is to answer eight out of ten
questions on an exam.
Find the number m of ways that the
student can choose the eight questions
The eight questions can be answered in
m = C(10, 8) = 45 ways.
Permutation with repetition
1. how many strings of length 4 can be
generated from the set {a,b,c,d,e,f},if
repetition is allowed.
n=6,r=4
The number of strings=64 =6*6*6*6=1296
2.
3.There are 25 true or false questions in the
examinations how many different ways can a
student to do the examination if he or she can
also choose to leave the answer blank.
n=3,r=25
nr =325 =
Combination with repetition
1. The number of combinations of n objects
taken r at a time with repetition
2. The number of ways r identical objects can
be distributed among n distinct containers.
3. The number of nonnegative integer
solutions of the equation: x1 + x2 + · · · +
xn = r .
4. C(n-1+r,r)=(n+r-1)!/r!(n-1)!
Exercise
1
A camera shop stocks ten different
types of batteries.
(a) How many ways can a total
inventory of 30 batteries be distributed
among the ten different types?
2.The number of 3 combinations of 5 objects
with unlimited repetition.
N=5,r=3
C(n-1+r,r)= c(5-1+3,3)=c(7,3)=7!/4!3!
=7*6*5*4*3*2*1/4*3*2*1*3*2*1=35
3. The number of non negative integral
solutions of x1+x2+x3+x4+x5=50
r=50,n=5
C(n-1+r,r)= c(5-1+50,50)=c(54,50)=54!/4!
50!=316251
4. How many ways can 20 similar books be
placed on five different shelves?
n=5,r=20
C(5-1+20,20)=c(24,20)=24!/20!4!
5. How many ways are there to fill a box with a
dozen doughnuts chosen from 8 different
varieties of doughnuts?
n=8,r=12
C(8-1+12,12)=c(19,12)=19!/7!12!
6.How many integral solutions are there to
x1 + x2 + x3 +x4 + x5=20 where each x i ≥ 2?
First place 2 balls in each of 5 boxes and then
The no of ways of placing the remaining 10
balls in 5 boxes with unlimited repetitions
x1 + x2 + x3 +x4 + x5=20
Y1+y2+y3+y4+y5=10 n=5,r=10
C(n-1+r,r)
C(5-1+10,10)=c(14,10)=14!/(14-10)!10!
7.How many integral solutions are there to
x1 +x2+ x3+ x4 +x5 = 20 where x1≥3, x2≥2,
x3≥4, x4≥6 & x5≥0
3+2+4+6=15
Y1+y2+y3+y4+y5=5 where yi ≥0
C(n-1+r,r)=c(5-1+5,5)
=c(9,5)=9!/4!5!
3.The number of integral solution
of x1+x2+x3+x4=25, such that x1≥1, x2≥2,
x3≥3, x4≥4
25-10=15
Y1+y2+y3+y4=15
=c(n-1+r,r)= c(15-1+4,4)
=c(18,4)
=18!/14!4!=
Table with Formulas
Constrained repetition
How many 10-permutation are there of {3.a,
4.b,2.c, 1.d}
P(n,q1,q2,…..qn)=n!/q1! q2! …..qn!
x=10!/3!4!2!1!
=10*9*8*7*6*5*4*3*2*1/3*2*1*4*3*2*1*2*1*1
=
The no of arrangement of letters in the word
TALLAHASSEE is
P(11,3,2,2,2,1,1)=11!/3!2!2!2!1!1!=
Binomial Theorem
The Binomial Theorem states that
Binomial Coefficient
In the expansion of (a + b)n, the (r +1)th term is
Example:
Expand
a) (a + b)5
b) (2 + 3x)3
Solution:
Expand (5x – 4)10
Sol: (5x – 4)10 = 10C0 (5x)10–0(–4)0 + 10C1 (5x)10–1(–
4)1
+ 10C2 (5x)10–2(–4)2 + 10C3 (5x)10–3(–4)3
+ 10C4 (5x)10–4(–4)4 + 10C5 (5x)10–5(–4)5
+ 10C6 (5x)10–6(–4)6 + 10C7 (5x)10–7(–4)7
+ 10C8 (5x)10–8(–4)8 + 10C9 (5x)10–9(–4)9
+ 10C10 (5x)10–10(–4)10
Find the third term in the expansion of (3 + y)6
6c0.36.y+ 6c1.35.y1 +6c2.34.y2
6c2.34.y2
= 15.3*3*3*3.y2
=15.81.y2
=15*81.y2
Find out the fourth member of following
formula after expansion: (x+2/x)8
the formula for the binomial theorem to
determine the fourth term in the expansion (y
− 1)7
7
c0.y7.(-1)+ 7c1.y6.(-1)+ 7c2.y5.(-1)2 + 7c3.y4.(-1)3
7
c3.y4.(-1)3
=7!/4!*3!.y4 *(-1)
=35.y4 .-1
=-35y4
Make use of the binomial theorem formula to
determine the eleventh term in the expansion
(2a − 2)12
=12c10 .(2a)2 .(-2)10
=12!/2!*10!.22.a2 .210
=6*11*4*a2 *210
= 270336 a2
Use the binomial theorem formula to
determine the fourth term in the
expansion(3x-2/3)7
= 7c3.(3x)4 .(-2/3)3
=35.34.x4.8/27
=35.81.x4 .-8/27
=35.3.x4.(-8)
=-840.x4
What is the coefficient of a4 in the expansion
of (a+2)6?
c0.a6.20+6c1.a5.21+6c2.a4.22
6
c2.a4.22
6
=15.a4 .4
=60a4
1.Find the expansion of (x+y)6
n
(x+y)n =∑ nCi.xn-i.yi
i=0
= n
c0.xny0 + nc1.xn-1.y1 + nc2.xn-2.y2 +……..+ ncn. yn
6
(x+y)6 =∑ 6Ci.x6-i.yi
i=0
=6c0.x6 y0+ 6c1.x5.y + 6c2.x4.y2 + 6c3.x3. y3 + 6c4.x2.y4 + 6c5.x.y5
+ 6c6.y6
=x6+6.x5.y +15.x4.y2 +20.x3.y3 +15.x2.y4 +6.x.y5+y6
Find the coefficient of x5y8 in (x+y)13
The coefficient of x5y8 is
(x+y)n = nCi.xn-i.yi
(x+y)13 = 13Ci.x13-i.yi
(x+y)13= 13C0.X13.Y0+ 13C1.X12.Y+ 13C2.X11.Y2+ 13C3.X10.Y3
+ 13C4.X9 .Y4 + 13C5.X8.Y5 + 13C6.X7 .Y6 + 13C7.X6 .Y7
+ 13C8.X5 .Y8
C8 =1287
13
n
(a+b)3 =∑ nCi.a3-i.bi
i=0
Binomial Coefficient
Example:
Find the 7th term of
solution
Using the formula
What is the coefficient of x3 in the expansion
(2x+1)4
=4c1.(2x)3.11
=4.8.x3.1
=32x3
What is the coefficient of x12 in the expansion
(2x3-2)5
5
c1.(2x3)4.(-2)1
5.24 .x12 .-2
5.16.x12.-2
-160x12
What is the coefficient of x5 in the expansion
(5-2x)8
8c5.53.(-2x)5
Inclusion–exclusion principle
The inclusion–exclusion principle is a counting
technique which generalizes the familiar method of
obtaining the number of elements in the union of
two finite sets.
Let A and B any two finite sets. Then the number of
elements
In union of two sets A and B is the sum of the
number of elements in the sets minus the no of
elements in their intersection that is, |A ⋃ B|=|A|+|
B|-|A ⋂ B|
In a survey on group of 80 people it is found that 60 like
eggs and 30 like fish find the percentage of people like both
|A ⋃ B|=|A|+|B|-|A ⋂ B|
|A|=60
| B | =30
|A ⋃ B|=80
|A ⋃ B|=|A|+|B|-|A ⋂ B|
80=60+30-|A ⋂ B|
|A ⋂ B|=90-80
|A ⋂ B|=10
In a class of 50 students, 20students play football &16
students play hockey. It is found that 10 students play both
the games. Find the no of students who play neither.
|A ⋃ B|=|A|+|B|-|A ⋂ B|
F=20
H=16
|f⋂ h|=10
|F⋃ H|=20+16-10=26
The number of students who play neither hockey nor
football=
50-26=24
3)A total of 1,232 students haven taken a course in Spanish, 879 haven taken a
course in French & 114 have taken a course in Russian. Further, 100 have taken
courses in both Spanish and French, 25 have taken courses in both Spanish and
Russian & 12 have taken courses in both French & Russian. If 2092 students have
taken at least one of Spanish, French and Russian courses. How many students have
taken a course in all three languages?
|A ⋃ B|=|A|+|B|-|A ⋂ B|
|A|=1,232 |B|=879 |C|=114 |A ⋂ B|= 100 |A ⋂ C|=25 |B⋂
C|=12, |A ⋃ B ⋃ C|=2092
|A ⋃ B ⋃ C|= |A|+|B|+|C|-|A ⋂ B| -|A ⋂ C|- |B⋂ C|+ |A ⋂ B ⋂ C|
2092= 1232+879+114-100-25-12+ |A ⋂ B ⋂ C|
2092=2088 + |A ⋂ B ⋂ C|
|A ⋂ B ⋂ C|= 2092-2088 = 4
1)Among 60 students in the class, 45 passed in the
first semester examinations and 30 passed in the 2nd
semester examinations. If 12 did not pass in either
semester, how many passed in both semesters?
in either semester, |A' ⋂ B ' |=12
A) |A|=45, |B|=30 Given that 12 students did not pass
60-12=48 students have passed in either the first or
|A ⋃ B|=48
the 2nd semester or both
|A ⋃ B|=|A|+|B|-|A ⋂ B|
48=45+30-|A ⋂ B|
|A ⋂ B|=45+30-48=27
Hence, the number of students who passed in both
the semesters in 27