8 Combinations With Repetition 04-10-2024

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 88

Module-5

Reference

Free solutions & answers for Discrete and combinatorial mathematics: An


Applied Introduction Chapter 1 - (Page 3) [step by step] |
Vaia
Fundamental principles of counting
• It is the basic principle that helps us to count
(enumerate) large numbers in a non-tedious
way.
• It is very helpful in finding the number of all
possible (outcomes) combinations for a series
of events.
• Two basic principles of counting:
– The rule of sum.
– The rule of product.
Rules of sum & product
(a) Rule of sum
• Assuming we need to perform task 1 OR task 2. There are
n1 ways to perform task 1 and n2 ways to perform task 2.
There are n1 + n2 ways to perform task 1 OR task 2.
• If we consider two tasks A and B which are disjoint
(i.e. A∩B=∅), then mathematically |A∪B|=|A|+|B|.
• Example: The Computer science department must choose
either a student or a faculty member as a representative
for a university committee. How many choices are there
for this representative if there are 37 members of faculty
and 83 students and no one is both a faculty member and
a student.
• There are 37 + 83 = 120 possible ways to pick a
representative.
(b) Rule of product
• Assuming we need to perform task 1 AND task 2.
There are n1 ways to perform task 1 and n2 ways to
perform task 2. There are n1  n2 ways to perform task
1 AND task 2.
• Mathematically, if a task B arrives after a task A,
then |A×B|=|A|×|B|.
• Example: The drama club of Central University
conduct auditing for the leading male & female roles
with 6 men & 8 women, by the rule of product the
director can cast his leading couple in 6 X 8 = ways.
Example-1
• How many ways can we label a chair if each
label consists of both a letter and a number
between 1 and 50, inclusive?
• Solution:
• There are 26 possibilities for the letter and 50
for the number. Then 26 x 50 = 1300 possible
ways.
Example-2
• With 31 flavours of ice cream, 4 sizes of
serving, and a choice of “cone” or “dish,” how
many different orders of ice cream are there.
• Solution:
• There are 31 x 4 x 2 = 248 different orders of
ice cream.
Example-3
• There are one position available for a faculty
job at Vellore. The applicant must come from
either Chennai which has 20 candidates or
Vellore which has 50 candidates.
• Solution:
• The applicant must be from Chennai or
Vellore. So we have 20 + 50 = 70 possible
applicants.
Example-4
• At a restaurant, there are 18 dinners with
meat, 10 different dinners with fish, and 5
vegetarian dinners. How many dinner is meat
or fish or vegetarian?
• Solution:
• Each dinner is meat or fish or vegetarian. So
we have 18 + 10 + 5 = 33 choices.
Example-5
• Question − A boy lives at Vellore and wants to go to school at
Tiruvannamalai. From his home Vellore he has to 1st reach
Katpadi and then Katpadi to Tiruvannamalai. He may go Vellore
to Katpadi by either 3 bus routes or 2 train routes. From there,
he can either choose 4 bus routes or 5 train routes to reach
Tiruvannamalai. How many ways are there to go from Vellore
to Tiruvannamalai?
• Solution
– From Vellore to Katpadi, he can go in 3 + 2 = 53 + 2 = 5 ways (Rule of
Sum).
– Thereafter, he can go Katpadi to Tiruvannamalai in 4 + 5 = 94 + 5 =
9 ways (Rule of Sum).
– Hence from Vellore to Tiruvannamalai he can go in 5 × 9 = 455 × 9 =
45 ways (Rule of Product).
Exercises

