Math 42, Discrete Mathematics

Similar documents
Math236 Discrete Maths with Applications

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Math 166: Topics in Contemporary Mathematics II

Block 1 - Sets and Basic Combinatorics. Main Topics in Block 1:

Combinations. April 14, 2006

November 6, Chapter 8: Probability: The Mathematics of Chance

Chapter 2. Permutations and Combinations

Discrete Structures Lecture Permutations and Combinations

Sec 5.1 The Basics of Counting

Section Summary. Permutations Combinations Combinatorial Proofs

Finite Math - Fall 2016

With Question/Answer Animations. Chapter 6

Introductory Probability

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability (solutions)

{ a, b }, { a, c }, { b, c }

Counting. Chapter 6. With Question/Answer Animations

Jong C. Park Computer Science Division, KAIST

Reading 14 : Counting

Compound Probability. Set Theory. Basic Definitions

Elementary Combinatorics

Discrete Mathematics with Applications MATH236

Counting Methods and Probability

Topics to be covered

Probability. The MEnTe Program Math Enrichment through Technology. Title V East Los Angeles College

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability

Sec$on Summary. Permutations Combinations Combinatorial Proofs

Fundamentals of Probability

Counting Poker Hands

6.1 Basics of counting

Probability MAT230. Fall Discrete Mathematics. MAT230 (Discrete Math) Probability Fall / 37

Today s Topics. Sometimes when counting a set, we count the same item more than once

What is counting? (how many ways of doing things) how many possible ways to choose 4 people from 10?

Week 1: Probability models and counting

The next several lectures will be concerned with probability theory. We will aim to make sense of statements such as the following:

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 15: Counting

Permutations and Combinations

Combinatorial Proofs

9.5 Counting Subsets of a Set: Combinations. Answers for Test Yourself

n! = n(n 1)(n 2) 3 2 1

Combinatorics. Chapter Permutations. Counting Problems

Lecture 18 - Counting

FOURTH LECTURE : SEPTEMBER 18, 2014

MATHEMATICS 152, FALL 2004 METHODS OF DISCRETE MATHEMATICS Outline #10 (Sets and Probability)

NOTES ON SEPT 13-18, 2012

Mat 344F challenge set #2 Solutions

Slide 1 Math 1520, Lecture 13

Mixed Counting Problems

Principles of Counting. Notation for counting elements of sets

CIS 2033 Lecture 6, Spring 2017

MA 524 Midterm Solutions October 16, 2018

Non-overlapping permutation patterns

Problem Set 2. Counting

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Chapter 1. Probability

2.5 Sample Spaces Having Equally Likely Outcomes

November 8, Chapter 8: Probability: The Mathematics of Chance

CSE 21 Mathematics for Algorithm and System Analysis

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Chapter 2 Basic Counting

Math 1111 Math Exam Study Guide

MAT104: Fundamentals of Mathematics II Summary of Counting Techniques and Probability. Preliminary Concepts, Formulas, and Terminology

With Question/Answer Animations. Chapter 6

DISCRETE STRUCTURES COUNTING

The Product Rule can be viewed as counting the number of elements in the Cartesian product of the finite sets

Section : Combinations and Permutations

Permutations: The number of arrangements of n objects taken r at a time is. P (n, r) = n (n 1) (n r + 1) =

Introductory Probability

Permutations and Combinations

Discrete mathematics

Permutations. Used when "ORDER MATTERS"

Probability and Counting Techniques

Honors Precalculus Chapter 9 Summary Basic Combinatorics

Elementary Combinatorics CE 311S

Combinatorics and Intuitive Probability

The topic for the third and final major portion of the course is Probability. We will aim to make sense of statements such as the following:

More Probability: Poker Hands and some issues in Counting

Theory of Probability - Brett Bernstein

Course Learning Outcomes for Unit V

CSE 312: Foundations of Computing II Quiz Section #1: Counting (solutions)

Counting and Probability Math 2320

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

6/24/14. The Poker Manipulation. The Counting Principle. MAFS.912.S-IC.1: Understand and evaluate random processes underlying statistical experiments

POKER (AN INTRODUCTION TO COUNTING)

