Correction Problem 18 Alice and Bob have 2
Correction: Problem 18 Alice and Bob have 2 n+1 FAIR coins, each with probability of a head equal to 1/2
Review n Conditional probability of A given B , P(B)>0 – P(A|B)=P(A∩B)/P(B) – Define a new probability law – Conditional independence n P(A∩C|B)=P(A|B) P(C|B) n Total probability theorem n Bayes’ rule 1 1
1. 6 Counting
Counting n To calculate the number of outcomes n Examples – To toss a fair coin 10 times, what’s the probability that the first toss was a head? – Fair coin 1/2 – To toss a fair coin 10 times, what’s the probability that there was only 1 head? – 1/10? – What about the probability that there are 5 heads? – 1/2? 3 3
The Counting Principle n An r stage process – (a) n 1 possible results at the first stage – (b) For every possible result of the first stage, there are n 2 possible results at the second stage – (c) ni …. . – Total number of possible results : n 1 n 2 … nr (proof by induction) 4 4
The Counting Principle n Example 1 : fair coin toss 3 times – 2 X 2 X 2 = 8 possible outcomes n TTT TTH THT THH HTT HTH HHT HHH n Example 2 : number of subsets of an n-element set S – S={1, 2} n Subsets : Ф, {1}, {2}, {1, 2}, 4=22 subsets – S={1, 2, 3} n Subsets : Ф, {1}, {2}, {1, 2}, {3}, {1, 3}, {2, 3}, {1, 2, 3}, 8=2 3 subsets – The choice of a subset as a sequential process of choosing one element at a time. n n stages, binary choice at each stage – 2 X 2 X 2…X 2 =2 n 5 5
Permutations n Selection of k objects out of n objects (k<=n), order matters – Sequences: 123≠ 321 – K-permutation: the number of possible sequence – Example: number of 3 -letter words using a, b, c or d at most once – 4 X 3 X 2 =24 3 -permutation out of 4 objects 6 6
Permutations (continued) n Selection of k objects out of n objects (k<=n), order matters – k-stages, n 1=n, ni+1= ni-1, … nk= n-k+1 n Counting principle: n(n-1)(n-2)…(n-k+1) – number of permutations of n objects out of n objects (k=n) n n! (0! = 1) 7 7
Combinations n Selection of k objects out of n objects (k<=n), NO ordering – Sets: {1, 2, 3} = {3, 2, 1} – k-combinations: the number of possible different K-element subsets – Example: number of 3 -element subsets of {a, b, c, d}. n {a, b, c} {a, b, d} {a, c, d} {b, c, d} : 4 3 -element subsets n 3 -permutations of {a, b, c, d} = abc, acb, bac, bca, cab, cba, abd, adb, bad, bda, dab, dba, acd, adc, cad, cda, dac, dca bcd, bdc, cbd, cdb, dbc, dcb n k-combinations = k-permutations – Order – Each set (k-combination) is counted k! times in the k-permutation. 8 8
Combinations (continued) n Example 1: 2 -combinations of a 4 -object set {a, b, c, d}. n 4 choose 2 = 4!/(2!2!) =6 n {a, b} {a, c} {a, d} {b, c} {b, d}, {c, d} : 6 2 -element subsets n Example 2: k-head sequences of n coin tosses – – – n=5, k=2 HHTTT HTHTT HTTHT HTTTH THHTT THTHT THTTH TTHHT TTHTH TTTHH HHTTT {1, 2} HTHTT {1, 3}…. TTTHH {4, 5} Number of k-head sequences = number of k-combinations from {1, 2, …n} 9 9
Combinations (continued) n Properties of n_choose_k 10 10
Expansion of (a+b)n n 11 11
Combinations (continued) n Binomial formula – Let p =1/2 12 12
Partitions n Partitions of n objects into r groups, with the ith group having ni objects, sum of ni is equal to n. – Order does not matter within a group, the groups are labeled – Example : partition S={1, 2, 3, 4, 5} into 3 groups n 1 = 2, n 2 =2, n 3 =1 n {1, 2}{3, 4}{5} = {2, 1}{4, 3}{5} n {1, 2}{3, 4}{5} ≠ {3, 4}{1, 2}{5} n Total number of choices (group by group) 13 13
Partitions (continued) n Example : partitions of 4 objects into 3 groups, 2 -1 -1. – – – – 4!/(2!1!1!)=12 {ab}{c}{d} {ab}{d}{c} {ac}{b}{d} {ac}{d}{b} {ad}{b}{c} {ad}{c}{b} {bc}{a}{d} {bc}{d}{a} {bd}{a}{c} {bd}{c}{a} {cd}{a}{b} {cd}{b}{a} 14 14
Summary n k-permutation of n objects n!/(n-k)! – Order matters : 123 ≠ 321 n k-combinations of n objects – Order does not matter : {1, 2, 3} = {3, 2, 1} n Partitions of n objects into r groups, with the ith group having ni objects – Order does not matter within a group, the groups are labeled 15 15
Binomial formula n Toss an unfair coin (p-head, (1 -p)-tail) n times – The outcome is a n-sequence : THHTHT…H – Ω={HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} for n=3 – Group the sequences according to the number of H 16 16
Pascal’s Triangle
- Slides: 18