15
4. Counting 4.1 The Basic of Counting Basic Counting Principles k. either tas do to ways are e then ther time, same at the done be cannot tasks these if and , ways in task second a and ways in done be can first task a If Rule Sum The 2 1 2 1 n n n n Example 1 suppose that either a member of the faculty or a student in the department is chosen as a representative to university committee. How many different choices for this representative if there are 37 members of the faculty and 83 students? Solution There are 37+83=120 possible ways to pick this representative. • Combinatorics, the study of arrangements of objects, is an important part of discrete mathematics.

4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Embed Size (px)

Citation preview

Page 1: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

4. Counting

4.1 The Basic of Counting

Basic Counting Principles

k.either tas do to ways

are e then ther time,same at the done becannot tasks theseif and

, waysin task second a and waysin done becan first task a If

Rule Sum The

21

21

nn

nn

Example 1 suppose that either a member of the faculty or a student in the department is chosen as a representative to university committee. How many different choices for this representative if there are 37 members of the faculty and 83 students?

Solution There are 37+83=120 possible ways to pick this representative.

• Combinatorics, the study of arrangements of objects, is an important part of discrete mathematics.

Page 2: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

. is tasks theseof one do to waysofnumber Then the

time.same at the done becannot tasks theseand ly,respective

ways,in done becan tasks that theSuppose

Rule Sum of version dgeneralize The

21

2121

m

mm

nnn

,...,n,nn,...,T,TT

Example 2 A student can choose a computer science project from one of three list. The three lists contain 23,15 and 19 possible project, respectively. How many possible projects are there to choose from?

Solution There are 23+15+19=57 possible projects to choose from.

Page 3: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

procedure. do to waysare e then therdone,been has first task after the

task second thedo to ways and first task thedo to ways are there

If tasks. twointodown broken becan procudure a that Suppose

RuleProduct The

21

21

n n

nn

Example 2 The chairs are to be labeled with a letter and a positive integer not exceeding 100. What is the largest number of chairs that can be labeled differently?Solution 26×100= 2600 chairs can be labeled differently.

procedure. out thecarry to ways are then there

done,been have safter task waysin done becan task If

. tasks theperformingby out carried is procedure a that Suppose

RuleProduct of version dgeneralize The

21

121

21

m

iii

m

nnn

,...,T,TTnT

,...,T,TT

Example 3   How many different bit strings are there of length seven?Solution seven.length of stringsdifferent 12827

Page 4: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 4   How many different license plates are available if each plate contains a sequence of three letters followed by three digits?

Solution plates. license possible 17576000101010262626

Page 5: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

4.3 Permutations and Combinations

• Select 5 players from 10 members----How many possible choices?

• Prepare an ordered list of 4 plays to play the four singles matches

------How many possible choices?

Unordered collection

Ordered collection

Permutations

• A permutation of a set of distinct objects is an ordered arrangement of these objects.

• An r-permutation is an ordered arrangement of r elements of a set.

Example 1 Let S={1,2,3}. The arrangement 3,1,2 is a permutation of S. The arrangement 3,2 is a 2-permutation of S.

Page 6: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Theorem 1 The number of r-permutation of a set with n distinct elements is P(n,r)=n(n-1)(n-2)…(n-r+1)=n!/(n-r)!

Proof

The first element can be selected from n elements.

The second element can be selected from the remaining n-1 elements.

The third element can be selected from the remaining n-2 elements.

..….

The rth element can be selected from the remaining n-(r-1) elements.

By using the product rule, P(n,r)=n(n-1)(n-2)…(n-r+1).

Example 2   How many different ways are there to select 4 different players from 10 players on a team to play four tennis matches, where the matches are ordered?