CISC-102 Fall 2017 Week 8

W = {Carrie (U)nderwood, Kelly (C)larkson, Chris (D)aughtry, Fantasia (B)arrino, and Clay (A)iken}

COUNTING AND PROBABILITY

8.2 Union, Intersection, and Complement of Events; Odds

1. An office building contains 27 floors and has 37 offices on each floor. How many offices are in the building?

Counting integral solutions

Unit Nine Precalculus Practice Test Probability & Statistics. Name: Period: Date: NON-CALCULATOR SECTION

Math 4610, Problems to be Worked in Class

Math 1111 Math Exam Study Guide

CSE 312: Foundations of Computing II Quiz Section #2: Combinations, Counting Tricks (solutions)

Lecture 1. Permutations and combinations, Pascal s triangle, learning to count

19.2 Permutations and Probability Combinations and Probability.

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 11

The Pigeonhole Principle

1. The chance of getting a flush in a 5-card poker hand is about 2 in 1000.

The study of probability is concerned with the likelihood of events occurring. Many situations can be analyzed using a simplified model of probability

Math 1116 Probability Lecture Monday Wednesday 10:10 11:30

Transcription:

c Fall 2018 last updated 10/29/2018 at 18:22:13 For use by students in this class only; all rights reserved. Note: some prose & some tables are taken directly from Kenneth R. Rosen, and Its Applications, 8th Ed., the ocial text adopted for this course.

Basic Principles Denition (The Product Rule) Suppose that a procedure can be broken down into a sequence of two tasks. If there are n 1 ways to do the rst task and for each of these ways of doing the rst task, there are n 2 ways to do the second task, then there are n 1 n 2 ways to do the procedure. c R. P.

Basic Principles Fact An extended version of the product rule is often useful. Suppose that a procedure is carried out by performing the tasks T 1, T 2,..., T m in sequence. If each task T i, i = 1, 2,..., m, can be done in n i ways, regardless of how the previous tasks were done, then there are n 1 n 2 n m ways to carry out the procedure. Proof. We use mathematical induction. Let P(m) be the assertion stated in the Fact above. Step 1 P(2) is just the Product Rule stated above. We accept that without further proof. Remark P(1) is trivial. It turns out that we need to prove P(2) in c R. P.

continued. Step 2 (Inductive Step): Suppose P(k) is true. Then we consider the steps T 1, T 2,..., T k to be performed as comprising a single, albeit complicated, rst task and step T k+1 as a second task. Then according to the Product Rule above, the number of ways of carrying out the procedure is the number of ways of carrying out the rst (k-step) task times the number of ways of carrying out the second task, T k+1. But by the inductive hypothesis P(k), the number of ways of carrying out the rst (k-step) task is n 1 n 2 n k, while the number of ways of carrying out the second task is n k+1. So the total number of ways of carrying out the succession of k + 1 tasks is (n 1 n 2 n k ) n k+1 = n 1 n 2 n k+1. c R. P.

Product Rule Examples Example If A 1,..., A n are nite sets, then A 1 A n = A 1 A n (1) Example In 2018, how many possible birthdays are therein orderfor a class of 35 students? If A 1 = A 2 = = A 35 = {days on the 2018 calendar}, then A 1 A 35 = 365 35 = 4.789 10 89. c R. P.

Product Rule Examples Example In 2018, how many possible birthdays are therein orderfor a class of 35 students if repetition is not allowed? We have 365 choices for the rst birthday in the list, 364 choices for the second choice, etc. Why? Using the extended product rule, we end up with 365 364 363 331 = 8.889 10 88 choices. Remark Note that this is not a Cartesian product type problem. Each choice of birthday depends on the previous choicesbut the number of choices does not depend on the particular choices made earlier. c R. P.

Product Rule Examples Remark As we'll see later when we study simple equal-likelihood probability models, we can combine the previous two results to get that the probability that no two students in this class have the same birthday is (8.889 10 88 )/(4.789 10 89 ) = 0.18562. But further probability results will say that the probability that at least two students in the class share a birthday is 1 0.18562 = 0.81438. That is, the chances are above 81% that at least two people in the class share a birthday. c R. P.

