Counting: Discrete Mathematics

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 28

Counting

Discrete Mathematics
Pigeonhole Principle
• If n is a positive integer and n + 1 or more objects are placed into m
boxes, then there is at least one box containing two or more of the
objects.
• The pigeonhole principle is also called the Dirichlet drawer principle,
after the nineteenth century German mathematician Peter Gustav
Lejeune Dirichlet, who often used this principle in his work
• Dirichlet was not the first person to use this principle, a
demonstration was first performed by two Parisians back in 17th
century
The Fundamental Counting Principle (FCP)
• If one thing can occur in m ways and a second thing can occur in n
ways and a third thing can occur in p ways and so, on then the
sequence of things can occur in
m x n x p x … ways
The Fundamental Counting Principle (FCP)
Example:
Liza brought 3 different pairs of pants and 4 shirts in a camp. How
many combinations of a shirt and a pair pants can she choose from to
wear?
shirt = 4 4*3 = 12 ways
pants = 3
The Fundamental Counting Principle (FCP)
Example:
Liza brought 3 different pairs of pants and 4 shirts in a camp. How
many combinations of a shirt and a pair pants can she choose from to
wear?

Let:
Shirts = A, B, C and D
Pants = 1, 2 and 3
The Fundamental Counting Principle (FCP)
Example:
How many 4 digit numbers are there that have no single digit
repeated in it?
10 digits = 0,1,2,3,4,5,6,7,8,9
0526 = 526
9 * 9 * 8 * 7 = 4536 ways
Factorial Notation
• The factorial of an integer k is the product of all integers from 1 to k
• This is usually denoted as k! read as “k factorial”
Factorial Notation
Example:
1) 7! = 7*6*5*4*3*2*1 = 5040
2) 5! = 5*4*3*2*1 = 120
Factorial Notation
•  The factorial operation is not distributive.
Example:
(5-3)! ≠ 5!-3!
(5-3)! = 2! = 2*1 = 2
• The factorial operation cannot be performed on non-integer numbers
Example:
(2.5)! or ()!
Factorial Notation
•• The
  factorial notation precedes multiplication and/or division
Example:
1) 5!3! ≠ (5*3)!

2) ≠ (8/2)!

3) 0! = 1
Permutation
• A permutation is an ordered arrangement of objects
• It tells us how many possible orders there can be given a number of
objects
• In permutation, if all objects are distinct then they cannot be
repeated
Permutation
Example:
How many ways can three books be arrange in a shelf?
Let: A, B, C
Permutation:
ABC BCA
ACB CAB
BAC CBA
Permutation
• Permutation
  is usually denoted by nPr read as “the permutation of n objects taken
r at a time”
• The general formula for permutation is,

nPr = n(n-1)(n-2) … (n-r+1)


Or
nPr =

• n is the total number of objects


• r is the number of objects in consideration
Permutation
•  If r=n, the equation becomes,

nPn = = = n!
Permutation
•Example:
 
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?

n = 100 100P3 = 100*99*98 = 970,200 ways


r=3 nPr =
Permutation
Example:
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?
8P3 = 8*7*6 = 336
8P3 = 8!/(8-3)! = 336
Permutation
Example:
How many permutations of the letters ABCDEFGH contain the string
ABC ?
8 letters
ABC = 1
DEFGH = 5 letters
n=r
6P6 = 6! = 720 ways
Permutation
Circular Permutation
• The number of ways n objects can be arranged in a circular manner is
given by,
C(n) = (n - 1)!
Permutation
Example:
How many ways can 4 people sit on a round table?

Let 4 people be: A, B, C and D

C(4) = (4 - 1)! = 3! = 6 ways


Permutation
Example:
How many ways can 4 people sit on a round table?
Combination
• A combination is an arrangement of objects with no respect to order
Combination
Example:
Find possible permutations and combinations of the word “cat”

For permutation:
catcta
actatc
tactca
Combination:
cat = act = tac = cta = atc = tca = 1
Combination
Example:
What if we take only two letters from the word “cat”? How many permutations and
combinations are there?
Permutation: 3P2 = 6 ways
ac at
ca ct
ta tc
Combination: 3 ways
ac = ca
tc = ct
at = ta
Combination
•  The general formula for a combination is,

nCr =

and read as “the combination of n objects taken r at a time”


Combination
Example:
Find how many possible combinations there are of 5 cards when
randomly selected from a standard deck of 52 cards.

*Since in getting 5 cards, order is not essential (i.e. getting


is the same as getting and all other orders) then we use
combination.
Combination
•Example:
 
Find how many possible combinations there are of 5 cards when
randomly selected from a standard deck of 52 cards.

52C5 = = 2,598,960
Activity
1) Find the number of ways of getting just a pair when randomly getting
three cards from a standard deck
2) How many three letter combinations can you make with the
following conditions (separate)?
a. Repetition is allowed
b. Repetition is not allowed
c. The first letter must be a vowel with no repetition of letters
d. There must be no vowel in the first two letters, repetition is now
allowed and the last letter must be a vowel

You might also like