Solution:
a) Calculating possible winners:
According to rule of sum the total candidates from both parties is 8(Republicans) +
5(Democrats) = 13. Any one of these 13 candidates can become the president, so
there are 13 possibilities.
b) Calculating possible pairs:
We need to choose one candidate from each party so, according to rule of product
the pair of candidates 8 * 5 = 40 pairs.
c) Identifying counting principles:
In part(a), we used the rule of sum and in part (b), we used the rule of product.
Exercises
2. Buick automobiles come in four models, 12 colors,
three engine sizes, and two transmission types. (a)
How many distinct Buicks can be manufactured? (b)
If one of the available colors is blue, how many
different blue Buicks can be manufactured?
Solution:
(a) 4 x 12 x 3 x 2 = 288 distinct Buicks can be
manufactured.
(b) 4 x 1 x 3 x 2 = 24 different blue Buicks can be
manufactured.
Permutations and
Combinations
Permutations
• It is one of the application of the rule of product.
• “Counting linear arrangement of objects”. Here order
matters.
• Definition: “Given a collection of ‘n’ distinct objects, any
linear arrangement of these object is called a permutation of
the collection.
• Example:
1. From a set S = {x, y, z} by taking two at a time, all
permutations: xy, yx, xz, zx, yz, zy.
2. To form a permutation of three digit numbers from a set of
numbers S = {1,2,3}. Different three digit numbers will be
formed when we arrange the digits. The permutation will
be = 123, 132, 213, 231, 312, 321
Permutation Formula
Permutation of n objects n!

Permutation of r objects from n objects n!/(n-r!)


without repetition “How many ways can you arrange ‘r’ from
a set of ‘n’ if the order matters?”
Permutation of r objects from n objects
with repetition

Circular Permutation (n-1)!


Permutation without repetition - Formula

Example: if you have three elements (A, B, and C)


and you want to arrange them in order, the possible
permutations are ABC, ACB, BAC, BCA, CAB, and
CBA.
Permutation with repetition - Formula

Example: if you have three elements (A, B, and C) and when we


arranged A, B, and C, we repeat elements, then we will have many more
arrangements such as AAA, AAB, AAC, ABB etc.
Example-1
1. From a set S ={x, y, z} by taking two at a time, all
permutations:
• P(3,2) = 3!/(3-2)! = 6 ways to arrange (permute) all of
the letters.
2. The number of permutations of the letters in the word
COMPUTER is 8.
2a) If only 5 of the letters are used, the number of permutations
of size 5 is
Solution: P(8,5) = 8/(8-5) = 6720.
2b) If repetitions of letters are allowed, the number of possible
12 – letter sequences is
Solution: 812 = 6.872 x 1010 .
Example-2
1.How many different strings of the length 4 can
be formed using the letters of the word
PROBLEM?
Solution: The given word “PROBLEM” has 7
letters . n=7. r=4
The number of different strings of length 4 can be
formed by using the letters of the word PROBLEM
n/(n-r) =>p(7,4)= 7/(7-4) =>840 ways
Example-3
How many words of three distinct letters can be
formed from the letters of the word PASCAL
Solution n=6,r=6
The number of ways of 3 distinct letters can be
formed by using the letters of the word PASCAL
6/(6-3) =>p(6,3)= 6/(6-3) =>120 ways.
Permutation - Formula

