You are on page 1of 35

Counting Techniques

• Tree Diagram

• Multiplication Rule

• Permutations

• Combinations
Tree Diagram

a method of listing outcomes of an


experiment consisting of a series
of activities
Tree diagram for the experiment
of tossing two coins

H
T

start H
T
T
Find the number of paths
without constructing the tree
diagram:

Experiment of rolling two dice, one


after the other and observing any
of the six possible outcomes each
time .

Number of paths = 6 x 6 = 36
Possibility Trees
In a tennis match, the first player to win two sets, wins the game.
• Question: What is the probability that player A will win
the game in 3 sets?
• Construct possibility tree:
Start

Winner of set 1 A B

Winner of set 2
A B A B
(A wins) (B wins)

Winner of set 3 A B A B
(A wins) (B wins) (A wins) (B wins)
Possibility trees
and Multiplication Rule
 Example:
When buying a PC system, you have the choice of
 3 models of the basic unit: B1, B2, B3 ;
 2 models of keyboard: K1, K2 ;
 2 models of printer: P1, P2 .
 Question:
How many distinct systems can be purchased?

6
Possibility trees and Multiplication Rule
Example(cont.): The possibility tree:

Start

Select the B1 B2 B3
basic unit

Select the
K1 K2 K1 K2 K1 K2
keyboard

Select the
P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2
printer

The number of distinct systems is: 3∙2∙2=12


7
The Multiplication Rule
If an operation consists of k steps and
 the 1st step can be performed in n1 ways,
 the 2nd step can be performed in n2 ways
(regardless of how the 1st step was performed) ,
….
 the kth step can be performed in nk ways
(regardless of how the preceding steps were performed) ,
then the entire operation can be performed
in n1 ∙ n2 ∙… ∙ nk ways.
8
Multiplication Rule (Example)
 Consider the following nested loop:
for i:=1 to 5
for j:=1 to 6
[ Statement 1 ;
Statement 2 . ]
next j
next i
 Question: How many times the statements in the
inner loop will be executed?
 Solution: 5 ∙ 6 = 30 times
(based on the multiplication rule)
9
Multiplication Rule (Example)
 A PIN is a sequence of any 4 digits (repetitions
allowed); e.g., 5279, 4346, 0270.
 Question. How many different PINs are possible?
 Solution. Choosing a PIN is a 4-step operation:
 Step 1: Choose the 1st symbol (10 different ways).
 Step 2: Choose the 2nd symbol (10 different ways).
 Step 3: Choose the 3rd symbol (10 different ways).
 Step 4: Choose the 4th symbol (10 different ways).
Based on the multiplication rule,
10∙10∙10∙10 = 10,000 PINs are possible.
Multiplication Rule (Example)
Consider the problem of choosing PINs
but now repetitions are not allowed.
 Question. How many different PINs are possible?
 Solution. Choosing a PIN is a 4-step operation:
 Step 1: Choose the 1st symbol (10 different ways).
 Step 2: Choose the 2nd symbol (9 different ways).
 Step 3: Choose the 3rd symbol (8 different ways).
 Step 4: Choose the 4th symbol (7 different ways).
Based on the multiplication rule,
10∙9∙8∙7 = 5,040 PINs are possible. 11
Example
The chairs of an auditorium are to be labeled
with a letter and a positive not exceeding 100.
What is the largest number of chairs that can
be labeled differently?
Solution:
Assigning 26 letters and then assigning on of
the 100 possible integers to the seat.
26.100 = 2600
Example
There are 32 micro computers in a computer
center. Each of microcomputer has 24 ports.
How many different ports to a microcomputer
in the center are there?
Solution:
First picking a microcomputer and then pick a
port on this computer. Because there are 32
ways to choose and 24 ways to choose the
port.
32.24 = 768 ports
Example
Sum Rule
Example
Ordered Arrangements
In how many different ways could four items
be arranged in order from first to last?

4  3  2  1 = 24
Factorial Notation

• n! is read "n factorial"

• n! is applied only when n is a whole


number.

• n! is a product of n with each positive


counting number less than n
Calculating Factorials

5! = 5 • 4 • 3 • 2 • 1 = 120

3! = 3 • 2 • 1 = 6
Definitions

1! = 1

0! = 1
Complete the Factorials:

4! = 24

10! = 3,628,800

6! = 720

15! = 1.3077 x 1012


Permutations

A permutation is an arrangement in a
particular order of a group of items.

There are to be no repetitions of items within


a permutation.)
Listing Permutations
How many different permutations of the
letters a, b, c are possible?

Solution: There are six different


permutations:

abc, acb, bac, bca, cab, cba.


Listing Permutations

How many different two-letter


permutations of the letters a, b, c, d are
possible?

Solution: There are twelve different


permutations:

ab, ac, ad, ba, ca, da, bc, bd, cb, db, cd,
dc.
Permutation Formula
The number of ways to arrange in order
n distinct objects, taking them r at a
time, is:

n!
Pn , r 
n  r  !
Another notation for
permutations:

P
n r
Find P7, 3

7! 7! 5040
P7 , 3     210
(7  3)! 4! 24
Applying the Permutation
Formula

6
P3, 3 = _______ 12
P4, 2 = _______

30 336
P6, 2 = __________ P8, 3 = _______

P15, 2 210
= _______
Application of Permutations

A teacher has chosen eight possible questions


for an upcoming quiz. In how many different
ways can five of these questions be chosen and
arranged in order from #1 to #5?

8!
Solution: P8,5 =
3! = 8• 7 • 6 • 5 • 4 = 6720
Combinations
A combination is a grouping
in no particular order
of items.
Combination Formula
The number of combinations of n objects
taken r at a time is:

n!
Cn , r 
(n  r ) ! r !
Other notations for
combinations:

n
n C r or  
 
r
Find C9, 3

9! 9! 362880
C9 , 3     84
3!(9  3)! 3!6! 6(720)
Applying the Combination
Formula

10
C5, 3 = ______ 35
C7, 3 = ________

1
C3, 3 = ______
105
C15, 2 = ________

15
C6, 2 = ______
Application of Combinations

A teacher has chosen eight possible questions


for an upcoming quiz. In how many different
ways can five of these questions be chosen if
order makes no difference?

8!
Solution: C8,5 = = 56
5!3 !

You might also like