the Number of Functions Fact If X = n and Y = mso X and Y are nite setsthen the number of possible functions f : X Y is m n. Proof. List the elements of X in some order: x 1,..., x n. To dene a function f : X Y we need to specify a value f(x i ) Y for each i = 1,..., n. But for each i, we have m possible choices for f(x i ). The Product rule then says that we have m m = m n possible ways to assign values to the f(x i ), and hence m n possible functions from X to Y. c R. P.

the Number of Functions Remark If X and Y are sets, more advanced texts use the notation Y X = {all functions f : X Y}. Note that this is simply notation; Y X makes no sense computationally. Thus, the result above can be restated as Y X = Y X. c R. P.

the Number of Functions Fact If X = n and Y = mso X and Y are nite setsthen the number of possible one-to-one functions f : X Y is m (m 1) (m 2) (m n + 1) (2) if n m, and 0 otherwise. Proof. If n > m the Pigeonhole Principle from Chapter 1 says that for any function f : X Y, at least one element of Y must have more than one element of X sent to it. This precludes one-to-one-ness for f. For n m, again list the elements of X in some order: x 1,..., x n. Then we have m choices for f(x 1 ), (m 1) choices for f(x 2 ), etc. Apply the Product Rule to get (2). c R. P.

Rick's Bistrot Internationale Rick s Bistrot Internationale Appetizers Crispy Egg Rolls Chicken Satay Guacamole & Chips California Roll Caprese Salad Main Courses Lamb Korma Red Curry Chicken Eggplant Parmesan Desserts Mango Pudding Chocolate Decadence Apple Pie a la Mode Assiette de Fromages: Brie, Chèvre, Roquefort Prix Fixe I: Two Courses 1 Appetizer & 1 Main Course or 1 Main Course & 1 Dessert Prix Fixe II 1 Appetizer, 1 Main Course, & 1 Dessert c R. P.

Product Rule Examples Example How many dierent Prix Fixe II dinners are possible at Rick's Bistrot Internationale? We choose one option from each of the three courses, Appetizer, Main Course, and Dessert. Since the number of choices available in each course does not depend on the specic choices we make, we may apply the Product Rule. So the total number of Prix Fixe II dinners available is 5 3 4 = 60, since we have 5 appetizer choices, 3 choices for the main course, and 4 dessert choices. c R. P.

Basic Principles Denition (The Sum Rule) If a task can be done either in one of n 1 ways or in one of n 2 ways, where no element of the set of n 1 ways is the same as any element of the set of n 2 ways, then there are n 1 + n 2 ways to do the task. Remarks The context here is a task that, at least supercially, only involves one stepnot a sequence of steps as in the product rule. As a result, the Sum Rule can be thought of as an application of the rule for nding the cardinality of A 1 A 2, where A 1 and A 2 are disjoint nite sets. A 1 A 2 = A 1 + A 2 c R. P.

Basic Principles Example How many dierent Prix Fixe I dinners are possible at Rick's Bistrot Internationale? Unlike the Prix Fixe II dinner problem above, in this case we must count separately the number of dinners possible under the Appetizer + Main Course" option and the number of dinners possible under the Main Course + Dessert" option. Since these options are mutually exclusivewe must choose either one or the other, but not bothwe must apply the Sum Rule to get the total number of possible meals. For the Appetizer + Main Course" option, we apply the Product Rule to nd that there are 5 3 = 15 dierent such meals possible. For the Main Course + Dessert" option, we apply the Product Rule to nd that there are 3 4 = 12 dierent such meals possible. Thus 15 + 12 = 27 PF I dinners are possible. c R. P.

Pigeonhole Principle The pigeonhole principle asserts that if you have n pigeonholes and m pigeons, with m > n, then at least one pigeonhole must contain more than one pigeon. More generally, if you have n pigeonholes and m pigeons, with m > n, then at least one pigeonhole must contain at least m n pigeons. c R. P.

