9
Combinations and Permutations #1 - J. T. Butler 1 1 Comb’s and Permu’s -1 J. T. Butler Rule of Sum and Rule of Sum and Product Product Rule of sum: If one event can occur in m ways and another event can occur in n ways, there are m + n ways in which exactly one event can occur. 2 Comb’s and Permu’s -1 J. T. Butler Example lSuppose there are 5 red balls and 10 green balls. Then, there are 5+10=15 ways to choose a ball of any color. 3 Comb’s and Permu’s -1 J. T. Butler Rule of Product: If one event can occur in m ways and another event can occur in n ways, then there are m . n ways the two events can occur together. 4 Comb’s and Permu’s -1 J. T. Butler Example lSuppose there are 5 red balls and 10 green balls. Then, there are 5 . 10 = 50 ways to choose a red ball AND a green ball. 5 Comb’s and Permu’s -1 J. T. Butler Example The address register in your PC has 24 bits. How many locations can your PC access? Each bit can be chosen independently in 2 ways. By the rule of product, there are 2 . 2 . ... . 2=2 n = 16,777,216 or 16 megabytes. 6 Comb’s and Permu’s -1 J. T. Butler Permutations Permutations How many ways P(n,n) are there to arrange n of n objects? By the rule of product P (n,n) = n × (n -1) × (n - 2) × ... × 2 × 1 n ways to n -1 ways n -2 ways choose to choose to choose 1st object 2nd object 3rd object

Combinations and Permutations #1 - J. T. Butlerfaculty.nps.edu/butler/PDF/COMB_MATH/COM_PER1.pdf · Combinations and Permutations #1 ... Comb’s and Permu’s -1 J. T. Butler 20

  • Upload
    lengoc

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Combinations and Permutations #1 - J. T. Butler

1

1Comb’s and Permu’s -1 J. T. Butler

Rule of Sum andRule of Sum andProductProduct

Rule of sum:

If one event can occur in m ways andanother event can occur in n ways,there are m + n ways in which exactlyone event can occur.

2Comb’s and Permu’s -1 J. T. Butler

Example

lSuppose there are 5 red ballsand 10 green balls. Then,there are 5+10=15 ways tochoose a ball of any color.

3Comb’s and Permu’s -1 J. T. Butler

Rule of Product:

If one event can occur in mways and another event canoccur in n ways, then there arem . n ways the two events canoccur together.

4Comb’s and Permu’s -1 J. T. Butler

ExamplelSuppose there are 5 red balls

and 10 green balls. Then,there are 5 . 10 = 50 ways tochoose a red ball AND agreen ball.

5Comb’s and Permu’s -1 J. T. Butler

ExampleThe address register in your PC has 24bits. How many locations can yourPC access?

Each bit can be chosen independentlyin 2 ways. By the rule of product,there are 2 . 2 .... . 2=2n = 16,777,216or 16 megabytes.

6Comb’s and Permu’s -1 J. T. Butler

PermutationsPermutationsHow many ways P(n,n) are there to arrangen of n objects?

By the rule of product

P (n,n) = n × (n −1) × (n −2) × ... × 2 × 1

n ways to n −1 ways n −2 wayschoose to choose to choose1st object 2nd object 3rd object

Combinations and Permutations #1 - J. T. Butler

2

7Comb’s and Permu’s -1 J. T. Butler

n × (n-1) × (n-2) × ... × 2 × 1 = n!

“n factorial”

Also,

This is called permutation.

P n r n n n n r

nn r

( , ) ( ) ( ) ( )

!

( )!

= × − × − × × − +

=−

1 2 1K

8Comb’s and Permu’s -1 J. T. Butler

P (n,r) = n (n −1) (n −2) ... (n −r +1) can beviewed as a distribution of balls to cells

r positions (cells)6444447444448

n ways to n −1 ways to n −r +1 waysfill the fill the fill the1st position 2nd position rth position

L

9Comb’s and Permu’s -1 J. T. Butler

Notation:

( , ) is the number of permutations of

objects from a set of distinct objects

Alternative notation:

( ( , ))

P n r r

n

P P P n rrn

n r= =