• Example:
1. The number of linear arrangements of the four
letters in BALL is 12 (4!/2! ), not 4!.
– Reason is that we do not have 4 distinct letters to arrange.
2. The number of arrangements of the nine letters in
DATABASES is 9!/(3! * 2!) = 30,240.
Example
Find the number of permutations of the letters
of the word SUCCESS
Sol: Number of letters in the word SUCCESS=7
therefore n=7
Out of 7 letters, 3 are S, C are 2, U is 1 and E is 1.
Therefore the number of permutations of the
letters of the word SUCCESS=> 7!/(3!*2!)=>420
Example
1. From a bunch of 6 different cards, how many
ways we can permute it?
As we are taking 6 cards at a time from a deck of
6 cards, the permutations will be 6! = 720.
2. In how many ways can the letters of the word
‘READER’ be arranged?
The permutation will be 6!/(2! * 2!) = 180
Exercise
• How many permutations of size 3 can
one produce with the letters m,r,a,f,
and t?
• Solution:
• P(5,3) = 5!/(5-3)!
=60
Exercise
• Evaluate each of the following.
a) P(7,2) b) P(8,4) c) P(10,7) d) P(12,3).
• Solution:
a) P(7,2) = 7!/(7-2)! = 42.
b) P(8,4) = 8!/(8-4)! = 1680. 604800. 1320.
c) P(10,7) = 10!/(10-7)! = 604800.
d) P(12,3) = 12!/(12-3)! = 1320.
Exercise
• In how many ways can the letters in WONDERING be arranged with exactly two
consecutive vowels?
• Solution:
• Identify the vowels and the consonants in the word
'WONDERING'. The vowels are: O, E, I. The consonants are: W,
N, D, R, N, G.
• Now, treat two of the three vowels as one item. The problem now reduces to
arranging these 8 items: {OE, I, W, N, D, R, N, G}.
• The number of ways to arrange 8 items (with N repeated twice) = 8! 2!.
• Now, within the 'OE' item, the two vowels can be arranged in 2 different ways,
so you need to multiply the above by 2.
• Therefore, the total number of arrangements: 8! 2! ∗ 2 = 20160.
• This must then be multiplied by 3 in order to account for the three different
pairs of vowels that can exist (OE, OI, EI).
• Finally, the total number of ways these items can be arranged with exactly 2
vowels together : 20160 ∗ 3 = 60480
Find the number of Permutations of the letters
of the word MASSASAUGA. In how many of
these, all four A’s are together? How many of
them begin with S?
Solution:
the number of Permutations of the letters of the
word MASSASAUGA(Ans: 25200)
In how many of these, all four A’s are together
(Ans: 840)
In how many of them begin with S(ANS: 7560)
Exercise
• It is required to seat 5 men and 4 women in a
row so that the women occupy the even
places. How many such arrangements are
possible? Ans:2880
Exercises
Solution
a) Calculate the total no.of possible slates:
P(n,r) = n!/(n-r)!
where n is the total no.of items to choose from
and r is how many ways we are selecting.
Here, n = 10 (total members) and r = 4 (total
positions).
So, P(10,4) = 10!/(10-4)! = 10*9*8*7 = 5040.
Solution
b) i. Calculate the no.of slates with a physician
president:
For part b, the no.of slates where a physician is
president is given by P(3,1) * P(9,3), because
there are 3 physician and one presidency, while
the remaining 3 offices can be filled by anyone
from the remaining 9 members.
This gives 3! * [9!/(9-3)!] = 1512 slates.
Solution
b) ii. Calculate the no.of slates with exactly
physician:
To find the number of slates with exactly one
physician, we do P(3,1) * P(7,3). This accounts
for any of the 3 physician in any of the 4
positions, & the remaining 3 positions can be
filled from the 7 non-physicians. Hence, the total
no.slates is 3! * [7!/(7-3)!] = 630
Solution
b) iii. Calculate the number of slates with
atleast one physician:
To find the no.of slates with atleast one
physician, we subtract the no.of slates with no
physician from the total number of slates. The
no.of slates with no physician is given by P(7,4),
which is 7 * 6 * 5 * 4 = 840. subtracting this from
the total number of slates, we get 5050 – 840 =
4200 slates.
Circular permutation (or) cyclic
permutation
• It is a permutation in which the numbers
are arranged in a circular pattern, with one
element remaining fixed and the others
being positioned around it using the fixed
element as the scale.
• For ‘n’ items, there are (n-1)! circular
permutations possible.
Example-1
• How many ways can 8 tennis players be seated
in a circular order?
• Solution:
• ‘n' people can be arranged in around a circular
table (n-1)! ways.
• Therefore, 8 tennis players can be arranged
around a circular table in: (8-1)! = 7! = 5040
ways.
Example-2
• a) In how many ways can seven people be arranged about a
circular table? b) If two of the people insist on sitting next to each
other, how many arrangements are possible?
• Solution:
a) In circular permutations, the number of permutations for n items
around a circle is given by (n−1)!. Seven people can be arranged
around a circular table in (7−1)!=6! = 720 ways seven people can
be arranged around a circular table.
b) If two people insist on sitting next to each other, we can treat
these two people as a single entity.
• This leaves us with 6 'entities' to arrange - the pair of people who
must sit next to each other, plus the five other people.
• The number of permutations for these 'entities' is (6−1)!=5!.
• But, within this pair, there are two possible arrangements because
person A can be either on the right or left of person B, so we
multiply the result by 2.
(6−1)! * 2 =5! * 2 = 240 ways .
Types of circular
permutation
• When clockwise and anticlockwise
orders are different:

