11 Permutations and Combinations
11 Permutations and Combinations
Permutations and
Combinations
SUBMITTED BY:
USMAN UL HASSAN (331763)
MUHAMMAD ALI (334602)
MUHAMMAD USMAN (337933)
ARSLAN MUSTAFA (33408)
Permutations vs. 2
Combinations
Both are ways to count the possibilities
The difference between them is whether
order matters or not
Consider a poker hand:
A♦, 5♥, 7♣, 10♠, K♠
Is that the same hand as:
K♠, 10♠, 7♣, 5♥, A♦
Does the order the cards are handed
out matter?
If yes, then we are dealing with permutations
If no, then we are dealing with combinations
Permutations 3
A permutation is an ordered
arrangement of the elements of some
set S
Let S = {a, b, c}
c, b, a is a permutation of S
b, c, a is a different permutation of S
An r-permutation is an ordered
arrangement of r elements of the set
A♦, 5♥, 7♣, 10♠, K♠ is a 5-permutation of
the set of cards
The notation for the number of r-
permutations: P(n,r)
The poker hand is one of P(52,5)
permutations
Permutations 4
proof
There are n ways to choose the first element
n-1 ways to choose the second
n-2 ways to choose the third
…
n-r+1 ways to choose the rth element
permutations
r-permutations: Choosing an ordered 5 card
hand is P(52,5)
When people say “permutations”, they almost
always mean r-permutations
But the name can refer to both
Thenumber of r-combinations of a
set with n elements, n!
where n is
C ( n, r )
non-negative and 0≤r≤n r!(n r )! is:
Combinations example 1
0
52! 52! 52 * 51
C (52,2) 1,326
2!(52 2)! 2!50! 2 *1
Combination formula 1
1
proof
Let C(52,5) be the number of ways to
generate unordered poker hands
The number of ordered poker hands
is P(52,5) = 311,875,200
The number of ways to order a single
poker hand is P(5,5) = 5! = 120
The total number of unordered poker
hands is the total number of ordered
hands divided by the number of ways
to order each hand
Thus, C(52,5) = P(52,5)/P(5,5)
Combination formula 1
2
proof
Let C(n,r) be the number of ways to
generate unordered combinations
The number of ordered combinations
(i.e. r-permutations) is P(n,r)
The number of ways to order a single
one of those r-permutations P(r,r)
The total number of unordered
combinations is the total number of
ordered combinations (i.e. r-
permutations) divided by the number
of ways to order each combination
Thus, C(n,r) = P(n,r)/P(r,r)
Combination formula 1
3
proof
P (n, r ) n! /( n r )! n!
C (n, r )
P (r , r ) r! /( r r )! r!(n r )!
Bit strings 1
4
Proof:
n!
C ( n, r )
r!(n r )!
n! n!
C ( n, n r )
(n r )!n (n r )! r!(n r )!
Corollary example 1
7
How many ways are there to sit 6 people around a circular table,
where seatings are considered to be the same if they can be
obtained from each other by rotating the table?
n
C (n, r )
r
I’ll use C(n,r) whenever possible, as it is easier
to write in PowerPoint
2
2
Thanks