10Comb’s and Permu’s -1 J. T. Butler

RememberRememberGiven a set S of n distinct objects, apermutation is an arrangement orordering of objects from S.

11Comb’s and Permu’s -1 J. T. Butler

How many permutations are there of twoelements of S={a,b,c,d}?

There are 12: ab, ba, ac, ca, ad, da, bc,cb, bd, db, cd, and dc.

P(4,2) = 4 . 3 = 12.

ExampleExample

12Comb’s and Permu’s -1 J. T. Butler

How many ways are there to arrange the three

letters in ALL?

If all letters were distinct,like AL L , there

be 3! = 6. But two of letters are identical.

ALL AL L AL L

LAL L AL L AL

LLA L L A L L A

1 2

1 2 2 1

1 2 2 1

1 2 2 1

⇔⇔⇔

ExampleExample

Combinations and Permutations #1 - J. T. Butler

3

13Comb’s and Permu’s -1 J. T. Butler

We observe that :

(the number of arrangements

of ALL) = number of arrange -

ments of AL L That is, the

number of arrangements of ALL

= 3!

2!

1 2

2

3

!

.

.

×

=

14Comb’s and Permu’s -1 J. T. Butler

In general,If there are objects of the first type,

objects of the second type, ... , objects

of the - th type, such that the total number

of objects , then the

number of arrangements of the objects is

!

n n

n

r

n n n n n

n

nn n n

r

r

r

1 2

1 2

1 2

= + + +...

! !... !.

15Comb’s and Permu’s -1 J. T. Butler

!

is called a

nn n n

multinomialr1 2! !... !

.

16Comb’s and Permu’s -1 J. T. Butler

ExampleIf six people, A, B, C, D, E, and F are seated about around table, how many circular arrangements arepossible?

C

C

D

AB

E

F

A

D

FE

B

D

A

CB

F

E

A

B

EF

C

D

(a) (b) (c) (d)Here, (a) and (b) are identical whereas (a)=(b), (c), and(d) are different.

17Comb’s and Permu’s -1 J. T. Butler

We can arbitrarily choose one person,say A, to be at the top. Then, we can choose the order of the remainingones in 5! ways. Thus, the number ofcircular permutations on 6 objects is 5!.

18Comb’s and Permu’s -1 J. T. Butler

Suppose that A, B, and C are females, and

D, E, and F are males. We now want to

arrange them so the sexes alternate. How

many ways are there to place the people?

Choose A, a female to be in top position.

There are 3! ways to arrange the males and 2!

ways to arrange the remaining females or

3! 2! = 12 ways.×

Combinations and Permutations #1 - J. T. Butler

4

19Comb’s and Permu’s -1 J. T. Butler

CombinationsCombinationsHow many ways are there to arrange5 red balls and 10 green balls?

There are 15 objects, 5 of the first kindand 10 of the second. Thus, there are

15!5! 10!

arrangements.

20Comb’s and Permu’s -1 J. T. Butler

Suppose we want the number of ways

to 5 objects from 15 distinct

objects. Notice, there is a one - to - one

correspondence between an arrangement

of 5 red balls and 10 green balls and a

selection of 5 objects from 15. Let the

red balls signify which object is selected.

choose

21Comb’s and Permu’s -1 J. T. Butler

Let be the number of ways to

select objects from . Then, we saw

In general,

C n r

r n

C C n r

nr n r

P n rr

( , )

( , )!

!. ( , )

!

!( )!

( , )

!.

15 515

5 10!= =

−=

22Comb’s and Permu’s -1 J. T. Butler

Alternative words:

C(n,r) is the number of ways to choose robjects from n distinct objects.

C(n,r) <=> “n choose r”

Alternative notation:

C Cn

rC n rr

nn r= =

FHGIKJ = ( , )

23Comb’s and Permu’s -1 J. T. Butler

Notes:

1. =!

!( - )!=

-.

2. When one chooses an object, it cannot

be chosen again. This is choice

repetition.

n

rn

r n r

n

n r

without

FHGIKJ

FHG

IKJ

24Comb’s and Permu’s -1 J. T. Butler