• When clockwise and anticlockwise


orders are the same:
Example-1
• Suppose 7 students are sitting around a
circle. Calculate the number of
permutations if clockwise and
anticlockwise arrangements are different.
Example-2
• Suppose 7 students are sitting around a circle.
Calculate the number of permutations if clockwise
and anticlockwise arrangements are the same.
Exercises
• How many different arrangements of 8 balls
are possible in a circle, given that the
clockwise and anticlockwise arrangements are
different?
• How many different arrangements of 10 balls
are possible in a circle given that the
clockwise and anticlockwise arrangements are
different?
• How many different arrangements of 5
students are possible in a circle, given that
the clockwise and anticlockwise arrangements
are the same?
Example-3
• In how many ways can a family of
four (mother, father, and two
children) be seated at a round table,
with eight other people, so that the
parents are seated next to each
other and there is one child on a side
of each parent? (Two seatings are
considered the same if one can be
rotated to look like the other.)
Solution
• Considering the family as one unit
• We treat the family as one single unit.
• So now we have 9 units (1 family + 8 other individuals) to
arrange around the round table.
• As the arrangement is circular and rotation is not considered a
different arrangement, the number of arrangements
is (9−1)! or 8! = 40320.
• Arrangement of family members
• Among the family, the arrangement has to be such that the parents must
sit next to each other and there is one child on either side of the parents.
• So taking parents as one unit, there are 3 units (parents, child1, child2).
• The number of different arrangements is 3!.
• Also, the two parents can switch seats in two ways, so multiply it by 2. So
the family can be arranged in 3!∗2 = 12 ways.
• Combining the arrangements
• As step 1 and step 2 are independent events, the total number of
arrangements would be the product of the number of ways in both step 1
and step 2. That gives us 8!∗3!∗2 = 40320 *12 = 4,83,840.
Combinations
Combinations
• Combination: Choosing 3 desserts from a menu of 10.
C(10,3) = n!/r! (n-r)! = 120.
• Permutation: Listing your 3 favourite desserts, in order,
from a menu of 10.
P(10,3) = n!/(n-r)! = 720.
Example – 1
1. A women is having a dinner party for some charity committee.
Because of the size of her home, she can invite only 11 out of 20
committee members. Order is not important, so she can invite
“the lucky 11” in C(20,11) = 20!/(11! 9!) = 167,960 ways.
2. Ravi and Preetha decide to buy a powerball ticket. To win the
grand prize for powerball one must match five numbers selected
from 49 inclusive and then must also match the powerball, an
integer from 1 to 42 inclusive.
• Ravi selects the five numbers (between 1 and 49 inclusive). This
he can do in C(49,5) ways.
• Meanwhile Preetha selects the powerball - here there are C(42,1)
possibilities.
• Consequently, by the rule of product, Ravi and Preetha can select
the six numbers for their powerball ticket in
C(49,5) * C(42,1) = 80,089,128 ways.
Example-2
Example-3
Example-4
Exercises
Problems with
permutation
&
combinations
Exercise
• Given a set S = {a, b, c}, find the subsets of two
elements (r=2) when
– Repetition is allowed & order matters.(Ans:9)
– Repetition is not allowed & order matters. (Ans:6)
– Repetition is not allowed & order does not matters. (Ans:3)
– Repetition is allowed but order does not matter. (Ans:6)
– Show all the permutations of the three elements in set S.
(Ans:6)
Exercises

