PermutationsCombination (Unit-II)
PermutationsCombination (Unit-II)
PermutationsCombination (Unit-II)
PERMUTATIONS,
COMBINATIONS AND
DISCRETE PROBABILITY
By: Prof. Swati Dhopte
Prof. Dipti Pawar
Unit - II
PERMUTATIONS, COMBINATIONS AND DISCRETE PROBABILITY
Permutations and Combinations: rule of sum and product, Permutations, Combinations,
Algorithms for generation of Permutations and Combinations, binomial theorem,
Discrete Probability, Conditional Probability, Bayes’ Theorem, Information and Mutual
Information.
BASIC COUNTING PRINCIPLES
Sum Rule Principle:
Suppose some event E can occur in m ways and a second event F can occur in n ways, and
suppose both events cannot occur simultaneously. Then E or F can occur in m + n ways.
Example: If no two events can occur at the same time, then one of the events can occur in: n1 +
n2 + n3 +··· ways.
Example: If the events occur one after the other, then all the events can occur in the order
indicated in: n1 · n2 · n3 · ... ways.
Continued…
There is a set theoretical interpretation of the above two principles. Specifically, suppose n(A)
denotes the number of elements in a set A. Then:
(1) Sum Rule Principle: Suppose A and B are disjoint sets. Then
n(A ∪ B) = n(A) + n(B)
(2) Product Rule Principle: Let A × B be the Cartesian product of sets A and B. Then
n(A × B) = n(A) · n(B)
Example
1. If there are 14 boys and 12 girls in a class, find the number of ways of selecting one student as
class representative.
Solution: Using sum rule, there are 14 + 12 = 26 ways of selecting one student (either a boy or a
girl) as class representative.
2. Three persons enter into car, where there are 5 seats. In how many ways can they take up
their seats?
Solution: First person has a choice of 5 seats, Second person has a choice of 4 seats and third
one has choice of 3 seats.
Hence, Required number of ways in which all the three persons can seat is 5 * 4 * 3 = 60.
PERMUTATIONS
Definition: By permutation we mean an arrangement of objects in a particular
order.
Consider the formula for nPr , namely, P(n,r) = n (n – 1) ... (n – r + 1).
This can be obtained by removing the terms n – r, n – r – 1,...,2, 1 from the
product for n!.
The product of these terms is (n – r) (n – r – 1) ...2.1, i.e., (n – r)!.
So, using the factorial notation, this formula can be written as follows :
3) If n objects given and need to arrange them where some objects out of ‘n’
some are repeated/duplicated then
Total number of arrangements as follows
=n!/p!t!m!
Example: 1
How many ways are there to select a first-prize winner, a second-prize winner,
and a third-prize winner from 100 different people who have entered a
contest?
Solution: Because it matters which person wins which prize, the number of ways
to pick the three prize winners is the number of ordered selections of three
elements from a set of 100 elements, that is, the number of 3-permutations of a
set of 100 elements. Consequently, the answer is
P (100, 3) = 100 · 99 · 98 = 970,200.
Example: 2
Suppose that there are eight runners in a race. The winner receives a gold
medal, the second place finisher receives a silver medal, and the third-place
finisher receives a bronze medal. How many different ways are there to award
these medals, if all possible outcomes of the race can occur and there are no
ties?
Solution: The number of different ways to award the medals is the number of 3-
permutations of a set with eight elements.
Hence, there are P (8, 3) = 8 · 7 · 6
= 336 possible ways to award the medals.
Example: 3
How many permutations of the letters ABCDEFGH contain the string ABC ?
Solution: Because the letters ABC must occur as a block, we can find the answer
by finding the number of permutations of six objects,
namely, the block ABC and the individual letters D, E, F, G, and H.
Because these six objects can occur in any order,
there are P(6,6) = 6! = 720 permutations of the letters ABCDEFGH in which ABC
occurs as a block.
Example: 4
(a) How many ways can eight different books be arranged on a shelf?
(b) How many ways can four of eight different books be arranged on a shelf?
(c) How many ways can eight different books be arranged on two shelves so that each shelf
contains four books?
Solution: (a) The answer is the number of ordered ways of arranging the books on the shelf.
That is, P(8, 8) = 8! = 40,320
(b) The number of ways to arrange four of the eight books is P (8, 4) = 1680
(c) (# Arrangements of books on two shelves) = (# Arrangements on first shelf) * (#
Arrangements on second shelf) = P(8,4) * P(4,4)
= (8!/4!) * (4!/0!) =8! = 40,320
Example: 5
A collection of eight books consists of two books on artificial intelligence, three books on
operating systems, and three books on data structures.
(a) How many ways can the books be arranged on a shelf so that all books on a single subject
are together?
(b) How many ways can the books be arranged on a shelf so that the three books on operating
systems are together?
(c) How many ways can the books be arranged on a shelf so that the two books on artificial
intelligence occur at the right end of the arrangement?
Example: 5 Solution
(a) Let BK1 represent the two books on artificial intelligence, BK2 represent the three books on
operating systems, and BK3 represent the three books on data structures.
Consider them as 3 books, these books can be arranged P(3,3)=3! ways.
2 books of BK1 can be arrange in 2! Ways, similarly 3! For BK2 and 3! For BK3
the total number of arrangements =(# Ways to arrange the three categories of books) *
(# Ways to arrange the artificial intelligence books (BK1)) *
(# Ways to arrange the operating systems books (BK2)) *
(# Ways to arrange the data structures books (BK3))
= 3! * 2! * 3! * 3!
= 432
Example: 5 Solution
(b) This problem can be considered the same as the problem of arranging six "books" on a shelf
where one "book" represents the three books on operating systems that must occur together.
After the six books are arranged, the location for the three books on operating systems that are
considered as a single "book" to this point of the arrangement process can be arranged in 3!
ways.
The number of arrangements is (# Ways to arrange six books) * (# Ways to arrange the operating
systems books) = 6! * 3! = 4320
(c) In this case, there are six books to arrange, and for each of these arrangements, the two
artificial intelligence books must follow in some order.
The number of such arrangements is (# Ways to arrange six books) * (# Ways to arrange two
artificial intelligence books) = 6! * 2! = 1440
Example: 6
Suppose 7 students are staying in a hall in a hostel and they are allotted 7 beds. Among them,
Parvin does not want a bed next to Anju because Anju snores. Then, in how many ways can you
allot the beds?
Solution : Let the beds be numbered 1 to 7.
Case 1 : Suppose Anju is allotted bed number 1. Then, Parvin cannot be allotted bed number 2.
So Parvin can be allotted a bed in P(5,1) i.e. 5 ways. After allotting a bed to Parvin, the remaining
5 students can be allotted beds in P(5,5) i.e. 5! ways.
So, in this case the beds can be allotted in 5 * 5! Ways = 600 ways.
Case 2 : Anju is allotted bed number 7. Then, Parvin cannot be allotted bed number 6 As in Case
1, the beds can be allotted in 600 ways.
Example: 6
Case 3 : Anju is allotted one of the beds numbered 2,3,4,5 or 6.
Parvin cannot be allotted the beds on the right hand side and left hand side of Anju’s bed.
For example, if Anju is allotted bed number 2, beds numbered 1 or 3 cannot be allotted to
Parvin.
Therefore, Parvin can be allotted a bed in P(4,1) i.e. 4 ways in all these cases.
After allotting a bed to Parvin, the other P(5,5) i.e. 5 can be allotted a bed in 5! ways.
Therefore, in each of these cases, the beds can be allotted in 4× 5! = 480 ways.
∴ The beds can be allotted in (2 * 600 + 5 * 480) ways = (1200 + 2400) ways = 3600 ways
Example: 7
How many arrangements of the letters of the word ‘BENGALI’ can be made if the vowels are to
occupy only odd places.
Solution : There are 7 letters in the word ‘Bengali; of these 3 are vowels and 4 consonants.
There are 4 odd places and 3 even places. 3 vowels can occupy 4 odd places in P(4,3) ways and 4
constants can be arranged in P(4,4) ways.
∴ Number of words = P(4,3) * P(4,4) = 24 * 24 = 576.
Example: 8
In how many ways can we arrange the word ‘FUZZTONE’ so that all the vowels
come together?
Solution: All the vowels together, so u, o, e 3 vowels in one group. Also in group
3! Ways arrangement.
5 alphabets + 1 group = 6! Ways to arrange
Z, Z = 2 duplicates = 2! Ways
Total arrangements = 3! * 6! /2! Ways
= 2160 ways
Example: 9
If Amay doesn’t want vowels together, then in how many ways, can he arrange letters of the
word ‘MARKER’?
Solution: Vowels (A, E) = 2!ways
Total ways = Vowels together + Vowels not together
Vowel not Together = Total ways – Vowels together
= 6! / 2! – 2! * 5!/2! Ways
= 240 ways
( total ways = 6 alphabet of marker 6! And 2! Repetition of ‘r’)
( vowels as one group and other alphabets are 4 i.e. 5! )
Example: 10
No two Vowels comes together
A) “COMPUTER” none of the vowel should come together
Solution: Here, O,U,E 3 vowels are there, by old method its possible to get 2 vowels together.
So, let try this,
Here, consonants are 5 (C, M, P, T, R), now position them on 5 alternate positions, so 5! Ways
As, 5 consonants are at alternate position, we have 6 possible positions to keep 3 vowels, i.e.
P(6,3)
C) PERMUTATION
Solution: 7P5 * 6!/2!
Example: 11
If n=0,1,2,3,................9 how many ways we can form 4 digit numbers without and with
repetition?
Solution: a)Without repetition
Total arrangements of 4 digit numbers from given 10 digits (Starting with 0 and not starting with 0)
= 10P4.
Total arrangements of 4 digit numbers from given 10 digits( Starting with 0 only )
=9P3.
So no. Of ways in which we can form 4 digit number are=10P4. -9P3.=9*8*9*7
By counting principle=9*9*8*7
Example: 11 continued…
If n=0,1,2,3,................9 how many ways we can form 4 digit numbers without and with
repetition?
Solution: a)With repetition
Total arrangements of 4 digit numbers from given 10 digits( Starting with 0 and not starting with 0)
=104
Total arrangements of 4 digit numbers from given 10 digits( Starting with 0 only )= 103
So no. Of ways in which we can form 4 digit number are = 104 -103 = 9000
By counting principle=9*10*10*10=9000
12) 1,2,3,4,6,7 how many even numbers of 3 digits can be formed from given numbers without
repetition?
Solution: For even 3 digit numbers last digit can be (2 4 or 6).so 3 ways of selection.
so remaining 2 digits can be selected from remaining 5 numbers =5P2
So total even numbers can be formed=5P2*3=60
By counting principle =5*4*3 =60
13) 1.2.3.4.5 How many even and odd numbers of 4 digit can be formed from given digits?
Solution: For even 4 digit numbers last digit can be (2 or 4 ).so 2 ways of selection.
so remaining 2 digits can be selected from remaining 4 numbers =4P3
So total even numbers can be formed=4P3*2
So total odd numbers can be formed=Total numbers formed – total even numbers
=5P4- 4P3*2
14) In how many ways words from ‘MISSISSIPPI’ can be formed that 4 ‘I’ will not be together
Solution: Total words formed without repetition = 11!/4!4!2! =34650
Total words in which 4 ‘ I’ together =8!/4!2! =840
Consider 4 I’s as single so total input letters are 7+1 =8
Total words can be formed that 4 ‘I’ will not be together =34650-840
15) In how many ways words from ‘PERMUTATIONS’ can be formed that start with P and ends with S?
Solution: Total letters=12
Total words can be formed=12!/2!
Total words start with P and ends with S=10!/2!
16) In how many ways words from ‘PERMUTATIONS’ can be formed in which 4 letters in between P and S?
Solution: places where P and S can fit =7
can interchange position of P and S in 2 ways
=7*2* 10!/2!
Circular Permutations
1. In how many ways can 6 people be seated at a round table?
Solution As discussed, the number of ways will be (6 – 1)!, or 120
2. Find the number of ways in which 5 people A,B,C,D,E can be seated at a round table, such
that (i) A and B must always sit together. (ii) C and D must not sit together.
Solution (i) If we wish to seat A and B together in all arrangements, we can consider these two
as one unit, along with 3 others. So effectively we’ve to arrange 4 people in a circle, the number
of ways being (4 – 1)! or 6. But in each of these arrangements, A and B can themselves
interchange places in 2 ways. Therefore, the total number of ways will be 6 x 2 = 12.
(ii) The number of ways in this case would be obtained by removing all those cases (from the
total possible) in which C & D are together. The total number of ways will be (5 – 1)! or 24.
Similar to (i) above, the number of cases in which C & D are seated together, will be 12.
Therefore the required number of ways will be 24 – 12 = 12.
Circular Permutations Continued…
3. In how many ways can 3 men and 3 ladies be seated at around table such
that no two men are seated together?
Solution: Since we don’t want the men to be seated together, the only way to do
this is to make the men and women sit alternately.
We’ll first seat the 3 women, on alternate seats, which can be done in (3 – 1)! or
2 ways, as shown below. (We’re ignoring the other 3 seats for now)
Therefore the total number of ways in this case will be 2! X 3! = 12.
2! For 3 women in circular arrangement as W1W2W3 and W1W3W2 other ways
are same
3! For 3 men
Combinations
ABC ABD ABE ACD ACE ADE BCD BCE BDE CDE
ACB ADB AEB ADC AEC AED BDC BEC BED CED
BAC BAD BAE CAD CAE DAE CBD CBE DBE DCE
BCA BDA BEA CDA CEA DEA DBC CEB DEB DEC
CAB DAB EAB DAC EAC EAD DCB EBC EBD ECD
CBA DBA EBA DCA ECA EDA DBC ECB EDB EDC
Number of ways in which one or more objects can be selected from n distinct objects (i.e., we
can select 1 or 2 or 3 or … or n objects at a time)
= nC1 + nC2 + ... + nCn = 2n-1
Important Formulas
Number of ways in which one or more objects can be selected out of S1 alike objects of one
kind, S2 alike objects of second kind , S3 alike objects of third kind and so on ... Sn alike objects
of nth kind
= (S1 + 1) (S2 + 1)(S3 + 1)...(Sn + 1) – 1
Number of ways in which one or more objects can be selected out of S1 alike objects of one
kind, S2 alike objects of second kind and so on ... Sn alike objects of nth kind and rest p different
objects
= (S1 + 1) (S2 + 1) ... (Sn + 1) 2p - 1
1. A box contains 20 balls. In how many ways can 8 balls be selected if each ball can be repeated any
number of times?
It is a question of combination with repetition.
Here, n=20, r=8
Hence, require number of ways
= (n+r-1)Cr = (20+8-1)C8 = 27C8
2. A box contains 12 different black balls, 7 different red balls and 6 different blue balls. In how many
ways can the balls be selected?
We can select one ball from 25 balls, two balls from 25 balls, … 25 balls from 25 balls.
Hence, required number of ways.
= 25C1 + 25C2 + ... + 25C25 =225-1
3. A box contains 12 black balls, 7 red balls and 6 blue balls. In how many ways can one or more balls be
selected?
Hence, require number of ways
=(12+1)(7+1)(6+1)−1 = (13×8×7)−1 =728−1 =727