Top Banner
nite probability space (sample sp tion P: R + (probability distribut P(x) = 1 x
42

Finite probability space set (sample space) function P: R + (probability distribution) P(x) = 1 x

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Finite probability space

set (sample space)function P: R+ (probability distribution)

P(x) = 1x

Page 2: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Finite probability space

set (sample space)function P: R+ (probability distribution)

elements of are called atomic eventssubsets of are called events

probability of an event A is

P(x)xA

P(A)=

P(x) = 1x

Page 3: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Examples

1. Roll a (6 sided) dice. What is the probability that the number on the dice is even?

2. Flip two coins, what is the probability thatthey show the same symbol?

3. Flip five coins, what is the probability thatthey show the same symbol?

4. Mix a pack of 52 cards. What is the probability that all red cards come before all black cards?

Page 4: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Union bound

P(A B) P(A) + P(B)P(A1 A2 … An) P(A1) + P(A2)+…+P(An)

Page 5: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Union bound P(A1 A2 … An) P(A1) + P(A2)+…+P(An)

Suppose that the probability of winning ina lottery is 10-6. What is the probability thatsomebody out of 100 people wins?

Ai = i-th person wins

somebody wins = ?

Page 6: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Union bound P(A1 A2 … An) P(A1) + P(A2)+…+P(An)

Suppose that the probability of winning ina lottery is 10-6. What is the probability thatsomebody out of 100 people wins?

Ai = i-th person wins

somebody wins = A1A2…A100

Page 7: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Union bound P(A1 A2 … An) P(A1) + P(A2)+…+P(An)

Suppose that the probability of winning ina lottery is 10-6. What is the probability thatsomebody out of 100 people wins?

P(A1A2…A100) 100*10-6 = 10-4

Page 8: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Union bound P(A1 A2 … An) P(A1) + P(A2)+…+P(An)

Suppose that the probability of winning ina lottery is 10-6. What is the probability thatsomebody out of 100 people wins?

P(A1A2…A100) 100*10-6 = 10-4

P(A1A2…A100) = 1–P(AC

1 AC2… AC

100) =1-P(AC

1)P(AC2)…P(AC

100)=1-(1-10-6)100 0.99*10-4

Page 9: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Independence Events A,B are independent if

P(A B) = P(A) * P(B)

Page 10: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Independence Events A,B are independent if

P(A B) = P(A) * P(B)

“observing whether B happened gives no information on A”

B

A

Page 11: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Independence Events A,B are independent if

P(A B) = P(A) * P(B)

“observing whether B happened gives no information on A”

B

AP(A|B) = P(AB)/P(B)conditional probability of A, given B

Page 12: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Independence Events A,B are independent if

P(A B) = P(A) * P(B)

P(A|B) = P(A)

Page 13: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Examples

Roll two (6 sided) dice. Let S be their sum. 1) What is that probability that S=7 ? 2) What is the probability that S=7, conditioned on S being odd ? 3) Let A be the event that S is even and B the event that S is odd. Are A,B independent? 4) Let C be the event that S is divisible by 4. Are A,C independent? 5) Let D be the event that S is divisible by 3. Are A,D independent?

Page 14: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Examples

A

BC

Are A,B independent ?Are A,C independent ?Are B,C independent ?Is it true that P(ABC)=P(A)P(B)P(C)?

Page 15: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Examples

A

BC

Are A,B independent ?Are A,C independent ?Are B,C independent ?Is it true that P(ABC)=P(A)P(B)P(C)?

Events A,B,C are pairwise independent but not (fully) independent

Page 16: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Full independence

Events A1,…,An are (fully) independentIf for every subset S[n]:={1,2,…,n}

P ( Ai ) = P(Ai)iS iS

Page 17: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings

Alice: A = 0001110100010101000111

Bob : B = 0001110100010101000111

slow network

QUESTION: Is A=B?

n-bits

n-bits

Page 18: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings

slow network

QUESTION: Is A=B?

Alice: A = 0001110100010101000111 Bob : B = 0001110100010101000111

n-bitsn-bits

Protocol: 1. Alice picks a random prime p n2. 2. Alice computes a:=(A mod p), and sends p and a to Bob. 3. Bob computes b:=(B mod p), and checks whether a=b.

Page 19: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings

Protocol: 1. Alice picks a random prime p n2. 2. Alice computes a:=(A mod p), and sends p and a to Bob. 3. Bob computes b:=(B mod p), and checks whether a=b.

How many bits are communicated?

Page 20: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings

Protocol: 1. Alice picks a random prime p n2. 2. Alice computes a:=(A mod p), and sends p and a to Bob. 3. Bob computes b:=(B mod p), and checks whether a=b.

What is the probabilty of failure?

Page 21: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings

Protocol: 1. Alice picks a random prime p n2. 2. Alice computes a:=(A mod p), and sends p and a to Bob. 3. Bob computes b:=(B mod p), and checks whether a=b.

What is the probabilty of failure?

BAD EVENT = p divides A-B

Page 22: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings What is the probabilty of failure?

BAD EVENT = p divides A-B

How many (different) primes can divide an n-bit number?

How many primes n2 are there?

Page 23: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings What is the probabilty of failure?

BAD EVENT = p divides A-B

How many (different) primes can divide an n-bit number?

2n M=p1p2…pk 2k k n

How many primes n2 are there?

Prime Number Theorem (m) m/ln m

number of primes m

Page 24: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Testing equality of strings

If A=B then the algorithm always answers YES

If AB then the algorithms answers NO with probability 1- (ln n)/n

Monte Carlo algorithm with 1-sided error

Page 25: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Random variable

set (sample space)function P: R+ (probability distribution)

P(x) = 1x

A random variable is a function Y : RThe expected value of Y is

E[X] := P(x)* Y(x) x

Page 26: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Examples

Roll two dice. Let S be their sum.

If S=7 then player A gives player B $6otherwise player B gives player A $1

2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12

Page 27: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Examples

Roll two dice. Let S be their sum.

If S=7 then player A gives player B $6otherwise player B gives player A $1

2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12

-1 , -1,-1 ,-1, -1, 6 ,-1 ,-1 , -1 , -1 , -1

Expected income for B E[Y] = 6*(1/6)-1*(5/6)= 1/6

Y:

Page 28: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Linearity of expectation

E[X Y] E[X] + E[Y]E[X1 X2 … Xn] E[X1] + E[X2]+…+E[Xn]

Page 29: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Linearity of expectation

Everybody pays me $1 and writes their name on a card. I mix the cards and give everybody one card. If you get backthe card with your name – I pay you $10.

Let n be the number of people in the class.For what n is the game advantageous for me?

Page 30: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Linearity of expectation

Everybody pays me $1 and writes their name on a card. I mix the cards and give everybody one card. If you get backthe card with your name – I pay you $10.

X1 = -9 if player 1 gets his card back 1 otherwise

E[X1] = ?

Page 31: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Linearity of expectation

Everybody pays me $1 and writes their name on a card. I mix the cards and give everybody one card. If you get backthe card with your name – I pay you $10.

X1 = -9 if player 1 gets his card back 1 otherwise

E[X1] = -9/n + 1*(n-1)/n

Page 32: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Linearity of expectation

Everybody pays me $1 and writes their name on a card. I mix the cards and give everybody one card. If you get backthe card with your name – I pay you $10.

X1 = -9 if player 1 gets his card back 1 otherwise X2 = -9 if player 2 gets his card back 1 otherwise

E[X1+…+Xn] = E[X1]+…+E[Xn] = n ( -9/n + 1*(n-1)/n ) = n – 10.

Page 33: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Expected number of coin-tosses until HEADS?

Page 34: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Expected number of coin-tosses until HEADS?

1/2 1 1/4 21/8 31/16 4….

n.2-n = 2

n=1

Page 35: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Expected number of coin-tosses until HEADS?

S

S= 1 + ½*S

S=2

Page 36: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Expected number of dice-throws until you get “6”

S

Page 37: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Expected number of dice-throws until you get “6”

S

S= 1 + (5/6)*S

S=6

Page 38: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Coupon collector problem

n coupons to collect

What is the expected number of cereal boxes that you need to buy?

Page 39: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Expected number of coin-tosses until 3 consecutive HEADS?

Page 40: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Markov’s inequality

A group of 10 people have average income $20,000. At most how many people in the group can have average income at least $40,000?

A group of 10 people have average income $20000. At most how many people in the group can have average income at least $100,000?

Page 41: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Markov’s inequality

A group of 10 people have average income $20,000. At most how many people in the group can have average income at least $40,000?

Let X be a random variable such that X 0.Then

P(X a*E[X]) 1/a

Page 42: Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x

Example Alice has an algorithm A which runs inexpected running time T(n).

Bob uses Alice’s algorithm to constructhis own algorithm B. 1. Run algorithm A for 2T(n) steps. 2. If A terminates then B outputs the same, otherwise goto step 1.

What is the expected running time of B?What is the probability that A terminates after 100T(n) steps?What is the probability that B terminates after 100T(n) steps?