Solution:
5a) Ans:20
5b) Ans:6
Example
Exercises
• A committee of 12 is to be selected from 10 men and 10 women. In
how many ways can the selection be carried out if (a) there are no
restrictions? (b) there must be six men and six women? (c) there must
be an even number of women? (d) there must be more women than
men? (e) there must be at least eight men?
• Solution:
• (a) No Restrictions: For this situation, there's no restriction on the number of men and
women. All that's required is to choose 12 individuals from 20 (10 men + 10 women).
You use the combination formula C(n,r). Here n=20 and r=12. So it's C(20,12).
• (b) Six Men and Six Women: In this case, 6 men from 10 have to be selected and 6
women from 10 also have to be selected. We apply the combination formula twice, once
for men C(10,6) and once for women C(10,6). The total ways are the product of those
two results.
• (c) Even Number of Women: In this case, we have to select an even number of
women (it can be 0 or 2 or 4 or 6 or 8 or 10). We need to consider all of these cases and
add them up. For each case, calculate the combination of selecting the number of
women from 10 and the remaining places from men. Add all these cases to get the final
answer.
• (d) More Women than Men: For this case, we need to consider situations including 7,
8, 9 or 10 women and remaining members as men. We calculate these individual cases
similar to earlier conditions and then add up all cases.
• (e) At Least Eight Men: This case requires that there should be at least 8 men. We
consider cases of 8, 9, 10 men and remaining members as women. Calculate these
cases and add up to get the final answer.
Summary
Permutation Formula
Permutation of n objects n!
Permutation of r objects from n n!/(n-r)!
objects without repetition.

Permutation of r objects from n nr


objects with repetition.

Circular permutation (n-1)!


Combination formula
Combination of r objects from n n!/r! (n-r)!
objects without repetition.

Combination of r objects from n (n+r-1)!/r!(n-1)!


objects with repetition.
Exercise
(a) There are nine empty seats in a
theater, and five customers need to find
places to sit. How many different ways can
these five seat themselves?
Combination with repetition
Combination with repetition
Usage of the formula C(n+r-1,r) = C(r+n-1,n-1)
• Case1: The number of selections, with
repetition, of size r from a collection of size n.
• Case2: The number of ways r identical objects
can be distributed among n distinct
containers.
• Case3: The number of integers solutions of
the equation
x1+ x2+ x3+… xn = r, xi  0, 1in
Case 1
• The number of combination of ‘n’ objects taken
‘r’ at a time, with repetition is:
C(n+r-1,r) = = (n+r-1)!/r!(n-1)!
Example:
A donut shop offers 20 kinds of donuts. Assuming
that there are atleast a dozen of each kind when
we enter the shop, we can select a dozen in
C(20 + 12 – 1, 12) = C(31,12) = 141,120,525 ways.
Here n=20, r = 12.
NOTE: C(n+r-1,r) = C(r+n-1,n-1)
Eaxmple-1
• A candy shop sells jelly, gummy and chocolate. You
have enough money to buy 6 pieces of candy from
the candy shop. Find the number of different
selections that you can have.
• Solution:
• To select 6 (r) pieces of candy from 3 (n) different
types of candy is :
C(n+r-1,r) = C(3+6-1,6) = C(8,6) = 8!/6!(8-6)!=28 ways
Other interpretation – Case 2 & 3
1. C(n+r-1,r) = C(r+n-1,n-1) represents the no.of
ways in which ‘r’ identical object (with
repetition) can be distributed among n
different containers.
2. C(n+r-1,r) = C(r+n-1,n-1) represents the no.of
non-negative integer solution of the equation.
Where a non-negative integer solution of the
equation x1+ x2+ x3+… xn = r is an n-tuple,
where x1, x2, x3,…, xn are non-negative integers
whose sum is r.
Example
1. In how many ways can we distribute 10 (identical)
white marbles among 6 distinct containers?
• Solution:
Given; r = 10, n = 6.
No.of such selections are = C(n+r-1,r) = 3003
2. Find the number of non-negative integer solutions
of the equation x1+ x2+ x3 + x4 + x5 = 8.
• Solution:
No.of non-negative integers: n = 5
Sum: r = 8
C(n+r-1,r) = 495
Example
3. In how many ways can we distribute 12 identical
pencils to 5 children so that every child gets atleast
one pencil?
• Solution:
• No.of pencils = 12, No.of children = 5.
• Every child gets atleast one pencil i.e >=1
• Distribute 1 pencil to each children, then remaining
(12-5) 7 pencils distributed to 5 children.
• No.of ways to distribute 7 identical pencils to 5
children:
C(7+5-1,7) = 330 ways
Binomial Theorem
Binomial Theorem
• It is the method of expanding an expression that has been raised to any
finite power i.e., it gives us a formula for expanding (x+y)n.
• Binomial Expression: It is an algebraic expression that contains two
dissimilar terms. Eg: x + y, x3 + y3, etc.
Proof of Binominal theorem
• Lets expanding (x+y)3 = (x+y) (x+y) (x+y)
By using distributive law;
= [x(x+y) + y(x+y)](x+y)
NOTE: Coefficient of x2y1 is
= (xx + xy + xy + yy)(x+y)
= xxx + xxy + xxy + xyy + xxy + xyy + xyy + yyy the no.of ways we can
= xxx + xxy + xyy + yyy select x from 2 of the 3
= x3 + 3x2y + 3xy2 + y3 factors, y from 1 of the
= x3y0 + x2y1 + x1y2 + x0y3
remaining (3 -2) factors.
= x0y3 + x1y2 + x2y1 + x3y0