NoteNoteGiven a set S of n distinct objects, acombination is a subset S’ of S.combination <=> selection

Given a set S of n distinct objects, apermutation is an arrangement of elements.permutation <=> arrangement

Combinations and Permutations #1 - J. T. Butler

5

25Comb’s and Permu’s -1 J. T. Butler

Question:Let S = {a,b,c,d}. Then {a,b} and {c,d}are combinations. How manycombinations of size 2 are there of S?

Answer:{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, and{c,d} are all of the combinations of S ofsize 2. There are 6. There are 12permutations, two for each combinationabove.

26Comb’s and Permu’s -1 J. T. Butler

Rule of sum:C(n,r) = C(n−1, r) + C(n−1, r−1)

Choose r objects Choose the special object from n− 1 objects and r − 1 other objects not including a from n − 1 objects not special object. including the special

object.

27Comb’s and Permu’s -1 J. T. Butler

C(4,2) = C(3,2) +C(3,1) = 3+3 = 6

6447448 6447448 {b,c}, {b,d}, {c,d} {a,b}, {a,c}, {a,d}

a is the special object.

28Comb’s and Permu’s -1 J. T. Butler

Pascal’s TrianglePascal’s TriangleSum Diff.

1 1 1 1 1 2 0 1 2 1 4 0 1 3 3 1 8 0 1 4 6 4 1 16 0 1 5 10 10 5 1 32 0 1 6 15 20 15 6 1 64 0

29Comb’s and Permu’s -1 J. T. Butler

How to build Pascal’s triangle

1. Write the 1’s 1 1 1 1 1

2. Fill in the remaining numbers by adding pairs 1

1 1

1 2 1

1 3 3 130Comb’s and Permu’s -1 J. T. Butler

Brief historyThis was first published in 1653by Pascal in one of the firstpublications on probability.

Combinations and Permutations #1 - J. T. Butler

6

31Comb’s and Permu’s -1 J. T. Butler

r

n 0 Sum Diff.

0 1 1 1 11 2 1 1 2 02 3 1 2 1 4 03 4 1 3 3 1 8 04 5 1 4 6 4 1 16 05 6 1 5 10 10 5 1 32 06 7 1 6 15 20 15 6 1 64 0

32Comb’s and Permu’s -1 J. T. Butler

Note:Pascal’s Rule is used to derive theentries of this table. That is,C(0,0) = 1

and

C (n,r) = C (n −1, r) +C (n −1, r −1).

33Comb’s and Permu’s -1 J. T. Butler

r

n 0 Sum Diff.

0 1 1 1 11 2 1 +1 2 02 3 1 +2 +1 4 03 4 1 +3 +3 +1 8 04 5 1 +4 +6 +4 +1 16 05 6 1 +5 +10 +10 +5 +1 32 06 7 1 +6 +15 +20 +15 +6 +1 64 0

34Comb’s and Permu’s -1 J. T. Butler

r

n 0 Sum Diff.0 1 1 1 11 2 1 -1 2 02 3 1 -2 +1 4 03 4 1 -3 +3 -1 8 04 5 1 -4 +6 -4 +1 16 05 6 1 -5 +10 -10 +5 -1 32 06 7 1 -6 +15 -20 +15 -6 +1 64 0

35Comb’s and Permu’s -1 J. T. Butler

Note:C(n, r) is the number of ways to chooser objects from n distinct objects.

C(n, r) is called a “binomial coeffi-cient”.

Binomial coefficients satisfy thousandsof identities.

36Comb’s and Permu’s -1 J. T. Butler

Naming the AceNaming the AceParadoxParadox

Combinations and Permutations #1 - J. T. Butler

7

37Comb’s and Permu’s -1 J. T. Butler

A Deck of Cards is a set of 52 cards

Each card as a value

2 3 4 5 6 7 8 9 10 J Q K Awhere J = Jack, Q = Queen K = King, and A = Ace

and a suit

Hearts Diamonds Spades Clubs

38Comb’s and Permu’s -1 J. T. Butler

EXAMPLE:

There are four aces

ace of heartsace of diamondsace of spadesace of clubs

Similarly, there are four kings, fourqueens, etc.

39Comb’s and Permu’s -1 J. T. Butler

Hearts

Diamonds

Spades

Clubs

40Comb’s and Permu’s -1 J. T. Butler

Definition:“To deal 52 cards to 4 people”

means to randomly give 13 cards to 4people. Usually, a person knowsonly those cards given to him/her.

Definition:A hand is a set of 13 cards given

to one person.

41Comb’s and Permu’s -1 J. T. Butler

Question: Naming the ace

52 cards are distributed to 4 people. Oneperson says “I have an ace.” What is theprobability he/she has another ace?

Answer: 5359/14498 < .

However, suppose he/she says, “I have anace of spades.” What is the probabilityhe/she has another ace?

Answer: 11686/20825 > !

1

2

1

242Comb’s and Permu’s -1 J. T. Butler

Question:

Why should naming the ace changethe probability?

Combinations and Permutations #1 - J. T. Butler

8

43Comb’s and Permu’s -1 J. T. Butler

Small DeckSmall DeckShown below is a much smaller deck.In this case, we give two cards eachto two people.

44Comb’s and Permu’s -1 J. T. Butler

Below are the six different hands withtwo cards

1

2

3

4

5

6

45Comb’s and Permu’s -1 J. T. Butler

There are 6 ways a person can have ahand of two cards, as shown. Ifsomeone says, “I have an ace”, theprobability he/she has another ace is1/5 (there are 5 hands with at least oneace, only one of which has anotherace). If he/she says, “I have an ace ofspades,” then the probability he/shehas another ace is 1/3.

46Comb’s and Permu’s -1 J. T. Butler

Mr. Smith has two children. At leastone is a boy. What is the probabilitythat the other is a boy also?

Children Paradox

47Comb’s and Permu’s -1 J. T. Butler

There are four equally likely outcomes

Older Younger

Boy BoyBoy GirlGirl BoyGirl Girl (impossible)

Since only one of three possibleoutcomes consists of two boys, theprobability is 1/3 !

48Comb’s and Permu’s -1 J. T. Butler

Playing KenoPlaying KenoQuestion: Keno is a game in which youchoose 6 distinct numbers from 1 to 80.The casino chooses 20 distinct numbersfrom 1 to 80. You enter a choice ofnumbers for $0.60 and the casino paysyou an amount of money depending onhow many of the 6 numbers you havechosen matches the numbers chosen bythe casino.

Combinations and Permutations #1 - J. T. Butler

9

49Comb’s and Permu’s -1 J. T. Butler

For example, you win $1,000 if all

six numbers you have chosen were

also chosen by the casino. What is

the probability ( ) that exactly of

the numbers you have chosen were

chosen by the casino, for ?

P k k

k0 6≤ ≤

50Comb’s and Permu’s -1 J. T. Butler

Answer:Number of Number of Number ofways k of 80 ways casino ways playernumbers can can choose can choosematch remaining remaining

numbers numbers

Total number of Total number of ways casino can ways player can choose numbers choose numbers

P kk

k

k k( ) =

FHG

IKJ

−FHG

IKJ −FHG

IKJ

FHG

IKJFHG

IKJ

80 80

20

60

680

20

80

6

(1)

51Comb’s and Permu’s -1 J. T. Butler

k P(k) Class exp.

0 0.167 0.1381 0.363 0.2782 0.308 0.3053 0.130 0.2504 0.029 0.0285 0.003 0.0006 0.0001 0.000

This table shows the exactprobability, as calculatedfrom (1). Also shown isthe probability as extrac-ted during a class experi-ment in which 40 studentschose 6 numbers and theinstructor chose 20.

52Comb’s and Permu’s -1 J. T. Butler

ExactExperiment

00.10.20.30.4

0 1 2 3 4 5 6

00.10.20.30.4

ProbabilityProbability

k

Playing KenoProbability of matching k numbersProbability of matching k numbers

53Comb’s and Permu’s -1 J. T. Butler

How to Become RichHow to Become Richby Playing Kenoby Playing Keno

You cannot.Spend yourmoney some-where else.

54Comb’s and Permu’s -1 J. T. Butler