Permutations Denition For any set X, a permutation of X is a one-to-one and onto function f : X X. Remarks If X is a nite set with n elements, then a function f : X X is completely determined by (y 1,..., y n ), an ordered n-tuple of elements of X such that y i = f(x i ) for i = 1,..., n. Moreover, a one-to-one and onto function from X to itself will correspond to such an ordered n-tuple (y 1,..., y n ) such that all the y i are distinct. Thus the number of permutations of a nite set X = {x 1,..., x n } will be exactly the number of ways in the elements x 1,..., x n can be reordered. c R. P.

Permutations More generally, for any positive integer r with 1 r n, we consider the distinct ways in which r elements from the set X = {x 1,..., x n } can be put in order. Such an ordering is called an r-permutation of the set. Fact The number of r-permutations of an n-element set is denoted by P(n, r),and we have P(n, r) = n (n 1) (n r + 1). (3) Remarks The proof is a straightforward application of the Product Rule discussed above. When r = n, we have P(n, n), the number of permutations of an n-element set, and P(n, n) = n!. c R. P.

Permutations Remarks Note that P(n, r) = n (n 1) (n r + 1) n (n 1) 3 2 1 = (n r)(n r 1) 3 2 1 n! = (n r)!. (4) Although (4) gives a satisfying and algebraically useful formula for P(n, r), that formula is computationally almost useless if n is of even moderate size. For example, 69! 1.71122 10 98 and 70! 1.19786 10 100. c R. P.

Permutations Examples Example Suppose the Math Club, which has 20 members, wants to elect four ocers: a president, vice president, secretary, and treasurer. It will be a simple ballot, with the student with the most votes elected president, the next-highest vote getter vice president, and so forth. How many outcomes are possible in such an election? (Assume that there are no ties.) We need to count the number of ways to choosein orderfour students from the twenty club members. Order is important because it determines which specic oces are awarded. So the answer will be P(20, 4) = 20 19 18 17 = 116, 280. c R. P.

Example Now suppose that instead of electing four ocers as above, the Math Club wants to elect a ruling Triumvirate of three members. The students with the three highest vote totals will be elected to the Triumvirate. How many Triumvirates will be possible under such a ballot? (Again assume there are no ties.) We can't use permutations directly here, since the order in which the three students are chosen is not relevant. So let us revisit the process of choosing three students, in order, from among the twenty club members. c R. P.

We can consider the process of choosing 3 students, in order, from among 20 students as a 2-step process: rst choose 3 students from among the 20without regard to orderthen arrange the 3 chosen students in order. We know that there are P(20, 3) = 20 19 18 = 6, 840 ways of choosing the 3 Triumvirate members in order. We also know that there are P(3, 3) = 6 ways of putting any 3 students in order. So now we use the Product Rule backwards.if we denote by C(20, 3) the number of ways of choosing 3 students from among 20 without regarding order, then because we have a two-step process for choosing 3 students from 20 in order, we must have that P(20, 3) = C(20, 3)P(3, 3) (5) 6, 840 = C(20, 3) 6. (6) c R. P.

But now we can solve (6), getting that Remark C(20, 3) = P(20, 3) P(3, 3) = 6, 840 6 = 1, 140. (7) The reasoning we used in this example to compute the number of unordered ways to choose 3 students from among a group of 20 can be used in general to compute the number of unordered ways to choose r items from a total of n items. Denition An r-combination of elements of a set is an unordered selection of r elements from the set. Thus, an r-combination is simply an r-element subset of the set. c R. P.

Denition C(n, r) will denote the number of r-combinations of a set of n distinct elements. Remarks From the comment above, we have that C(n, r) is also the number of r-element subsets of a set of size n. Other notation for C(n, r) includes n C r, C n r, and Mimicking (7) above, we get that ( n r ). P(n, r) C(n, r) = P(r, r) = n! r!(n r)!. = n(n 1) (n r + 1) r! (8) c R. P.

Remark Note that if 1 r n, then C(n, r) = C(n, n r). (9) This is because the number of ways to pick r elements out of an n-element set is the same as the number of ways of leaving n r elements in the set! c R. P.

