0% found this document useful (0 votes)
102 views

CS 2336 Discrete Mathematics: Counting: Permutations and Combinations

This document provides an outline and definitions for the concepts of permutations and combinations in discrete mathematics. It begins with definitions of selection, arrangement, permutations, and combinations. It then discusses formulas for calculating permutations and combinations, including P(n,r) and C(n,r). The document provides examples and identities involving permutations and combinations, such as Pascal's identity and the binomial theorem.

Uploaded by

Severina Mallari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

CS 2336 Discrete Mathematics: Counting: Permutations and Combinations

This document provides an outline and definitions for the concepts of permutations and combinations in discrete mathematics. It begins with definitions of selection, arrangement, permutations, and combinations. It then discusses formulas for calculating permutations and combinations, including P(n,r) and C(n,r). The document provides examples and identities involving permutations and combinations, such as Pascal's identity and the binomial theorem.

Uploaded by

Severina Mallari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

CS 2336

Discrete Mathematics

Lecture 8
Counting: Permutations and Combinations

1
Outline
• Definitions
• Permutation
• Combination
• Interesting Identities

2
Definitions
• Selection and arrangement of objects appear in
many places
 We often want to compute # of ways to
select or arrange the objects
• Examples :
1. How many ways to select 2 people
from 5 candidates ?
2. How many ways to arrange 7 books
on the bookshelf ?
3
Definitions
• In most textbooks, we use the word
combination  selection

An r-combination of n objects is an unordered


selection of r objects from the n objects

• Example :
{ c, d } is a 2-combination of { a, b, c, d, e }

4
Definitions
• In most textbooks, we use the word
permutation  arrangement

An r-permutation of n objects is an ordered


arrangement of r objects from the n objects

• Example :
cabd is a 4-permutation of { a, b, c, d, e }

5
Definitions
• Further, we define the following notation:

C(n, r) denotes the number of r-combinations


of n distinct objects

P(n, r) denotes the number of r-permutations


of n distinct objects

• What are the values of C(n, n), C(n, 1), C(3, 2),
and P(3, 2) ?
6
Test Your Understanding

• Why are the following equalities correct ?

1. P(n, r) = P(r, r)  C(n, r)


2. P(n, n) = P(n, r)  P(n – r, n – r)
3. C(n, r) = C(n, n – r)

7
Permutation
• In fact, there is a formula for P(n, r) :

P(n, r) = n (n – 1)(n – 2) … (n – r + 1)

• Proof :
P(n, r) = # ways to get r of n objects in some order.
There are n ways to choose the 1st object,
n – 1 ways to choose the 2nd object, … ,
n – r + 1 ways to choose the rth object
 Result follows from rule of product
8
Examples
• Ex 1 : How many ways to select a first-prize, a
second-prize, and a third-prize winners
from 100 different people ?
• Ex 2 : How many ways can n people be ordered
to form a ring ?
2 1

1 3

3 2

The above are considered the same


(as relative order is the same)

9
With Indistinguishable Objects
• How many different strings can be made by re-
ordering the letters of the word “SUCCESS” ?
• Answer :
First, suppose that all the 7 letters are distinct.
Then, there will be 7! different strings.
Now, if we make the two Cs indistinguishable, we
will only have 7!/2! different strings.
Further, if the three Ss are indistinguishable, the
number of different strings becomes (7!/2!)/3!
10
With Indistinguishable Objects
• In general, if there are n objects, with
n1 indistinguishable objects of type 1,
n2 indistinguishable objects of type 2,
…,
nk indistinguishable objects of type k,

 the number of n-permutations is :


n!
n1! n2! … nk!

11
Examples
• If we have 5 dashes and 8 dots, how many
different ways to arrange them ?
...___._._ ...

• If we can only use 7 symbols of them, how many


different arrangements are there ?
._._._.

12
Examples
• Show that for any positive integer k,

(k!) ! is divisible by k! (k – 1)! ?

• For instance, when k = 3,


(k!) ! = (3!) ! = 6! = 720
k! (k – 1)! = (3!) 2! = 62 = 36

13
With Unlimited Repetitions
• Suppose that there are n distinct objects, each
with unlimited supply

• How many r-permutations are there ?


That is, how many ways to get a total of r objects
from them, and then form an arrangement ?

• Answer : nr

14
Examples
• Ex 1 : Consider all numbers between 1 and 1010
(i) How many of them contain the digit 1 ?
(ii) How many of them do not ?

