Upload
iola-sosa
View
43
Download
2
Embed Size (px)
DESCRIPTION
Chapter 7 Expectation. 7.1 Mathematical expectation. 7.1 Mathematical Expectation. Mathematical expectation =expected long run average Simulation 1: toss a fair coin H 1, T 0. n=10 times: 1 0 1 1 1 0 1 1 0 1 Average=0.7. More flips. n=100: - PowerPoint PPT Presentation
Citation preview
Chapter 7 Expectation
7.1 Mathematical expectation
7.1 Mathematical Expectation
Mathematical expectation =expected long run average
Simulation 1: toss a fair coin H1, T0. n=10 times: 1 0 1 1 1 0 1 1 0 1Average=0.7
More flips
n=100: 0 0 0 1 0 0 1 0 1 1 1 1 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0average=0.51
n=10,000, we would expect to get 5000 heads and 5000 tails.
average=0.508
What is the value for expected long run average?
Conjecture: ½
½ probability to get 0, ½ probability to get 1 (½) (0)+ (½) (1)=1/2
Roll a die
With equal probabilities 1/6 x 1 2 3 4 5 6p(x) 1/6 1/6 1/6 1/6 1/6 1/6
Toss 6000 times about 1,000 of each x-value.
1000*(1) 1000*(2) 1000*(3) 1000*(4) 1000*(5) 1000*(6)
1000 1000 1000 1000 1000 10001000 1000 1000 1000 1000 1000
(1) (2) (3) (4) (5) (6)6000 6000 6000 6000 6000 6000
1 1 1 1 1 1(1) (2) (3) (4) (5) (6)
6 6 6 6 6 6(
Mean
xp
) (Not book's notation exactly)
= weighted average of x, weighted by the probability of each possible x value
1=3 3.5
2
x
Roll some moreSome simulations:
Roll n=10 times: 6 5 6 4 6 3 4 1 2 2Average=3.9x<-round(runif(10)*6+0.5)
n=100 1000 10,000 100,000Average 3.56 3.527 3.5008 3.49386
Average 3.49949 3.5
For numerical outcomes
Get x with probability P(x)Values x1 x2 … xk
Prob p1 p2 … pk
P(X1) P(X2) … P(Xk)
Mathematical expectation of X is given byE=E(x)= x1 p1+x2p2+…+ xkpk
= x1 p(x1)+x2p(x2)+…+ xkp(xk)
Raffle ticketx $0 $100p(x) 199/200 1/200
This is the population mean for the population of possible ticket prizes.
199 1( ) ( ) 0*( ) 100*( ) 0.50
200 200E x xp x
0
0
0
100
1 out of every 200 tickets
Example 7.1
Toss a fair coin until a head or quit at 3 tosses Expected tosses needed?X P(x)1 ½ H 2 ¼=(½) (½) TH3 ¼ TTH, TTT
E(X)=(1)(½)+(2)(¼)+(3)(¼)=1.75
If we repeated this experiment over and over, we would average 1.75 tosses.
Example 7.3
Gambling: A and B roll two dice. If A’s number is larger, A wins dollars for the amount he got on the top of the die, otherwise, A loses $3.
Expected gain of A?
Solution
x P(x)-3 21/362 1/36 3 2/364 3/365 4/366 5/36E=7/36
Example
X=# of birds fledged from a nest
x p(x)0 0.21 0.22 0.43 0.2
1.0What is the expected value of x?On average, how many birds are fledged per nest?
( ) ( )
0*0.2 1*0.2 2*0.4 3*0.2
1.6
E x xp x
1
2 2
3
0
20% 0
20% 1
40% 2
20% 3
=1.6