Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,

Similar presentations


Presentation on theme: "1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,"— Presentation transcript:

1 1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan melikyan@nccu.edu Today we will review sections 6.4, 6.5

2 2 Melikyan/DM/Fall09 Combinations Definition: An r-combination of a set of n elements is a subset of r elements. The symbol C(n, r), read “ n choose r” denotes the number of r-combinations Permutation is an ordered selection Combination is an unordered selection Example: Let S ={Ann, Bob, Cyd, Dan}. List all 3- combinations of S

3 3 Melikyan/DM/Fall09 Relationship between Permutations and Combinations Example: Write all two permutations of the set {1, 2, 3, 4}

4 4 Melikyan/DM/Fall09 Theorem: The Number of subset of size r ( r-combinations) that can be chosen from a set of n elements, C(n, r), is given by the formula C(n, r) = or equivalently C(n, r) = where n and r are nonnegative integers with r  n To form an r-permutation of a set of n elements first choose a subset of r of the n elements ( there are C(n, r) you can choose) then choose an ordering for the r elemets

5 5 Melikyan/DM/Fall09 Problems: There are 12 people, 5 men and 7 women, to work on a project: –How many 5-person teams can be chosen? P(12, 5) = 792 –If two people insist on working together (or not working at all), how many 5-person teams can be chosen?

6 6 Melikyan/DM/Fall09 Suppose two members of the group do not get along and refuse to work together on a team. How many 5-person teams can be formed? Is there any alternatives to this solution?

7 7 Melikyan/DM/Fall09 Problem: Suppose the group consists of 7 women and 5 men. 1) How many 5-person teams contain at most 1 man?

8 8 Melikyan/DM/Fall09 How many 5-person teams contain at least 1 man?

9 9 Melikyan/DM/Fall09 Poker Hands: There are 52 cards in a deck. Each card has a suit and a value. 4 suits (♠ ♥ ♦ ♣) 13 values (2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A) Five-Card Draw is a card game in which each player is initially dealt a hand, a subset of 5 cards. How many different hands?

10 10 Melikyan/DM/Fall09 Four of a Kind A Four-of-a-Kind is a set of four cards with the same value. How many different hands contain a Four-of-a-Kind? A hand with a Four-of-a-Kind is completely described by a sequence specifying: 1. The value of the four cards. 2. a card other than four cards selected in step 1. By generalized product rule, there are 13x 48 = 624 hands.

11 11 Melikyan/DM/Fall09 What about Full House A Full House is a hand with three cards of one value and two cards of another value. How many different hands contain a Full House? A Full Houses can be specified by selecting 1. The value of the triple, which can be chosen in 13 ways. 2. The suits of the triple, which can be selected in C(4,3) =4 ways. 3. The value of the pair, which can be chosen in 12 ways ( why12?). 4. The suits of the pair, which can be selected in C(4, 2) = 6 ways. By generalized product rule, there are

12 12 Melikyan/DM/Fall09 How many hands have Two Pairs; that is, two cards of one value, two cards of another value, and one card of a third value? 1. The value of the first pair, which can be chosen in 13 ways. 2. The suits of the first pair, which can be selected C(4, 2) = 6 ways. 3. The value of the second pair, which can be chosen in 12 ways. 4. The suits of the second pair, which can be selected in C(4, 2) = 6 ways 5. The fifth card, which can be chosen in 44 ways. So, is the total number = 13x6x12x6x44 ? Double Counting

13 13 Melikyan/DM/Fall09 Problem: How many eight-bit strings have exactly three 1’s? To solve the problem, imagine eight empty positions in to which the 0’s and 1’s of the bit strings will be placed Once a subset of three positions has been chosen from the 8 to contain 1’s the remaining places must contain 0’s. So, the number of 8-bits containing exactly 3 1’s is C(8, 3) = 54 =

14 14 Melikyan/DM/Fall09 Permutation of a Set with Repeated Elements Problem: How many different ways can letters in the word MISSISSIPPI be arranged. Solution: Imagine placing the 11 letters of this word one after another into 11 positions

15 15 Melikyan/DM/Fall09 Solution (continue) Note that constructing an ordering for these letters can be thought of as four step process: 1. Select positions for the four S’s. C(11, 4) 2. Select positions for the four I’s out of remaining 7 positions. C(7, 4) 3. Select positions for the two P’s out of three positions. C(3, 2) 4. Select a position for the M. C(1, 1) C(11, 4) C(7, 4) C(4, 3) C(1.1) = = = 34650

16 16 Melikyan/DM/Fall09 Theorem : Suppose a collection consists of n objects of which: n 1 are type 1 and are indistinguishable from each other n 2 are of type 2 and are indistinguishable from each other... n k are of type k and are indistinguishable from each other and suppose that n 1 + n 2 = … + n k = n. Then the number of distinct permutations of the n objects is C(n, n 1 )C(n - n 1, n 2 )C(n – n 1 - n 2, n 3 )... C(n k, n k ) = =

17 17 Melikyan/DM/Fall09 Combinations with Repetition Definition: An r-combination with repetition allowed (or multiset of size r) chosen from a set X of n elements is an unordered selection of elements where some elements can be repeated Example: Find the number of 3-combinations with repetitions allowed from the set of4 elements {1, 2, 3, 4}

18 18 Melikyan/DM/Fall09 Theorem: The number of r-combinations with repetition allowed that can be selected from a set of n elements is C(r + n -1, r) = Example: How many monotone triples exist in a set of n elements? Same as in example 6.5.3 from textbook. Here is the picture explaining for the case n = 5

19 19 Melikyan/DM/Fall09 Example (continue): Thus any triple of integers (i, j, k) with 1  i  j  k  n can be represented as a sting of n -1 vertical bars and three crosses. By theorem The number of such triples is

20 20 Melikyan/DM/Fall09 Nice Example: Consider the implementing the following algorithm: for k := 1 to n for j := 1 to k for i := 1 to j printf(“hello ”); next I next j next k How many times word hello will be printed if the program implementing this algorithm is run?

21 21 Melikyan/DM/Fall09 Example: Integral solutions of an Equations How many non-negative integral solutions are there to the equation x 1 + x 2 + x 3 + x 4 = 10?

22 22 Melikyan/DM/Fall09 How many positive integral solutions are there for the above equation? Which Formula to Use?


Download ppt "1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,"

Similar presentations


Ads by Google