Discrete Probability n Sample space set S of
Discrete Probability
n Sample space (set) S of elementary event ¨ eg. n An event A is a subset of S ¨ eg. n n The 36 ways of 2 dices can fall Rolling 7 with 2 dices A probability distribution Pr{} is a map from events of S to R Probability Axiom: ¨ ¨ ¨
n n
n A random variable (r. v. ) X is a function from S to R ¨ The event “X = x” is defined as {s S : X(s) = x} ¨ eg. Rolling 2 dices: n n n |S|=36 possible outcomes Uniform distribution: Each element has the same probability 1/|S|=1/36 Let X be the sum of dice Pr{ X = 5 } = 4/36, {(1, 4), (2, 3), (3, 2), (4, 1)} Expected value: Linearity: ¨ X 1: number on dice 1 ¨ X 2: number on dice 2 ¨ X=X 1+X 2, E[X 1]=E[X 2]=1/6(1+2+3+4+5+6)=21/6
Independence n n Two random variables X and Y are independent if
n Indicator random variables ¨ Given a sample space S and an event A, the indicator random variable I{A} associated with event A is defined as:
n E. g. : Consider flipping a fair coin: ¨ Sample space S = { H, T } ¨ Define random variable Y with Pr{ Y=H } = Pr{ Y=T }=1/2 ¨ We can define an indicator r. v. XH associated with the coin coming up heads, i. e. Y=H
n
n The birthday paradox: ¨ How many people must there be in a room before there is a 50% chance that two of them born on the same day of the year? n (1) ¨ Suppose there are k people and there are n days in a year, bi : i-th person’s birthday, i =1, …, k ¨ Pr{bi=r}=1/n, for i =1, …, k and r=1, 2, …, n ¨ Pr{bi=r, bj=r}=Pr{bi=r}.Pr{bj=r} = 1/n 2
¨ ¨ Define event Ai : Person i’s birthday is different from person j’s for j < i ¨ = Pr{Bk-1∩Ak} = Pr{Bk-1}Pr{Ak|Bk-1} where Pr{B 1} = Pr{A 1}=1 ¨ Pr{Bk} ¨ ¨
n (2) Analysis using indicator random variables ¨ For each pair (i, j) of the k people in the room, define the indicator r. v. Xij, for 1≤ i < j ≤ k, by ¨
¨ When k(k-1) ≥ 2 n, the expected number of pairs of people with the same birthday is at least 1 ¨
n Balls and bins problem: ¨ Randomly toss identical balls into b bins, numbered 1, 2, …, b. The probability that a tossed ball lands in any given bin is 1/b ¨ (a) How many balls fall in a given bin? n If n balls are tossed, the expected number of balls that fall in the given bin is n/b ¨ (b) How many balls must one toss, on the average, until a given bin contains a ball? n By geometric distribution with probability 1/b
¨ (c) n n n (Coupon collector’s problem) How many balls must one toss until every bin contains at least one ball? Want to know the expected number n of tosses required to get b hits. The ith stage consists of the tosses after the (i-1)st hit until the ith hit. For each toss during the ith stage, there are i-1 bins that contain balls and b-i+1 empty bins Thus, for each toss in the ith stage, the probability of obtaining a hit is (b-i+1)/b Let ni be the number of tosses in the ith stage. Thus the number of tosses required to get b hits is n=∑bi=1 ni Each ni has a geometric distribution with probability of success (b-i+1)/b → E[ni]=b/b-i+1
Streaks n n n Flip a fair coin n times, what is the longest streak of consecutive heads? Ans: θ(lg n) Let Aik be the event that a streak of heads of length at least k begins with the ith coin flip For j=0, 1, 2, …, n, let Lj be the event that the longest streak of heads has Length exactly j, and let L be the length of the longest streak.
n
n n n We look for streaks of length s by partitioning the n flips into approximately n/s groups of s flips each.
n s s s n n The probability that a streak of heads of length does not begin in position i is
n n
n Using indicator r. v. : ¨ ¨
n If c is large, the expected number of streaks of length clgn is very small. n n n Therefore, one streak of such a length is very likely to occur.
The on-line hiring problem: n To hire an assistant, an employment agency sends one candidate each day. After interviewing that person you decide to either hire that person or not. The process stops when a person is hired. n What is the trade-off between minimizing the amount of interviewing and maximizing the quality of the candidate hired?
What is the best k?
l. Let M(j) = max 1 i j{score(i)}. l. Let S be the event that the best-qualified applicant is chosen. l. Let Si be the event the best-qualified applicant chosen is the i-th one interviewed. l. Si are disjoint and we have Pr{S}= ji=1 Pr{Si}. l. If the best-qualified applicant is one of the first k, we have that Pr{Si}=0 and thus Pr{S}= ji=k+1 Pr{Si}.
n n n n Let Bi be the event that the best-qualified applicant must be in position i. Let Oi denote the event that none of the applicants in position k+1 through i-1 are chosen If Si happens, then Bi and Oi must both happen. Bi and Oi are independent! Why? Pr{Si} = Pr{Bi Oi} = Pr{Bi} Pr{Oi}. Clearly, Pr{Bi} = 1/n. Pr{Oi} = k/(i-1). Why? ? ? Thus Pr{Si} = k/(n(i-1)).
- Slides: 27