Docsity

Probability and Statistics: Expected Values, Random Variables, and Independence, Study notes of Number Theory

Partial preview of the text

Download Probability and Statistics: Expected Values, Random Variables, and Independence and more Study notes Number Theory in PDF only on Docsity!

Probability and Expectation;

Counting with Repetitions.

Zeph Grunschlag

Agenda

More probability

 Random Variables  Independence  Expectation

More counting

 Allowing repetitions  Stars and Bars  Counting solutions to integer inequalities

L19 4

Expectation Motivation

General Idea: Figure out what the expected

outcome is, then act accordingly.

EG: Subway from 116th^ to 34th. Transfer to express at 96th? Suppose (incorrectly) that:

  1. Express is 5 minutes faster from 96 to 34.

  2. One of only two possibilities occurs: a) Wait at 96th^ is 2 minutes, so arrive 3 minutes earlier. Probability of this scenario: 0. b) Wait at 96th^ is 10 minutes, so arrive 5 minutes late. Probability of this scenario: 0.

Expected arrival advantage of transferring is:

3 ·(0.75) - 5·(0.25) = 2.25 - 1.25 = 1 minute Conclusion: Transferring is worthwhile.

Outcomes with Variable

Likelihoods

In the previous definition of probability,

p (E ) = |E | / |S | assumed that all

outcomes were equally likely. Sometimes

can’t assume this. EG:

S = {wait 2 minutes, wait 10 minutes}

First outcome was 3 times as likely as 2nd.

New assumption for set of outcomes S:

 Each outcome s occurs with probability p (s)

 0  p (s)  1

 Sum over S of the probabilities equals 1

Definition of Expectation

DEF: Let X be a random variable on the finite

sample space S. The expected value (or

mean ) of X is the weighted average:

EG: Consider the NYS lottery. Assume:

ticket costs $0. jackpot is $18,000, no taxes, no inflation, no shared winnings consider only first prize

Q: What is the expected net winnings?

s S

E( X ) p ( s ) X ( s )

L19 8

Expectation of NYS Lottery

A: The sample space is {win, lose}

p (win) = 1 / 45,057,474 =

p (lose) = 1 - p (win) =

The random variable for net winnings is

X (win) = 18,000,000 - 0.50 = 17999999.

X (lose) = - 0.

The expected winnings is negative 1 dime:

p (win) · X (win) + p (lose) · X (lose) =

Expectation of NYS Lottery

Detailed Analysis

Expected net winnings. Negative 3.6 cents:

Q: What BIG factor did we forget?

Expectation of NYS Lottery

Bernoulli Trials

A: Forgot about possibility of sharing the jackpot!

Go back to earlier analysis involving only first

prize. Suppose n additional tickets were

sold. We need to figure out the probability

that k of these were winners – call this

probability qk. Jackpot winnings split equally

among all winners so expected win value is:

X (win) =-0.50+18,000,000(q 0 /1+q 1 /2+q 2 /3 + … )

Need a way of computing qk!

Bernoulli Trials

Bernoulli Formula: Consider an experiment

which repeats a Bernoulli trial n times.

Suppose each Bernoulli trial has possible

outcomes A, B with respective probabilities p and 1-p. The probability that A occurs exactly k times in n trials is p k^ · (1-p)^ n-k^ · C (n,k )

Q: Suppose Bernoulli trial consists of

flipping a fair coin. What are A, B, p and 1-p.

Bernoulli Trials

A: A = coin comes up “heads”

B = coin comes up “tails” p = 1-p = ½

Q: What is the probability of getting

exactly 10 heads if you flip a coin 20

times?

Recall: P (A occurs k times out of n)

= p k^ · (1-p)^ n-k^ · C (n,k )

Expectation of NYS Lottery

Bernoulli Trials

Apply formula to NY Lotto:

qk = p k^ · (1-p)^ n-k^ · C (n,k )

= 0.00000002219^ k^ ·0.99999997781^ n-k^ · C (n,k )

Assume that n = 11,800,

NYS Lottery

Best Expectation Calculation

Used these figures to compute qk:

Values become negligible for higher k. Plug into

X (win)=-0.50+18,000,000(q 0 /1+q 1 /2+q 2 /3+ … )

Plugging this back in to above, the most accurate approximation for expected winning is: -7.9¢

k 0 1 2 3 4

qk 0.77 0.20 0.026 0.0023 0.

Events as Random Variables

Notice that in our case we have

E(X ) = sum of X ’ s weighted by probabilities =

X(HH)· p(HH)+X(HT)· p(HT)+X(TH)· p(TH)+X(TT)· p(TT)

=1·¼ + 1·¼ + 1·¼ + 0·¼

= ¾

= |F | / |S | = p(F )

THM: The probability of F is the same as the

expectation of XF. I.e. p (F ) = E(XF).

Therefore: We can view random variables as a

generalization of random events.

Sometimes this can help prove facts about probability.

Sum Rule for Expectations

THM: Suppose X 1 , X 2 , … , Xn are random

variables over the same sample space.

Then:

E(X 1 +X 2 + … +Xn ) = E(X 1 )+ E(X 2 )+ … +E(Xn )

Proof :

RHS

LHS [ ( ) ( ) ( )] ( )

1 2

1 2

  

  

X s p s X s p s X s p s

X s X s X s p s

s S

n s S s S

n s S