DM Unit Ii
DM Unit Ii
Text Book :1. Joe L Mott, Abraham Kandel, Theodore P Baker,”Discrete Mathe-
matics for Computer Scientists and Mathematicians”, Second
edition, 2019.
2. J P Tremblay and P. Manohar, “Discrete Mathematical Structures
with applications to Computer Science”, TMH, 2007.
----------------------------------------------------------------------------------------------------
ELEMENTARY COMBINATORICS
(Unit-2)
1
Example-2 : Assume that two distinguishable dice are thrown.
“If S1, S2,…,Sn are nonempty sets, then the number of elements in the
Cartesian Product S1 X S2 X … X Sn is the product (i = 1 to n) |Si|.”
For example, if there are 5 elements in the S1 and 3 elements in S2, then
there will be totally 15 elements in S1 X S2.
2
Example-5 :Suppose that the license plates of a certain state require
3 english letters followed by 4 digits.
Example-7 :How many different license plates are there that involve
1, 2, or 3 letters followed by 4 digits.
Example-8 :How many different license plates are there that involve
1, 2, or 3 letters followed by 1, 2, 3, or 4 digits.
3
Answer : [ 26 + 262 + 263 ] [ 10 +102 + 103+ 104].
Example-9 :How many ways are there to roll two distinguishable dice to
yield a sum that is divisible by 3. (3,6,9,12)
Example-10 :How many ways are there to roll two distinguishable dice
to yield a sum that is divisible by 4. (4,8,12)
Answer : 36 integers.
Example-13 :In how many different orders can 3 men and 3 women be
seated in a row of 6 seats, if any one may sit in any of the seats.
Example-14 :In how many different orders can 3 men and 3 women be
seated in a row of 6 seats, if the first and last seats must be filled by men.
4
2.2 Combinations and Permutations :
Example-15 :
5
Example-18 : The 3-combinations of a,b,c,d with unlimited repetitions
are the 3-combinations of { .a, .b, .c, .d }.
2-combinations 2-permutations
------------------------------------------------------------
aa aa
ab ab, ba
ac ac, ca
ad ad, da
bb bb
bc bc, cb
bd bd, db
cc cc
cd cd, dc
dd dd
------------------------------------------------------------
Total Number : 10 16
6
Example-20 :Find the 2-combinations and 2-permutations without
repetitions from the objects a, b, c, d.
2-combinations 2-permutations
without repetitions without repetitions
------------------------- ------------------------
ab ab, ba
ac ac, ca
ad ad, da
bc bc, cb
bd bd, db
cd cd, dc
------------------------- ------------------------
Total number : 6 12
3-combinations 3-permutations
without repetitions without repetitions
------------------------- -------------------------------------
abc abc, acb, bac, bca, cab, cba
------------------------- --------------------------------------
Total number : 4 24
7
2.3 Enumeration of Combinations and Permutations :
Proof : Since, there are ‘n’ distinct objects, the first position of
r-permutation may be filled in ‘n’ ways. The second
can be filled in ‘n-1’ ways. The third can be filled in ‘n-2’
ways. Similarly, the rth position can be filled in n-r+1 ways.
Note : P(n,n) = n!
Example-23 :In how many ways can 7 women and 3 men be arranged in
a row, if the 3 men must always stand next to each other.
8
Example-24 :In how many ways can the letters of English alphabet be
arranged so that there are exactly 5 letters between the letters a and b.
And, then 20! Ways to arrange any 7-letter word treated as one unit along
with remaining 19 letters.
Example-26 : Find the sum of all digits of 4-digit numbers having only
2,3,5,7 digits.
Answer : 24 . 17 = 408
C(6,3) = 20
9
P(n,r) = r! C(n,r)
Example-28 : A farmer buys 3 cows, 9 pigs and 12 chickens from a man
who has 9 cows, 25 pigs, and 100 chickens. How many choices does the
farmer have.
Answer : 4! . 5! . 6! . 3! . 7!
Here, the 5 children are not assigned to particular places but are
only arranged relative to one another. Hence, the position of child
C1 is immaterial and it is only the position of the 4 other children
relative to C1 that counts. Therefore keeping C1 in a fixed position,
there are 4! arrangements of the remaining children.
Answer : 4!
10
Theorem-2: There are C(n,r) Combinations of ‘n’ objects without
repetitions.
C(n,r) = n! / [ r! (n-r)! ]
C(5,3) C(21,5) 8!
Example-36 : In how many ways are there to seat 10 boys and 10 girls
around a circular table.
19!
11
2.4 Enumerating Combinations and Permutations with repetitions :
U(n,r) = nr
3 25
Example-38 : How many 10-digit binary numbers are there with
exactly six 1’s.
First Observation :
Second Observation :
This can be seen by just interpreting that the kth box contains xk balls.
12
Third Observation :
Here x1 = 3, x4 = 2, x8 = 2.
Fourth Observation :
The number of binary numbers with (n-1) 1’s and ‘r’ 0’s is :
C( n - 1 + r, r)
And ‘r’ positions are occupied by 0’s and remaining ‘n-1’ positions
sre occupied by 1’s.
13
x1 + x2 + … +xn = r
=The number of ways of distribution ‘r’ similar balls into ‘n’
numbered boxes.
= The number of binary numbers with ‘n-1‘ one’s and ‘r’ zeros.
= C ( n – 1 + r , r) = C ( n - 1 + r, n – 1 )
= (n+r–1)! / [r!(n–1)!]
C (5 – 1 + 4 , 4 ) = C ( 8, 4 ) = 70.
C (5 – 1 + 3 , 3 ) = C ( 7, 3 ) = 35.
Answer : 11
Here, n = 6 and r = 10
14
C(6 – 1 + 10, 10) = C(15,10) = 3,003
Theorem-5: The number of integral solutions of x1 + x2 + … +xn = r,
where each xi > 0 is :
= The number of ways of distributing ‘r’ similar balls into
‘n’numbered boxes with at least one ball in each box.
= C[ n – 1 + (r - n), (r - n) ]
= C( r - 1, r - n)
= C( r - 1, n - 1).
C(24,20) = C(19,15) n = 5, r = 20
x1 + x2 + x3 + x4 + x5 19
x1 + x2 + x3 + x4 + x5 r (= 19)
15
Example-47: How many outcomes can be obtained from rolling
m number of indistinguishable dice. Here n = 6, r = m.
C ( 6 + m– 1 , m ) = C (m + 5, m)
a) Indistinguishable
b) Distinguishable
x1 + x2 + x3 + x4 + x5 = 10
Here, n = 5, r = 10
C ( 10 + 5 - 1, 5 - 1) = C ( 14, 4) = C (14,10)
a) Xi 0 (n=5, r=30)
b) Xi 1 (n = 5, r = 25)
d) X1 2 , X2 3, X3 4 , X4 2, X5 0 (n = 5, r=19)
16
c) (14,10) d) C(23,19)
2.5 Enumerating Permutations with Constrained repetitions :
bba 3
bbc 3
bbd 3
cca 3
ccb 3
ccd 3
abc 6
abd 6
acd 6
bcd 6
----------------------------------------------------------
14 52
17
Theorem-6: Finding the number of n-permutations with
constrained repetitions.
Let there is a string (S) having ‘n’ number of letters. where some of
the letters in that are repeated for some number of times.
Let letter ‘l1’ repeated ‘n1’ number of times, ‘l2’ repeated ‘n2’
number of times,…,‘lk’ is repeated ‘nk’ number of times.
n!
---------------------------
n1! . n2! . n3! . …..nk!
There is one letter ‘a’ is repeated for 3 times. The number of per-
mutations for the letter ‘a’ is 3!.
18
Example-53 : How many 10-permutations are there for :
T A LL A H A S S E E
11!
-------------------------------------
3! .2! .2! .2! . 1! .1!
23!
P(23; 4,4,5,5,5) = ----------------------
4! 4! 5! 5! 5!
19
23!
Thus, there areC(5,2) ---------------- total distributions.
4! 4! 5! 5! 5!
21+ 22 + 23 + 24 + 25 = 26- 2 = 62
20
3-others different 7,200
-------------------------------------------------------------------------------------------
5-different C(7,5) = 21 5! /(1!1! 1! 1! 1!)= 120 21 * 120 =
2,520
-------------------------------------------------------------------------------------------
TOTAL 309 13,431
Ordered Partitions :
{A1, A2,….,At}
S = A1 U A2 U …. U At … (1)
21
({a}, {c},{b,d}) ({c},{a},{b,d})
n!
P(n; q1, q2,…,qt) = -------------------------
q1! q2! …. qt!
Example-60 : How many ways can the 52 cards (4 players) be dealt with all
four kings, when there are four players, each having equal number
of cards?
52! / (13!)4
Example-61 : How many ways will one player be dealt with all four kings,
where there are four players ?
4 ( 48! / [ 9 . (13!)3]
Example-62 :Suppose there are four(4) players. How many ways will two
player be dealt with all four kings ?
22
1 3 C(4,1) . 48! / [ (12!) (10!) (13!)2]
-----------------------------------------------------------------------------------------
2 2 C(4,2) . 48! / [ (11!)2 . (13!)2]
-----------------------------------------------------------------------------------------
3 1 C(4,1) . 48! / [ (12!) (10!) (13!)2]
-----------------------------------------------------------------------------------------
4 0 48! / [ (9!) (13!)3]
Unordered Partitions :
Let S be a set.
[ 1 / t! ] [ n! / (q!)t ]
n!
P(n; q1, q2,…,qt) = -------------------------
q1! q2! …. qt!
Example-63 : How many ways can 14 men be partitioned into 6 teams where,
the first team has 3 members, the second team has 2 members, the third team
has 3 members, and the fourth, fifth and sixth teams each have 2 members ?
23
Example-64 : How many ways can 12 men out of 14 men be partitioned into
3 teams where, the first team has 3 members, the second team has 5 members,
the third team has 4 members ?
Example-65 : How many ways can 12 men out of 14 men be partitioned into
3 teams of 4 each.
Example-66 : How many ways can 14men be partitioned into 6 teams where,
the first and second teams have 3 members each, and third, fourth, fifth and
sixth teams have 2 members each ?
Example-67 : How many ways can 14 men be partitioned into 6 teams where,
two teams have 3 men each, and four teams have 2 men each ?
24
c) Let |A| = |A B’| + |A B| .
and |B| = |A B| + |A’ B|.
|A| + |B| = |A B’| + |A B| + |A’ B| + |A B| ….. (3)
First Part : A – B = A B’
Second Part :A B
Third Part :B – A = A’ B
First Part : A B’ C’
Second Part : A B C’
Third Part : A’ B C’
Fourth Part : A B’ C
FifthPart : ABC
Sixth Part : A’ B C
Seventh Part : A’ B’ C
25
Here, | A U B U C| = |A| + |B| + |c| - |A B|
- |A C| - |B C| + |A B C|.
26
Let us find the value of | A U B U C|.
100 – 47 - 35 + 23
Answer : 41.
Find how many can program none of the above three languages.
100 – 47 – 35 – 20 + 23 + 32 + 12 + 11 – 5
Answer : 39
* * * * *
27