Professional Documents
Culture Documents
Lecture 8
Lecture 8
FACULTY OF ENGINEERING
ELECTRICAL & ELECTRONICS ENGINEERING DEPT.
Basic of Counting- II
Instructor:
Dr. Mohammed Alkrunz
Electrical & Electronics Engineering Dept.
Permutation & Combinations
A permutation of a set “S” of objects is a sequence that contains each
object in “S” exactly once. [No Repetition]
𝒏!
𝑷 𝒏, 𝒓 = 𝒏 𝒏 − 𝟏 𝒏 − 𝟐 … … … 𝒏 − 𝒓 + 𝟏 =
𝒏−𝒓 !
Dr. M. Alkrunz
07.12.2019 2
EEE247: Discrete Mathematics
Urn Models
We are given a set of “n” objects in an urn.
We are going to pick (select) “r” objects from the urn in sequence.
How many different possible sequence for “r” objects are there?!!!
Dr. M. Alkrunz
07.12.2019 3
EEE247: Discrete Mathematics
Urn Models
Two common counting problem associated with the selection without
replacement of “r” objects from the urn with “n” objects.
If 𝑟 ≤ 𝑛, then the arrangement using “r” of the “n” distinct objects is called
r-permutation.
𝒏!
𝑷 𝒏, 𝒓 = 𝒏 𝒏 − 𝟏 𝒏 − 𝟐 … … … 𝒏 − 𝒓 + 𝟏 =
𝒏−𝒓 !
Dr. M. Alkrunz
07.12.2019 5
EEE247: Discrete Mathematics
Permutation
Example:
If a bomb planted in your city, and it is your job to disable it by cutting wires
of the trigger device. There are 10 wires to the bomb. If you cut exactly the
right 3 wires, in exactly the right order, you will disable the bomb. Otherwise,
it will explode!!
If the wires all look the same, what are your chances of survivals?!!
𝑛! 10! 10!
𝑃 10, 3 = = = = 720
𝑛−𝑟 ! 10 − 3 ! 7!
1
Chance of survival is: ∗ 100% = 0.13%
720
Dr. M. Alkrunz
07.12.2019 6
EEE247: Discrete Mathematics
Permutation
Example:
How many different 3-digits numbers can be formed using the digits 5, 6, 7, 8,
9 without repetition?!!
𝑛! 5! 5!
𝑃 5, 3 = = = = 60
𝑛−𝑟 ! 5 − 3 ! 2!
5 4 3
Dr. M. Alkrunz
07.12.2019 7
EEE247: Discrete Mathematics
Combinations
Combination:
Now, we turn our attention to counting unordered selections of objects.
In order the idea to be clear, consider the following example:
Example:
How many different committees of the 3 students can be formed from a
group of 4 students?!!
To answer this question, we need only to find the number of subsets with
three elements from the set containing the four students.
𝑇 ⊆ 𝑆, 𝑇 = 3 and 𝑆 = 4
Choosing 3 students is the same as choosing one student leave out the
group. Thus, we have four such subsets.
Dr. M. Alkrunz
07.12.2019 8
EEE247: Discrete Mathematics
Combinations
Example: (Continue)
This means that there are four ways to choose the three students for the
committee, where the order in which these students are chosen does not
matter.
Dr. M. Alkrunz
07.12.2019 9
EEE247: Discrete Mathematics
Combinations
The number of r-combinations of a set with n-elements with 0 ≤ 𝑟 ≤ 𝑛 is:
𝑷 𝒏, 𝒓 𝒏!
𝑪 𝒏, 𝒓 = =
𝑷 𝒓, 𝒓 𝒓! 𝒏 − 𝒓 !
Dr. M. Alkrunz
07.12.2019 10
EEE247: Discrete Mathematics
Combinations
Example:
How many distinct 7-card hands can be drown from a standard 52-cards?
𝑃 52, 7 52 51 (50)(49)(48)(47)(46)
𝐶 52, 7 = = = 133,784,560
𝑃 7, 7 (7)(6)(5)(4)(3)(2)(1)
Or
52!
𝐶 52, 7 = = 133,784,560
7! 45!
Dr. M. Alkrunz
07.12.2019 11
EEE247: Discrete Mathematics
Combinations
Example:
How many bit strings of length 4 has exactly two ones or two zeros?
4!
𝐶 4, 2 = =6
2! 2!
Example:
How many bit strings of length 10 contains 4 ones?
10!
𝐶 10, 4 = = 210
4! 6!
Dr. M. Alkrunz
07.12.2019 12
EEE247: Discrete Mathematics
Combinations
Example:
We need to form a committee of 7 people, 3 from Math, and 4 from Physics.
There are 9 Math candidates, and 11 Physics.
Two separate problems that need to be combined using two product rule.
9!
𝐶 9, 3 = = 84
3! 6!
11!
𝐶 11, 4 = = 330
4! 7!
𝑻𝒐𝒕𝒂𝒍 = 𝑪 𝟗, 𝟑 × 𝑪 𝟏𝟏, 𝟒 = 𝟖𝟒 × 𝟑𝟑𝟎 = 𝟐𝟕, 𝟕𝟐𝟎
Dr. M. Alkrunz
07.12.2019 13
EEE247: Discrete Mathematics
Combinations
Example:
Suppose you flip a fair coin “n” times. How many different ways can you get:
No heads:
𝑛!
𝐶 𝑛, 0 = = 1 [The case when all of them no heads]
𝑛! 0!
𝐶 𝑛, 1
𝐶 𝑛, 2
𝐶 𝑛, 𝑟
Dr. M. Alkrunz
07.12.2019 14
EEE247: Discrete Mathematics
Combinations
Example: (Continue)
Dr. M. Alkrunz
07.12.2019 15
EEE247: Discrete Mathematics
Binomial Coefficients
We will now study some properties of the binomial coefficients.
𝑛
𝑛
𝑛 𝑛−𝑗 𝑗 𝑛 𝑛 𝑛 𝑛−1
𝑥+𝑦 = 𝑗 𝑥 𝑦 = 𝑥 + 𝑥 𝑦+ . . . . . . . . . .
0 1
𝑗=0
Where: 𝑛, 𝑗 ≥ 0 and 𝑛 ≥ 𝑗
𝑛
𝑗 is considered as a different notation for 𝐶(𝑛, 𝑗)
Dr. M. Alkrunz
07.12.2019 16
EEE247: Discrete Mathematics
Binomial Coefficients
Example:
What is the coefficient of 𝒙𝟐 𝒚 in the expression of (𝒙 + 𝒚)𝟑 ?!!
3!
𝐶 3, 2 = 𝐶 3,1 = =3
2! 1!
Example:
What is the coefficient of 𝒙𝟏𝟐 𝒚𝟏𝟑 in the expression of (𝒙 + 𝒚)𝟐𝟓 ?!!
25!
𝐶 25, 12 = 𝐶 25,13 = = 5,200,300
12! 13!
Dr. M. Alkrunz
07.12.2019 17
EEE247: Discrete Mathematics
Binomial Coefficients
Example:
What is the coefficient of 𝒙𝟏𝟐 𝒚𝟏𝟑 in the expression of (𝟐𝒙 − 𝟑𝒚)𝟐𝟓 ?!!
Dr. M. Alkrunz
07.12.2019 18
EEE247: Discrete Mathematics
Binomial Coefficients
Special Case:
𝒏
𝒏
𝟐𝒏 = 𝒋
𝒋=𝟎
Proof:
We know that:
𝑛
𝑛
(𝑥 + 𝑦)𝑛 = 𝑗 𝑥 𝑛−𝑗 𝑦 𝑗
𝑗=0
Now set: 𝑥 = 1 and 𝑦 = 1, then:
𝑛 𝑛
𝑛 𝑛
2𝑛 𝑛−𝑗 𝑗
= 𝑗 (1) (1) = 𝑗
𝑗=0 𝑗=0
Dr. M. Alkrunz
07.12.2019 19
EEE247: Discrete Mathematics
Binomial Coefficients
Some Other Special Cases:
𝒏
𝒏
(−𝟏)𝒋 𝒋 = 𝟎 Set: 𝑥 = 1 and 𝑦 = −1
𝒋=𝟎
𝒏
𝒏
(𝟐)𝒋 𝒋 = 𝟑𝒏 Set: 𝑥 = 1 and 𝑦 = 2
𝒋=𝟎
Dr. M. Alkrunz
07.12.2019 20
EEE247: Discrete Mathematics
Binomial Coefficients
Pascal’s Identity: (Pascal’s Triangle)
𝒏+𝟏 𝒏 𝒏
= 𝒋−𝟏 + 𝒋
𝒋
where: 𝑛, 𝑗 ≥ 0 and 𝑛 ≥ 𝑗
Application:
(𝑥 + 𝑦)2 = 𝑥 2 + 2𝑥𝑦 + 𝑦 2 1 2 1
(𝑥 + 𝑦)3 = 𝑥 3 + 3𝑥 2 𝑦 + 3𝑥𝑦 2 + 𝑦 3 1 3 3 1
(𝑥 + 𝑦)4 = 𝑥 4 + 4𝑥 3 𝑦 + 6𝑥 2 𝑦 2 + 4𝑥𝑦 3 + 𝑦 4 1 4 6 4 1
Dr. M. Alkrunz
07.12.2019 21
EEE247: Discrete Mathematics
Binomial Coefficients
Pascal’s Identity: (Pascal’s Triangle)
As general:
(𝑥 + 𝑦)2 1 2 1
(𝑥 + 𝑦)3 1 3 3 1
(𝑥 + 𝑦)4 1 4 6 4 1
(𝑥 + 𝑦)5 1 5 10 10 5 1
(𝑥 + 𝑦)6 1 6 15 20 15 6 1
(𝑥 + 𝑦)7 1 7 21 35 35 21 7 1
……. ……….
Dr. M. Alkrunz
07.12.2019 22
EEE247: Discrete Mathematics
*Questions
Dr. M. Alkrunz
07.12.2019 23
EEE247: Discrete Mathematics
*Thanks
Dr. M. Alkrunz
07.12.2019 24
EEE247: Discrete Mathematics