• Ex 2 :
(i) How many bit strings of length n are there ?
(ii) How many contain even number of 0s?

15
Combination
• Recall that
P(n, r) = P(r, r)  C(n, r)

• Thus, we have

C(n, r) = n (n – 1)(n – 2) … (n – r + 1) / r!

• Alternatively, we can express C(n, r) as :

C(n, r) = n! / ( (n – r)! r! )

16
Examples
• Consider a hexagon where no three diagonals
meet a one point

• How many diagonals are there ?


• How many intersections between the diagonals ?
• How many line segments are the diagonals
divided by their intersections ?
17
Examples
• In how many ways can we select 3 numbers from
1, 2, …, 300, such that their sum is a multiple of 3 ?

• Hint :
When the sum is a multiple of 3, what special
property does the 3 numbers have ?

• Answer : 1003 + 3  C(100, 3)

18
Examples
• Five pirates have discovered a treasure box
They decided to keep the box in a locked room,
so that all the locks of the room can be opened
if and only if 3 or more pirates are present

• How to do so ? How many locks do they need ?


(Each pirate may possess keys to different locks)

19
With Unlimited Repetitions
• Suppose that there are n distinct objects, each
with unlimited supply

• How many r-combinations are there ?


That is, how many ways to get a total of r objects
from them, and the ordering is not important ?

• Answer : C(n – 1 + r, r) [Why?]

20
With Unlimited Repetitions
• Imagine we have a box for each type of objects

1 2 3
… n

• A particular r-combination is equivalent to


throwing a total of r balls into these boxes

1 2 3
… n

21
With Unlimited Repetitions
• To represent one of the r-combination, we may
use a list of n – 1 bars and r stars, where
 the bars are used to mark off n different boxes
 the stars are used to indicate how many balls
in each box
• For instance, suppose n = 5, r = 6

1 2 3 4 5 **|*| | |* **
22
With Unlimited Repetitions
• Using the bars-and-stars representation, we see
that
 each r-combination corresponds to a unique
representation (with n – 1 bars and r stars), and
 each representation (with n – 1 bars and r stars)
corresponds to a unique r-combination

 # of r-combinations = # of representations
= C(n – 1 + r, r)

23
Examples
• Ex 1 : Suppose that a cookie shop has four
different kinds of cookies. How many
different ways can 6 cookies be chosen ?

• Ex 2 : How many solutions does the equation


x + y + z = 11
have, if x, y, z are non-negative integers ?

• Ex 3 : What if x, y, z are positive integers in Ex 2 ?

24
Interesting Identities
Pascal’s Identity :
C(n, r) = C(n – 1, r) + C(n – 1, r – 1)
• Proof (by combinatorial arguments):
To select r of n objects, there are in two cases :
1. Get the first object, and then get r – 1 objects
from the remaining n – 1 objects ;
2. Do not get the first object, and get r objects
from the remaining n – 1 objects
 In total, C(n – 1, r – 1) + C(n – 1, r) ways
25
Interesting Identities
Binomial Theorem :
n
(x + y)n = 
r=0
C(n, r) xn – r yr

• Proof (by combinatorial arguments):


The terms in (x + y)n must be of the form xn – r yr.
To obtain the term xn – r yr, x is chosen n – r times
from the n occurrences of (x + y) in the product,
so that y will be automatically chosen r times
 the number of ways is exactly C(n, r)
26
Examples
• Ex 1 : What is the expansion of (x + y)4 ?

• Ex 2 : What is the coefficient of x12 in (2x – 3y)25 ?


n
• Ex 3 : What is the value of r= 0C(n, r) ?
n
• Ex 4 : What is the value of 
r=0
(–1) r C(n, r) ?

n
• Ex 5 : What is the value of 
r=0
2 r C(n, r) ?

27
Interesting Identities
Vandermonde’s Identity :
r
C(m + n, r) =  C(m, r – k) C(n, k)
k=0

• Proof (by combinatorial arguments):


To select r items from m + n distinct objects,
we may assume that among these objects,
m are white and n are black. The selection may
start by selecting k black objects, and then the
remaining from white objects. As k can vary
from 0 to r, this gives the result.
28
Example
n
• Can you simplify k= 0 C(n, k)2 ?

• Answer :
Observe that
n n

k=0
C(n, k) 2 =  C(n, n – k) C(n, k)
k=0

By setting m = n and r = n in Vandermonde’s


identity, we get the desired value as C(2n, n)

29

You might also like