NOTE: means 3 choose 2 i.e., out of 3 objects we choose 2 x’s.

Thus, the general from of expansion;

(x+y)n = x0yn + x1yn-1 + x2yn-2 +…….. + xn-1y1+ xny0

Hence proved.
Binomial Theorem
Example
1. Find the coefficient of x5y2 in the expansion of (x+y)7 using
the binomial theorem.
Solution:
= = 21
Example
2. Obtain the coefficient of a5b2 in the expansion (2a-3b)7.
Solution:
Lets consider x = 2a, y = -3b.
The coefficient of x5y2 in the expansion of (x+y)7 is and = = =
6048

3. Find out the coefficient of x9y3 in the expansion of (x+2y)12.


Ans:1760
Example
• Find the 3rd term in the expansion of (x-y)4.
• Solution:
• By using binominal theorem;
(x+y)n = x0yn + x1yn-1 + x2yn-2
Where n = 4 and assign y = -y
3rd term is x2y4-2 =x2(-y)2 = 6 x2y2
Binomial Theorem
Binomial Theorem
Example
Multinominal theorem
Find the coefficient of x23 in the expression
of (1+x5+x9)10
Excercise
• Determine the coefficient of in the expansion
xyz2 in the expansion of (2x-y-z)4
Ans(-24)
Example
Example
Corollary
(propositions from binominal theorem)

• For each integer n>0,


a) If x = y = 1, then we get;
+ + +…. +
b) If x = -1, y = 1, then we get
+ …. + (-1)n
Problems with strings
• In the studies of algebraic coding theory and the theory of
computer languages, we consider certain arrangements called
strings, made up from a prescribed alphabet of symbols.
• Example: If the prescribed alphabet consists of the symbols 0,
1, and 2, then it actually produces 3n = 32 = 9 strings of length
2. Also 01, 11, 21, 12, and 20 are five of the nine strings of
length 2.
• In general, if n is any positive integer, then there are strings of
length n for the alphabet 0,1, and 2.
• If x = x1 x2 x3 …….. xn is one of these strings, then we define
weight of x as wt(x) = x1 + x2 +….+ xn.
• Example: wt(12) = 1+2 =3 for n=2, wt(222) = 2+2+2=6 for n=3.
Problems with strings
(contd….)
• Among the 310 strings of length 10, we wish to determine how many have even
weight. Such a string has even weight precisely when the number of 1’s in the
string is even.
• There are 6 different cases to consider.
1. If the string x contains no 1’s, then each 10 locations in x can be filled with either 0
or 2, and by the rule of product there are 210 such strings.
2. When the string contains two 1’s, the locations for these two 1’s can be selected in
C(10,2) ways. Once these two locations have been specified, there are 2 8 ways to
place either 0 or 2 in the other 8 positions. Hence, there are C(10,2)* 2 8 strings of
even weight that contain two 1’s.
Number of strings for the other 4 cases are as shown below;

You might also like