Fact The Binomial Theorem says that (y + n) m = m r=0 ( ) m y r n m r. (10) r If S = {1,..., m}, we can completely describe an r-element subset T S by asking, in succession, the questions Is x i in T? for i = 1,..., m. Then for T we should have r yesses. And ( ) m r counts the number of yesses. Notice that if we let y = 1 and n = 1 in (10), we'll get m ( ) m 2 m =, (11) r r=0 i.e., that the total number of subsets of S is the sum of the numbers of r-element subsets for each r. c R. P.

Playing Cards In the examples that follow, we will be considering sets of cards taken from a standard deck. (See Figure 1.) The deck consists of four suits"clubs ( ), Spades ( ), Hearts ( ), and Diamonds ( )of 13 ranks or denominations each. Figure 1: Standard Deck of Playing Cards c R. P.

Playing Cards A dealer distributesdeals"ve cards to each player. A player's ve cards is called a hand." The winning hand is the hand that is the rarest, i.e., occurring the least often, among the hands held by the players. So in each of the following examples we will calculate in how many ways the given hand will occur among all of the C(52, 5) = 2, 598, 960 ways of picking 5 cards from a standard deck of 52 cards. c R. P.

Examples Example Find the number of ways a full house can occur. A full house consists of three cards of the same rank and two cards of a dierent rank. (See Figure 2.) Figure 2: Full House c R. P.

Examples To count the number of ways a full house can occur, we consider the construction of that hand in terms of a sequence of steps. Step 1 First pick the rank that is to be tripled. Step 2 Then pick the specic cards in that triple. Step 3 Now pick the rank that is to be paired. Step 4 Finally pick the specic cards in that pair. The requirements of the Extended Product Rule are satised, so we may use that rule to compute the number we seek: ( )( )( )( ) 13 4 12 4 = 13 4 12 6 = 3, 744. 1 3 1 2 c R. P.

Examples Example Find the number of ways a player can be dealt a hand containing two pairs. (See Figure 3.) Figure 3: Two Pairs c R. P.

Examples To count the number of ways a player can be dealt a hand containing two pairs, we consider the construction of that hand in terms of a sequence of steps. Step 1 First pick the two ranks that are to be paired. Step 2 Then pick the specic cards in one of the pairs. Step 3 Now pick the specic cards in the other pair. Step 4 Finally pick the fth card, whose rank must be dierent from the two paired ranks. The requirements of the Extended Product Rule are satised, so we may use that rule to compute the number we seek: ( )( )( )( ) 13 4 4 44 = 78 6 6 44 = 123, 552. 2 2 2 1 c R. P.

Examples Example Find the number of ways a ush can occur. A ush consists of having all ve cards of the same suit. (See Figure 4.) Figure 4: Flush c R. P.

Examples To count the number of ways a ush can occur, we consider the construction of that hand in terms of a sequence of steps. Step 1 First pick the suit that is to occur. Step 2 Then pick the specic cards in that suit. The requirements of the Extended Product Rule are satised, so we may use that rule to compute the number we seek: ( )( ) 4 13 = 4 1, 287 = 5, 148. 1 5 Remark Traditionally, the frequency of ushes does not include straight flushes, i.e., ushes whose cards have consecutive rankse.g., 2, 3, 4, 5, 6. So we must subtract 40 from 5,148 to get 5,108 non-straight ushes. c R. P.

Odds As mentioned above, in poker the rarest handi.e., the hand with the lowest frequency of occurrenceheld by the players wins. So a full house (3,744) beats a ush (5,108) beats two pairs (123,552). Sometimes, however, we want to know the relative rarity of a hand, not just its absolute frequency. We use odds to accomplish this. Denition The odds against an outcome occurring is the number of ways in which the outcome fails to occur divided by the number of ways in which it can occur. c R. P.

Odds Since there are ( 52 5 ) = 2, 598, 960 possible hands of cards, the odds for the specic hands discussed above are: 1. Full house: (2, 598, 960 3, 744)/3, 744 693. We quote this as 693 to 1" or 693:1." 2. Two pairs: (2, 598, 960 123, 552)/123, 552 20, i.e., 20 to 1" or 20:1." 3. Flush: (2, 598, 960 5, 108)/5, 108 508, i.e., 508 to 1" or 508:1." c R. P.