Combinational Mathematics - I

Similar documents
Combinational Mathematics Part 1

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

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

Topics to be covered

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

Math 166: Topics in Contemporary Mathematics II

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

Finite Math - Fall 2016

Secret Key Systems (block encoding) Encrypting a small block of text (say 128 bits) General considerations for cipher design:

Combinatorial Proofs

Section : Combinations and Permutations

Chapter 2. Permutations and Combinations

Permutations and Combinations

Week 1: Probability models and counting

4.1 Sample Spaces and Events

JIGSAW ACTIVITY, TASK # Make sure your answer in written in the correct order. Highest powers of x should come first, down to the lowest powers.

Counting Methods and Probability

Section 5.4 Permutations and Combinations

Fundamentals of Probability

Math 1111 Math Exam Study Guide

CS1800: Permutations & Combinations. Professor Kevin Gold

Finite Mathematics MAT 141: Chapter 8 Notes

Counting (Enumerative Combinatorics) X. Zhang, Fordham Univ.

Chapter 4: Introduction to Probability

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. C) 1 6

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

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

Mathematical Foundations HW 5 By 11:59pm, 12 Dec, 2015

Section 5.4 Permutations and Combinations

Algebra II- Chapter 12- Test Review

CISC 1400 Discrete Structures

Elementary Combinatorics

Probability. Engr. Jeffrey T. Dellosa.

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

Discrete Structures Lecture Permutations and Combinations

Generalized Permutations and The Multinomial Theorem

CS1800: More Counting. Professor Kevin Gold

This Probability Packet Belongs to:

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

Permutations and Combinations

Unit 6: Probability. Marius Ionescu 10/06/2011. Marius Ionescu () Unit 6: Probability 10/06/ / 22

COUNTING AND PROBABILITY

Advanced Intermediate Algebra Chapter 12 Summary INTRO TO PROBABILITY

Counting. Chapter 6. With Question/Answer Animations

Unit 6: Probability. Marius Ionescu 10/06/2011. Marius Ionescu () Unit 6: Probability 10/06/ / 22

10-1. Combinations. Vocabulary. Lesson. Mental Math. able to compute the number of subsets of size r.

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

Content. 1 Understanding and analyzing algorithms. 2 Using graphs and graph algorithms

Math 1111 Math Exam Study Guide

Probability and Counting Techniques

Name: Section: Date:

Jong C. Park Computer Science Division, KAIST

Math 3201 Unit 3: Probability Name:

Probability Paradoxes

CS1800: Intro to Probability. Professor Kevin Gold

Grade 6 Math Circles Fall Oct 14/15 Probability

Statistics Intermediate Probability

Section The Multiplication Principle and Permutations

Probability. Dr. Zhang Fordham Univ.

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

7.1 Experiments, Sample Spaces, and Events

LAMC Junior Circle February 3, Oleg Gleizer. Warm-up

Bayes stuff Red Cross and Blood Example

MATH 1324 (Finite Mathematics or Business Math I) Lecture Notes Author / Copyright: Kevin Pinegar

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

CS 237 Fall 2018, Homework SOLUTION

Page 1 of 22. Website: Mobile:

STAT Statistics I Midterm Exam One. Good Luck!

More Probability: Poker Hands and some issues in Counting

Here are two situations involving chance:

RANDOM EXPERIMENTS AND EVENTS

Venn Diagram Problems

INDIAN STATISTICAL INSTITUTE

Course Learning Outcomes for Unit V

Independent and Mutually Exclusive Events

Name Instructor: Uli Walther

CHAPTER 8 Additional Probability Topics

3 The multiplication rule/miscellaneous counting problems

PROBABILITY. 1. Introduction. Candidates should able to:

Poker: Probabilities of the Various Hands

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

STAT 430/510 Probability Lecture 3: Space and Event; Sample Spaces with Equally Likely Outcomes

