Permutations & Combinations
Permutations & Combinations
&
Combinations
• Principles of Counting
o Sum rule
o Product rule
o Principle of Inclusion-Exclusion
o Pigeon-hole principle
• Factorial notation
• Permutations
• Binomial Theorem
• Combinations
Principles of Counting.
Sum Rule
If A and B are disjoint finite sets, then:
|A ∪ B| = |A| + |B|.
In other words,
if an event A can occur in m ways and another event B,
mutually exclusive to A can occur in n ways, then A or B can
occur in m+n ways.
|A × A × … × A |=|A | × |A | × … × |A |.
1 2 n 1 2 n
Example :
Determine the value of the variable count after
execution of the following program :
int i=1, j=1, count=0;
for( i=1; i≤5; i++)
for( j=1; j≤5; j++)
count=count+1;
Example :
A Computer laboratory of 50 computers has 20 computers working
on MS windows operating system and 45 computers working on
Linux operating system. Compute how many computers work on
both windows and linux operating system.
A=20, B=45, A∪B=50
50=20+45-|A∩B|
Therefore, 15 computers work on both operating systems.
Pigeon-hole principle
If k+1 or more pigeons are distributed among k
pigeonholes, then at least one pigeonhole contains
two or more pigeons.
Example :
51 points are scattered inside a square of side 1m.
Prove that some set of 3 of these points will be
covered by a square of side 20cm.
Divide the square into 25 smaller squares of side 20cm
each. Now if we distribute the 51 points among 25
squares, we shall definitely end-up with one square
having atleast 3 points in it.
Factorial Notation
The factorial of a natural number n is the product of
the positive integers less than or equal to n. This is
represented as n! and read as ‘n factorial’.
For example,
4! = 4×3×2×1 = 24.
Lemma : The factorial of zero is one.
0! = 1.
Permutations
• Simple permutations
• Permutations with repetitions
• Circular permutations
Simple Permutations
A PERMUTATION of a finite set is an arrangement of its
elements. Here the arrangement considers the order of
elements.
If there are n distinct objects, denoted a1,a2 ,…, an, and r is an
integer, with 0≤ r ≤ n, then by the rule of product, the number
of permutations of size r for the n objects, nPr =
n×(n-1)×(n-2)×…×(n-r+1)
= n!
(n-r)!
nPr is also denoted as P(n,r)
Example :
Compute permutations of the following graph.
where,
Combinations
• Simple combinations
• Combinations with repetitions
Simple Combinations
An arrangement of r objects, WITHOUT regard to ORDER and
without repetition, selected from n distinct objects is called a
combination of n objects taken r at a time.
It is denoted as :
n
nCr = C(n, r) =
r = n! = nPr
(n-r)! r! r!
r! (n-1)!
Example :
A message is made up of 12 different symbols and is to be
transmitted through a communication channel. In addition to
the 12 symbols, the transmitter will also send a total of 45
blank spaces, with at least three spaces between each pair of
consecutive symbols. In how may ways can the transmitter
send such a message ?
Combinations with repetitions
The 12 different symbols can be arranged in 12! ways.
Now there are 11 locations between the 12 symbols and each
location must have at least three blank spaces, hence 33 of
the 45 blank spaces are used and the remaining 12 must be
located.
This is now a selection, with repetition, of size 12(blank spaces)
from a collection of size 11(locations), and can be
accomplished in
11+12-1C12 = 22C12 ways.