.504078910)4,10( :Solution P

Page 7: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 3   Suppose there are eight runners in a race. The winner receives a gold metal, the second-place finisher receives a silver metal, 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?

678)3,8( :Solution P

Example 4   Suppose that a saleswoman has to visit eight different cities.She must begin her trip in a specified city, but she can visit the other seven cities in any order she wishes. How many possible orders can the saleswoman use when visiting these cities?

5040!7)7,7( :Solution P

Page 8: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Combinations

• An r-combination of elements of a set is an unordered selection of r elements from the set.

The number of r-combinations of a set with n distinct elements is denoted by C(n,r).

Example 5 Let S={1,2,3,4}. Then {1,2,3} is a 3-combination from S.

Example 6 We see that C(4,2)=6, since 2-combination of {a,b,c,d} are the six subsets {a,b},{a,c},{a,d},{b,a},{b,c},{b,d}.

Page 9: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

.)!(!

!),(

equals,0th integer wi na is andinterger positive a is where

elements,n set with a ofset a of nscombinatio- ofnumber The

2 Theorem

rnr

nrnC

nr rn

r

.)!(!

!

)!/(!

)!/(!

),(

),(),( that implies This

).,(),(),( ly,Consequent

ways.in

done becan which n,combinatio-eachin elements theordering (2)

thenand set, theof nscombinatio- the, theforming (1)

by obtained becan set, theof nspermutatio- the, :Proof

rnr

n

rrr

rnn

rrP

rnPrnC

rrPrnCrnP

P(r,r)

r

rC(n,r)

rP(n,r)

Page 10: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 7 How many ways are there to select 5 players from a 10-member tennis team to make a trip to a match at another school?

.252!5!5

!10)5,10( Solution C

Example 8 How many ways are there to select a committee to develop a discrete mathematics course at a school if the committee is to consist of 3 faculty members from the mathematics department and 4 from the computer science department, if there are 9 faculty members in the mathematics department and 11 of the computer science department?

.2772033084!7!4

!11

!6!3

!9)4,11()3,9(

is committee select the to waysofnumber theTherefore,

elements. 11set with a of nscombinatio-4

ofnumber theand elements 9set with a of nscombinatio-3 of

number theofproduct theisanswer therule,product By the Solution

CC

Page 11: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

4.4 Discrete Probability

Finite Probability

• Experiment: a procedure that yields one of outcomes.

• Sample space of the experiment S: the set of possible outcomes.

• Event E: a subset of the sample space.Definition 1. The probability of an event E, which is a subset of a finite sample space S of equally likely outcomes, is p(E)=|E|/|S|.

Example 1 An urn contains 4 blue balls and 5 red balls. What is the probability that a ball chosen from the urn is blue?

There are 9 possible outcomes, and 4 of them produce a blue ball. Hence, the probability that a blue ball is chosen is P(E) = |E|/|S|= 4/9.

Solution• Experiment: Chose a ball from the urn. • Sample space S = {b,b,b,b,r,r,r,r,r}. |S| = 9. • Event E = {b,b,b,b}. |E| = 4

Page 12: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 2 What is the probability that when two dice are rolled, the sum of the numbers on the two dice is 7?

There are 36 possible outcomes. Among them there 36 successful outcomes: (1,6),(2,5),(3,4),(4,3),(5,2),(6,1 ) . Hence, the probability is P(E) = |E|/|S| = 6/36=1/6 .

Solution• Experiment: Roll two dice. • Sample space S = {(x,y) | 1 ≤ x,y ≤ 6}. |S| = 6×6=36. • Event E = { (x,y) | x + y = 7}. |E| = 6.

Page 13: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 3 In a lottery, players win a large prize when they pick four digits that match, in the correct order, four digits selected by a random mechanical process. A smaller prize is won if only three digits are matched. What is the probability that a player wins the large prize? What is the probability that a play wins the small prize?

(1) There are 10000 to choose four digits. Hence, the probability that a player wins the large prize is P(E1) = |E1|/|S| = 1/10000.

(2) To win the small prize, exactly one digit must be wrong to get three digits correct. There are 36 ways to choose four digits like this. Hence, the probability that a player wins the small prize is P(E2) = |E2|/|S| = 36/10000=0.0036.

Solution Suppose that the 4 digits for the large prize are (u,v,x,y). • Experiment: Select 4 digits. • Sample space S = {(a,b,c,d) | 0 ≤ a,b,c,d≤ 9}. |S| = 10×10×10×10• Event 1 (large prize) E1 = { (u,v,x,y)}. |E| = 1. Event 2 (smaller prize) E2 = { (a,b,c,d) | a ≠ u or b ≠ v or c ≠ x or d ≠ y} |E2| = 9 + 9 +9 + 9 = 36

Page 14: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 4 There are lotteries that award enormous prizes to people who correctly choose a set of six numbers out of the first n positive integers, where n between 30 and 50. What is the probability that a person picks the correct six numbers out of 40?

The total number of ways to choose 6 numbers out of 40 is P(E) = |E|/|S| = C(40,6)=40!/(34!6!)=3838380. Hence, the probability is 1/3838380.

Solution Suppose that the 6 numbers from 1 to 40 for the prize are {u,v,w,x,y,z}. • Experiment: Select 6 numbers from 1 to 40. • Sample space S = {{a,b,c,d,e,f} | 0 ≤ a,b,c,d,e,f ≤ 40}. |S| = C(40,6)• Event 1 (large prize) E = { {u,v,w,x,y,z} }. |E| = 1.

Page 15: 4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is

Example 5 Find the probability that a hand of five cards in poker contains three cards of one kind (same kind of character: 2, 3, …, K, A).

The probability is P(E) = |E|/|S| = ).5,52(/)2,49()3,4()1,13( CCCC

Solution •Experiment: Pick 5 cards from 52 cards. • Sample space S = {{a,b,c,d,e} | a,b,c,d,e are picked from 52 cards}. |S| = C(52,5)• Event E = { {a,b,c,d,e} | three of them are same kind}. |E| = C(13,1)C(4,3)C(49,2).