aabb abab abba baab baba bbaa permutations of these. But, there is a lot of duplicity in this list, each distinct word (such as 6! 3!2!1!

PROBABILITY Case of cards

Chapter 1: Sets and Probability

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

Activity 1: Play comparison games involving fractions, decimals and/or integers.

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

The Teachers Circle Mar. 20, 2012 HOW TO GAMBLE IF YOU MUST (I ll bet you $5 that if you give me $10, I ll give you $20.)

Probability. The Bag Model

ECON 214 Elements of Statistics for Economists

With Question/Answer Animations. Chapter 6

Honors Precalculus Chapter 9 Summary Basic Combinatorics

Chapter 8: Probability: The Mathematics of Chance

Contemporary Mathematics Math 1030 Sample Exam I Chapters Time Limit: 90 Minutes No Scratch Paper Calculator Allowed: Scientific

CSE 312 Midterm Exam May 7, 2014

Permutations and Combinations Section

CPCS 222 Discrete Structures I Counting

Chapter 5: Probability: What are the Chances? Section 5.2 Probability Rules

Unit 9: Probability Assignments

Transcription:

Combinational Mathematics - I Jon T. Butler Naval Postgraduate School, Monterey, CA, USA We are here I live here Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 1 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 2 San Francisco Monterey Los Angeles Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 3 Monterey Coast Pacific Grove Monterey Bay Aquarium Naval Postgraduate School Carmel Big Sur Monterey Points of Interest Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 4 Monterey Coast Pacific Grove Purple Ice Plant Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 5 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 6 1

Monterey Bay Acquarium Naval Postgraduate School Hotel Del Monte Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 7 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 8 Carmel Linus Pauling 1901-1993 Clint Eastwood Carmel Mission The only person to win two unshared Nobel Prizes chemistry and peace. He lived in Big Sur. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 9 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 10 Passwords Question? Which of these passwords are strong? 1. 1234 2. tomoko2015 3. p@ssw0rd 4. @1rPlan3 5. $1ngle 6. IgfMUiM2 4% 52% 50% 76% 34% 57% Score: RoboForm Password Meter http://www.passw ordmeter.com/ Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 11 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 13 2

Storing Passwords Storing Passwords Cracking Passwords It is too slow to try to break into a system by trying combinations at the accountpassword page. Hackers prefer to breakin once and steal the whole password file. Then, they can use a supercomputer to try many combinations. Computer Password File 1234 tomoko2015 p@ssw0rd @1rPlan3 $!ngle IgfMUiM2 Plaintext Easy to crack Meiji Univ. 10:30-12:00 October 9, 2015 J. T. Butler Combinatorial Mathematics Part 1 14 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 15 Storing Passwords Storing Passwords Computer Password File #6ag&kP0 Z +jq?xlb62 d= />LpV* :z<)6kxw3 Po7(!X&zJ K,6Q1/8kc Encryption easy to go from plaintext to ciphertext and easy to go from ciphertext to plaintext Harder to crack Computer Password File )?Hk2m3D =8Jc:fF9q #2JK/.Ksz p[=9hbz@ o_+v2wg L*wn;2?sa One-Way Hash easy to go from plaintext to cipher-text but hard from ciphertext to plaintext Very Hard to crack Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 16 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 17 Assume a one-way hash In a brute-force attack, an attacker tries many passwords and sees if any of the hashed forms matches one of the passwords he tried. For each match, he can access that person s account. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 18 Assume a one-way hash If all passwords are 4 digits, then the passwords are 0000 through 9999. There are only 10 4 = 10,000 passwords, and it is easy to try all of them. If the passwords are all 4 lowercase letters, then the passwords are between aaaa and zzzz. Now, there are 26 4 = 456,976 passwords. It is also easy to try all. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 19 3

Hack LinkedIn, a social network website was hacked on June 5, 2012 by Russian hackers. Nearly 6,500,000* user accounts were hacked. The stolen passwords, were encrypted, but were decrypted and posted on a Russian password decryption forum later on that same day. *Recent reports state that 117,000,000 accounts were hacked. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 20 Hack This provides an understanding of how people choose their passwords. 21% use only lowercase letters 44% use lowercase & numbers Thus, 65% choose a combination of lowercase letters and numbers. This is good news for hackers!! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 21 Brute force times to crack all passwords A GPU can do. 20M hashes per second is 20,000,000 passwords per second. A CPU can do. 38 days to crack all 8 character passwords! Dictionaries People usually do not use random characters. Therefore, hackers often use dictionaries to test for patterns. The dictionary can even be the passwords previously hacked in a password file! a A 1 $ Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 22 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 23 Dictionaries + Rules People often leetify dictionary words to produce passwords. s are 1. E or e 3 2. S or s $ 3. A or a @ 4. I or i! 5. Add numbers to the end of words Hackers know these rules and can take dictionary words and apply the rules. How to choose a password 1.Choose random characters with uppercase letters, lower case letters, numbers, and special characters (! @ # $ etc.) 2.Choose long passwords password cracking time goes up exponentially with password length Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 24 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 25 4

How to choose a password 3. Change password and use different passwords for different accounts 4. Use a password manager, like 1password (https://agilebits.com/) or LastPass (https://lastpass.com/). You need only remember one password. All of your passwords are stored on your computer or in the cloud. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 26 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 27 Outline Combinatorial Math Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 28 Outline Combinatorial Math Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 29 Yogi Berra 1925-2015 Yogi Berra played baseball for the New York Yankees in 1946 1963. Yogi Berra He is famous for Yogism s. 1. It is not over, until it is over. 2. Nobody goes there anymore. It is too crowded. 3. Baseball is 90% mental. The other half is physical. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 30 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 31 5

Yogisms for combinatorial mathematics 1. If it is impossible, there are 0 ways to do it. 2. If there is only one way to do it, then the number of ways to do it is 1. 3. There is one way to choose 0 objects from 0 objects. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 32 Outline Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 33 Rule of Sum If one event can occur in m ways and another event can occur in n ways, there are m+n ways exactly one event can occur. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 34 Suppose there are 5 red balls and 3 green balls. Then, there are 5+3 = 8 ways to choose one ball of any color. 1 2 3 4 5 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 35 1 2 3 5 3 8 Outline Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 36 Rule of Product If one event can occur in m ways and another event can occur in n ways, there are m n ways the two events can occur together. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 37 6

Suppose there are 5 red balls and 3 green balls. Then, there are 15 ways to choose one red ball and one green ball. 1 2 3 4 5 1 2 3 1 1 2 1 3 1 4 1 5 1 1 2 2 2 3 2 4 2 5 2 5 3 15 1 3 2 3 3 3 4 3 5 3 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 38 (cont d) Note: When we choose one red and one green ball, order is not important. For example, 1 2 = 2 1 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 39 Your PC has an address register with 24 bits. How many addresses are there? There are 24 bits, each with two values, 0 and 1. By the rule of product, there are 2 2 2 2 = 2 24 = 16,777,216 addresses. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 40 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!. There are n There are There are ways to n-1 ways to n-2 ways to choose the 1 st object. choose the 2 nd object. choose the 3 rd object. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 41 This is n factorial. By the rule of product, P(n,r) = n(n-1)(n-2) (n r+1) = n! (n-r)! This is a permutation of r of n objects. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 42 P(n,r) = n(n-1)(n-2) (n-r+1) can be viewed as a distribution of n balls to r cells, as follows. There are n ways to fill the 1 st cell. There are n-1 ways to fill the 2 nd cell. There are n-2 ways to fill the 3 rd cell. There are n-r+1 ways to fill the r th cell. Note: Some balls may be left over. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 43 7

How many permutations are there of two elements in S = {a,b,c,d}? There are 12 ab, ac, ad, bc, bd, cd, ba, ca, da, cb, db, and dc. That is, n = 4 and r = 2 in P(n,r) = n!/(n-r)! = 12. Remember: In a set S of n distinct objects, a permutation is an arrangement or ordering of objects from S. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 44 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 45 How many ways are there to arrange the three letters in ALL? If all letters were distinct, like AL 1 L 2, there would be 3!=6, by the rule of product. But, two letters are the same! h ALL <=>AL 1 L 2 AL 2 L 1 LAL <=>L 1 AL 2 L 2 AL 1 LLA <=>L 1 L 2 A L 2 L 1 A Therefore, 2! times (the number of arrangements of ALL) = (number of arrangements of AL 1 L 2 ). That is, the number of arrangements of ALL is 3! = 3 2! These are ALL, LAL, and LLA. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 46 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 47 Permuting When There Are Objects of the Same Type If there are n 1 objects of the first type, n 2 objects of the second type,, n r objects of the r th -type, where n = n 1 + n 2 + + n r, then the number of arrangements of all n objects isiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii n! n 1! n 2! n r! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 48 In our previous example, n = 3 n 1 = 1 and n 2 = 2. Therefore, the number of arrangements of the letters of ALL is 3! 1! 2! This is 3. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 49 8

Permuting When There Are Objects of the Same Type n! n 1! n 2! n r! is called a multinomial. n! C(n,r) = r! (n-r)! is a binomial and is the number of ways to choose r from n objects. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 50 Outline Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 51 Circle Permutations If six people, A, B, C, D, E, and F are seated around a round table, how many circle arrangements are possible? A E A A F E B D F B F B = = C C A C E C D B D D (a) (b) (c) (d) (a) and (b) are identical, while (c) and (d) are different. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 52 E F Circle Permutations Choose one person, say A, to be at the top. Then, choose the order of the remaining people in 5! = 120 ways. Thus, the number of circle permutations on 6 objects is 5!. iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 53 Circle Permutations Suppose that A, B, and C are girls, while D, E, and F are boys. We want to arrange them so that boys and girls alternate. How many ways are their to do this? Choose A, a girl to be in the top position. There are 3! ways to arrange the boys and 2! ways to arrange the remaining girls or 3! 2! = 12 ways. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 54 Recall there are 3 ways to arrange ALL We want to count the ways to choose 2 objects from 3. Let L be the chosen objects and A the unchosen object. Thus, the three ways to choose are ALL, LAL, and LLA. The number of ways to choose 2 from 3 objects is iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 3! = 3. 1!2! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 55 9

Recall there are 3 ways to arrange ALL From this, we can observe n! P(n,r) C(C(C(n,r) = ii = r!(n-r)! r! C(C( P(n,r) = ir! C(n,r) The set of permutations is just the set of combinations with all chosen objects permuted in some way. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 56 Outline Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 57 Pascal s Rule By the Rule of Sum C(n,r) = C(n-1,r) + C(n-1,r-1) Pascal s Rule - Consider 4 objects C(4,2) = C(3,2) + C(3,1) = 3 + 3 = 6 Choose r objects from n-1 objects not including a special object or Choose the special object and r-1 objects from n-1 objects not including the special object {b,c}, {b,d}, {c,d} or {a,b}, {a,c}, {a,d} a is the special object Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 58 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 59 Pascal s Triangle Sum 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 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 60 Pascal s Triangle r n 0 Sum Diff. 0 1 1 1 1 1 2 1 1 2 0 2 3 1 2 1 4 0 3 4 1 3 3 1 8 0 4 5 1 4 6 4 1 16 0 5 6 1 5 10 10 5 1 32 0 6 1 6 15 20 15 6 1 64 0 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 61 10

1. If it is impossible, there Pascal s are 0 ways Triangle to do it. (choose 2 objects from 1 - impossible). 3. There is one way to choose 0 objects from 0 objects. r 2. If there is only one n 0 way to do Sum it, then Diff. the number of ways to do 0 1 1 1 1 it is 1 (choose 0 1 2 0 1 1 objects from 21). 0 2 3 1 2 1 4 0 3 4 1 3 3 1 8 0 4 5 1 4 6 4 1 16 0 5 6 1 5 10 10 5 1 32 0 6 1 6 15 20 15 6 1 64 0 Pascal s Triangle Sum Diff. Pascal s Rule 1 1 1 C(3,2) + C(3,1) 1 1 2 0 1 2 1 4 0 = C(4,2) 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 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 62 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 63 Pascal s Triangle This was first published in 1653 by Blaise Pascal (from France). These numbers were known more than a 1000 years earlier. Pascal s version of the triangle. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 64 Outline Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 65 Choice With Repetition Question: In how many ways can you choose r objects from n objects when repetitions are allowed? That is, now one can choose an object 0, 1, 2, 3, etc. times. Before, we could only choose 0 or 1 times. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 66 Choice With Repetition : The number of ways to choose r = 2 objects, with repetition, from n = 3 is 6. Consider {a,b,c}. One can choose 2 objects as follows {a,a}, {a,b}, {a,c}, {b,b}, {b,c}, and {c,c}. The number of ways to choose without repetition is 3, (the blue ways). Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 67 11

Choice With Repetition Answer: A choice of r objects with repetition can be viewed as follows. Consider n + r 1 objects separated by n 1 lines. The non-selected lines represent choices of r objects with repetition. Choice With Repetition Answer: In our example, we had r = 2 and n = 3. So, among n+r-1 = 4 lines choose n-1 = 2 lines. {a,a} {a,b} {b,b} {a,c} {b,c} {c,c} Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 68 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 69 Choice With Repetition Summary: The number of ways to choose r objects from n with repetition is C(n+r 1, n-1) = C(n+r-1,r). Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 70 Outline Introduction Rule of Sum Rule of Product Circle Permutations Pascal s Triangle Choice With Repetition s Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 71 Naming the Ace Paradox It appears to be wrong, but it is not! A Deck of Cards (52 cards) Each card has a 1) number and a 2) suit. 1) Number A K Q J 10 9 8 7 6 5 4 3 2 Ace Jack Queen King 2) Suit Clubs Hearts Spades Diamonds Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 72 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 73 12

A Deck of Cards A K Q J 10 3 2 52 Cards Clubs Spades Diamonds Hearts Definitions 1. To deal 52 cards to 4 people means to randomly give 13 cards to each of 4 people. Usually, the people know only those cards given to them. 2. A hand is a set of 13 cards that one deals to a person. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 74 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 75 Naming the Ace 1. Deal 52 cards to 4 people. One person says I have an ace. What is the probability she/he has another ace? Answer: 5359/14498 < 50%. 2. Deal 52 cards to 4 people. One person says I have an ace of spades What is the probability she/he has another ace? Answer: 11686/20825 > 50%. Naming the Ace Question: Why does naming the ace increase the probability of having another ace? Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 76 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 77 Use a Smaller Set Give 2 cards to each of 2 people Below are the six different hands with two cards 1 4 2 5 3 6 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 78 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 79 13

Naming the Ace Naming the Ace There are 6 ways a person can have a hand of 2 cards, as shown. If someone says, I have an ace, the probability she/he has another ace is 1/5 (there are 5 hands with at least one ace, only one of which has another ace). If she/he says, I have an ace of spades, then the probability she/he has another ace is 1/3. Naming the ace reduces the possibilities, and thus increases the probability! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 80 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 81 Children Paradox Mr. Yamada has two children. At least one is a boy. What is the probability that the other is a boy also? There are four equally likely outcomes Older Boy Boy Girl Girl Younger Boy Girl Boy Girl (impossible) Since only one of three possible outcomes consists of two boys, the probability is 1/3! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 82 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 83 Playing Keno Keno is a game in which you choose 6 numbers from 1 to 80 and the casino chooses 20 numbers from 1 to 80. You enter your choice of numbers for 100 yen. The casino pays you back depending on how many matches occur. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 84 Playing Keno For example, if all 6 of your numbers match numbers chosen by the casino, you win 100,000 yen! Question: What is the probability P(k) that k of the numbers you chose match numbers chosen by the casino? Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 85 14

Playing Keno Playing Keno Number of ways k numbers can match. P(k) = C(80,k)C(80-k,20-k)C(60,6-k) C(80,20)C(80,6) Number of ways casino can choose 20 numbers. Number of ways casino can choose the rest of its numbers. Number of ways person can choose the rest of its numbers. Number of ways person can choose 6 numbers. Exp. the results of an experiment done in a class of 40 students. Each student chose 6 numbers and the teacher choose 20. k P(k) Exp. 0 0.167 0.138 1 0.363 0.278 2 0.308 0.305 3 0.130 0.250 4 0.029 0.028 5 0.003 0.000 6 0.0001 0.000 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 86 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 87 Probability 0.4 0.3 0.2 0.1 0 Playing Keno Probability of matching k numbers 0 1 2 k 3 4 5 6 Probability 0.4 0.3 0.2 0.1 0 Experiment Exact How to Become Rich by Playing Keno You cannot. Spend your money somewhere else. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 88 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 89 Yen Paradox A coin has two sides Heads (H) and Tails (T). In this game, a coin is flipped producing H or T. To play, you pay 100 yen. If it is T, the coin is flipped again. If it is H, you receive some money, as shown on the next slide. Yen Paradox Outcome You receive H TH TTH TTTH TTTTH TTTTTH 100 yen 200 yen 400 yen 800 yen 1600 yen 3200 yen Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 90 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 91 15

Yen Paradox Yen Paradox Of course, if you pay 100 yen, you should play because you will always receive at least 100 yen. However, should you play if it costs 10,000 yen instead of 100 yen? Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 92 You can expect to receive 1 _ 1 _ 1 1 100 + 200 + 400 + 800 + 2 4 8 16 50 + 50 + 50 + 50 + You should pay ANY amount to play!! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 93 Paths in a Chessboard You are here. Go here. Only go EAST or NORTH. How many paths are there? Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 94 Paths in a Chessboard Make 7 EAST moves and 7 NORTH moves. Once you make the EAST moves, the rest are NORTH moves. There are C(14,7) = 3,432 ways to choose the EAST moves. Thus, there are 3,432 different paths. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 95 Birthday Paradox Answer: Compute the probability that no two people among n people will have the same birthday. Birthday Paradox That is, there are 365 n ways n people can have birthdays, but P(365,n) = 365 364 (365-n+1) ways n people can all have different birthdays. Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 96 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 97 16

Birthday Paradox Birthday Paradox Thus, the probability we seek is 365 364 (365-n+1) P(n) = 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 365 n n P(n) 12 0.1670 15 0.2529 18 0.3469 21 0.4437 22 0.4757 23 0.5073 Note: At n = 23, the probability is greater than 50%! Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 98 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 99 Meiji University 10:50-12:30 September 28, 2018 J. T. Butler Combinatorial Mathematics I 101 17