CSE390D Notes for Wednesday, 11/13/24
first we finished counting
unordered with repetition:
stars & bars
8 contest winners can pick any of three prizes (a, b, c)
how many prize orders are possible (# of a, b, c)?
a...a|b...b|c...c
stars & bars, (8+2 choose 2)
-------------------------------------------------------------------------------
Permutations of indistinguishable:
theorem:
The number of different permutations of n objects, where there are
n1 indistinguishable objects of type 1, n2 indistinguishable
objects of type 2, ..., and nk indistinguishable objects of type
k, is n! / (n1! * n2! * ... * nk!)
How many different strings can be made by reordering GOOOGLE?
= C(8, 2) * C(6, 4) * C(2, 1) * C(1, 1) = 8!/(2! 4! 1! 1!)
How many strings with 4 A's, 4 B's?
(8 choose 4)
-------------------------------------------------------------------------------
counting summary
w/o repetition with repetition
ordered P(n, r) = n!/(n-r)! n^r
unordered C(n, r) = n!/(r!(n-r)!) (n+r-1)!/(r!(n-1)!)
indistinguishable items (n1, n2, ..., nk):
C(n, n1) * C(n-n1, n2) * ... C(nk, nk)
= n! / (n1! * n2! * ... * nk!)
----------------------------------------------------------------------
Intro to probability
terminology:
experiment: procedure that produces outcomes
sample space: set of all possible outcomes
event: subset of sample space
probability for uniform distribution:
P(E) = |E| / |S|
Probability of:
rolling a 1 with one die? 1/6
rolling an odd with one die? 3/6 = 1/2
flush in Poker (4 choose 1)(13 choose 5)/(52 choose 5)
around 0.002 (0.001981...)
mention poker.pdf on handouts
rolling a 7 with two dice? use loaded dice with class volunteer
then dice.docx, 6/36 = 1/6
grand prize megamillions print "how to play" from website, rotated
also show megamillions.docx
1/[(70 choose 5)(25 choose 1)]
3 + 0 prize megamillions (5 choose 3)(65 choose 2)(24 choose 1)/...
Probability that roll die 10 times and get at least one 6?
E-complement = S - E
P(E-complement) = 1 - P(E)
P(no 6 in 10 rolls) = 5^10/6^10
P(at least 1 6 in 10 rolls) = 1 - (5/6)^10 (around 0.84)
Another way to think of it:
Roll a die once, probability of a 6 is 1/6
Roll again, probability of a 6 is 1/6
so probability of one or other = 1/6 + 1/6 = 2/6 = 1/3
what's wrong?
not disjoint (important term to know)
P(E u F) = P(E) + P(F) - P(E intersect F)
probabilistic equivalent of inclusion/exclusion
P(at least 1 6) = P(1st is 6) + P(2nd is 6) - P(both 6's)
= 1/6 + 1/6 - 1/36 = 11/36
same answer as with previous (complement) technique
use another grid from dice.docx to emphasize
Probability that string of string of length 8 over {A, B} has 4 A's, 4 B's?
(8 choose 4) / 2^8
variation of problem 33 from section 6.3
26 letters = 21 consonants + 5 vowels
probability that length 6 sequences have:
a) exactly one vowel? 5 (vowels) * 6 (positions) * 21^5 (others)
b) exactly two vowels? 5 (vowels) * 5 (vowels) * C(6, 2) (pos) * 21^4
c) at least one vowel? 26^6 - 21^6
d) at least two vowels? 26^6 - 21^6 - (part a)
all divided by 26^6
Stuart Reges
Last modified: Wed Nov 13 15:37:32 PST 2024