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

Slides:



Advertisements
Similar presentations
9.5 Counting Subsets of a Set: Combinations
Advertisements

Counting. Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers ? How many steps.
5.3 Permutations and Combinations
Counting Chapter 6 With Question/Answer Animations.
Counting Techniques: Combinations
The Division Rule Theorem: Suppose a set A has n elements and is partitioned by the collection {A 1, A 2,..., A p }, where each partition set has m elements.
Chapter 3b Counting Rules. Permutations  How many ways can 5 students in a class of 30 be assigned to the front row in the seating chart?  There are.
Counting and Probability The outcome of a random process is sure to occur, but impossible to predict. Examples: fair coin tossing, rolling a pair of dice,
Discrete Structures & Algorithms More Counting. + + ( ) + ( ) = ? Counting II: Recurring Problems and Correspondences.
Counting Tools ● Enumeration ● Multiplication ● Addition ● Negation.
CSE115/ENGR160 Discrete Mathematics 04/17/12
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 10Feb 12, 2004Carnegie.
Discrete Mathematics Lecture 7 More Probability and Counting Harper Langston New York University.
Discrete Mathematics Lecture 5
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
1 More Counting Techniques Possibility trees Multiplication rule Permutations Combinations.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
1 Permutations and Combinations CS/APMA 202 Epp section 6.4 Aaron Bloomfield.
Permutations and Combinations
College Algebra Fifth Edition
Section 4.3: Permutations and Combinations Def: A permutation of a set of distinct objects is an ordered arrangement of these objects. Ex: {a, b, c, d}
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Combinatorics.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Counting. Why counting  Determine the complexity of algorithms To sort n numbers, how many instructions are executed ?  Count the number of objects.
Counting. Techniques for counting Rule 1 Suppose we carry out have a sets A 1, A 2, A 3, … and that any pair are mutually exclusive (i.e. A 1  A 2 =
Basic Counting Lecture 12: Oct 28. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations,
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Generalized Permutations and Combinations
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
2 Permutations and Combinations Lesson 8 HAND OUT REFERENCE SHEET AND GO OVER IT.
CSE 221: Algorithms and Data Structures Lecture #10 Counting: Easy as 1, 2, C(3,1) Steve Wolfman 2009W1 1.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Probability Permutations and Combinations.  Permutations are known as any arrangement of distinct objects in a particular _________. Permutations order.
Simple Arrangements & Selections. Combinations & Permutations A permutation of n distinct objects is an arrangement, or ordering, of the n objects. An.
Combinations A combination is an unordered collection of distinct elements. To find a combination, the general formula is: Where n is the number of objects.
1 Counting by Mapping Lecture 15: Nov 4 A B …… f.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.6,
Discrete Mathematics Lecture # 25 Permutation & Combination.
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2005 Lecture 7Sept 20, 2005Carnegie.
Counting Principles Multiplication rule Permutations Combinations.
Some other set notation We will use the notation to mean that e is an element of A. We will use the notation to mean that e is not an element of A.
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
CS Lecture 8 Developing Your Counting Muscles.
5.5 Generalized Permutations and Combinations
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
Copyright © Peter Cappello 2011 Simple Arrangements & Selections.
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Permutations & Combinations: Selected Exercises. Copyright © Peter Cappello2 Preliminaries Denote the # of arrangements of some k elements of a set of.
Section The Product Rule  Example: How many different license plates can be made if each plate contains a sequence of three uppercase English letters.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Week 9 - Friday.  What did we talk about last time?  Permutations  Counting elements in sets  Brief introduction to combinations.
Section 6.3. Section Summary Permutations Combinations.
Example A standard deck of 52 cards has 13 kinds of cards, with four cards of each of kind, one in each of the four suits, hearts, diamonds, spades, and.
The Multiplication Rule
Chapter 10 Counting Methods.
Discrete Mathematics Lecture 8 Probability and Counting
Developing Your Counting Muscles
CSE15 Discrete Mathematics 04/19/17
Permutations and Combinations
Generalized Permutations and Combinations
Basic Counting.
COUNTING AND PROBABILITY
Basic Counting Lecture 9: Nov 5, 6.
Discrete Structures Counting.
Presentation transcript:

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

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 Melikyan/DM/Fall09 Relationship between Permutations and Combinations Example: Write all two permutations of the set {1, 2, 3, 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 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 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 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 Melikyan/DM/Fall09 How many 5-person teams contain at least 1 man?

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 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 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 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 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 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 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 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 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 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 from textbook. Here is the picture explaining for the case n = 5

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 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 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 Melikyan/DM/Fall09 How many positive integral solutions are there for the above equation? Which Formula to Use?