§11.3 Variance, Expected-Value Chabot Mathematics Bruce Mayer, PE

advertisement
Chabot Mathematics
§11.3 Variance,
Expected-Value
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
BMayer@ChabotCollege.edu
Chabot College Mathematics
1
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Review § 11.2
 Any QUESTIONS About
• §11.2 Continuous Probability
 Any QUESTIONS About
HomeWork
• §11.2
→
HW-21
Chabot College Mathematics
2
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
§11.3 Learning Goals
 Compute and use expected value
 Interpret variance
and standard deviation
 Find expected value for
a joint probability
density function
Chabot College Mathematics
3
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Continuous PDF Expected Value
 ReCall DISCRETE Random Variable, X,
Probability P Distribution
X→
P→
x1
p1
x2
p2
x4
p4
…
…
xn
pn
 The EXPECTED VALUE, or average,
by a Weighted Average Calculation
k n
E  X   µ  x1 p1  x2 p2  x3 p3    xn pn   xk pk
k 1
Chabot College Mathematics
4
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Continuous PDF Expected Value
 Compare to the Discrete Case a
CONTINUOUS PDF described by the
Function f(x)
k n
E  X   µ  x1 p1  x2 p2  x3 p3    xn pn   xk pk
and
pk
 pk

k 1
f xk   x
 Then the Expected Value of the PDF
xB


E  X  on A  x  B  lim   xk  f xk   x    x  f x   dx
n 
 n1
 x A
n 
Chabot College Mathematics
5
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Continuous PDF Expected Value
 If the “Averaging” Interval, or Domain,
expands to ±∞
E  X   μ x  



x  f x  dx
 Quick Example: consider the Probability
Distribution Function:
ì0.25(4 - 2x), if 0 £ x £ 2
f (x) = í
, otherwise
î0
Chabot College Mathematics
6
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Continuous PDF Expected Value
 SubStitute the PDF into the Expected
Value Integral
EX   µ 

2

0
 x  f x   dx = ò 0.25x(4 - 2x) dx
= éë0.25(2x - 2 3 x )ùû
0
2
3
2

3
 Thus the Average of the Random
Variable is 2/3
Chabot College Mathematics
7
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
2
Example  CellPh Battery Life
 The battery of a popular smartphone
loses about 20% of its charged capacity
after 400 full charges. Assuming one
charge per day, then the estimated PDF
for the length of tolerable lifespan for a
phone that is t years old →
ì1.12e-1.12t , if 0 £ t
f (t) = í
.
, otherwise
î0
 For this Phone Find the Average
Tolerable LifeSpan
Chabot College Mathematics
8
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  CellPh Battery Life
 SOLUTION:
 The Average Tolerable LifeSpan is
given by the expected value of the
random
variable
T:



E T    t  f t   dt   t 1.12e 1.12t  dt  1.12 t  e 1.12t  dt

0
0
 Integrate by PARTS Using
u t
du

dt
du  dt
Chabot College Mathematics
9
dv  1.12e 1.12t dt
1.12t
dv

e
1.12 dt
 
v  e 1.12t
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  CellPh Battery Life
 Substituting in u & dv




1.12 t
1.12 t
E T   µ   t  e
dt 
0  e
0


1.12t 
e

  0   0   


1
.
12

0


 0  0   11.12 0 1
 1 1.12  0.893
 Thus the CellPh will have average
tolerable lifespan is about 0.893 years
(~326 days).
Chabot College Mathematics
10
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Continuous PDF: Var & StdDev
 ReCall the Variance of a DISCRETE
Random Variable
n
n
Var  X     xk  E  X   pxk    xk  µX   p xk   
2
k 1
 Again using: pk
 Find
2
k 1
 pk

2
f xk  x

 n 

2
2
Var  X   lim   xk  E  X   f  xk   x    x  E  X   f x   dx
n 
 n 1
 
 And Standard Deviation:  X  
Chabot College Mathematics
11
Var  X 
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Simplify Variance Formula
 First Let E(X) = µ
 Then Var  X    x  µ  f x   dx

 Now Expand (Multiply-out) [x−µ]2
2
Var  X  

 x
2

 2µx  µ 2  f x   dx

 Distribute f(x), and Integrate Term-byTerm, noting that µ is a CONSTANT
Var  X  






2
2




x

f
x

dx

2
µ
x

f
x

dx

µ


Chabot College Mathematics
12
 f x  dx
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Simplify Variance Formula
 ReCall a Property 
f  x   dx  1

of ANY PDF:

 Also by DEFINITION 
x  f x   dx  µ  E  X 

for a PDF

 Using the Above in the Var Equation
Var  X  








2
2




x

f
x

dx

2
µ
x

f
x

dx

µ


2
x
  f x  dx 
2µ  µ


Chabot College Mathematics
13
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
 f x  dx
µ 2 1
Simplify Variance Formula
 Simplify the Last Equation
Var  X  




2
2
2


x

f
x

dx

2
µ

µ


2
2


x

f
x

dx

1
µ

 Thus the Simplified Formula
Var  X  

2
2


x

f
x

dx

µ




2
x
  f x  dx 
E  X 2

Chabot College Mathematics
14
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Expected Value
 Consider the Probability Distribution
Function
 x 8 , if 0  x  4
f ( x)  
, otherwise
0
 Then the Expected Value for X
4
x
E ( X )   x  dx
8
0


4
 x 24 0
Chabot College Mathematics
15
3
8 3
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Expected Value
 And the Variance
4
x
2
Var  X    x  dx  8 3
8
0
2
= éë x 32ùû - (8 3)
0
8 9
 Then the Standard Deviation
4
4
2
8
4 2 2
  X   Var  X  


2  0.9428
9
3
9
Chabot College Mathematics
16
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Joint PDF
 Consider X & Y continuous random
variables whose Probability Distribution
Function depends simultaneously on
values of Both x, y; that is
P X , Y  A   f x, y  dx  dy
A
• For any valid Region A defined by a
combination of X & Y
Chabot College Mathematics
17
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Joint PDF Properties
 Joint PDF exhibit the same behavior as
single-variable PDF’s
 In summary, for any valid input Region,
R, for the Joint PDF f(x,y):
1.
f x, y   0 for all
x, y  R

2.
  f x, y  dy  dx  1
 
Chabot College Mathematics
18
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Joint PDF Expected-Value
 Calculate E(X) and E(Y) for the Joint
PDF using the same Weighted-Average
Method as used for Single Variable PDF
EX   
x   y  

x   y  
x  f  x, y   dy  dx
• And the Y version
E Y   
y   x  

y   x  
Chabot College Mathematics
19
y  f x, y   dx  dy
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Joint PDF
 Consider this Joint (BiVariate)
Probability Distribution function
6 xy2
f X ,Y x, y   
0

0  x 1, 0  y 1
otherwise
1. Verify that this is a Valid PDF
2. Calculate P(X ≤ 2 ,Y ≤ ½ )
3. Compute E(X) = µX
4. Compute E(Y) = µY
Chabot College Mathematics
20
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Joint PDF
 Verify PDF
a. For the Given POSITIVE Domains the
function 6xy2 is AlWays NONnegative 
b. Check Integration to One
?
1 
x   y  

x   y  
–

x 0 y 0
6 xy  dy  dx
2
as integration is ZERO outside of the 0≤x,y≤1
domain
Chabot College Mathematics
21
f x, y   dy  dx  
x 1 y 1
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Joint PDF
 Complete Computations
1

y 
x0 y 0 6 xy  dy  dx  x0 6 x  3   dx
0
3
2 1
x 1 
x 1
 2x 
1 
2
   6 x    dx   2 x  dx  


x 0
x 0
3


 2 0 2
x 1 y 1
x 1
2
3
 Thus in this case

x   y  

x   y  
Chabot College Mathematics
22
6 xy  dy  dx  1
2

Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Joint PDF
 Calculate P(X ≤ 2 ,Y ≤ ½ )
x2
y 1 2
x  2 y 1 2
1

2


P X  2, Y    
f
x
,
y

dy

dx

6
xy
 dy  dx



x 0 y 0
2  x   y  

x 1 y 1 2
 
x 0 y 0
x 1 


y 
1 2 
6 xy  dy  dx   6 x    dx   6 x 
  dx
x 0
x

0
3 0
3 0


2
x 1
3
12
3
1
1
1 x 1
1 x 
1 1 1
  6x 
 dx   x  dx      
x 0
83
4 x 0
4  2 0 4 2 8
x 1
2
 Thus P(X ≤ 2 ,Y ≤ ½ ) = 1/8 = 12.5%
Chabot College Mathematics
23
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
12
Example  Joint PDF
 Find E(X) = µX
X  
x   y  

x   y  
x  f  x, y   dy  dx  
x 1 y 1

x 0 y 0
x  6 xy2  dy  dx
1
3
x 1 
x 1
 2 y 

1
2
  6 x    dx   6 x    dx   2 x 2  dx
x 0
x 0
x 0
3 0
3


3
x 1
1
 x 
13 2
E  X   µ X  2   2 
3 3
 3 0
3
 Thus E(X) = µX = 2/3
Chabot College Mathematics
24
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Example  Joint PDF
 Find E(Y) = µY
Y  
y   x  

y   x  
y  f x, y   dx  dy  
y 1 x 1

y 0 x 0
y  6 xy2  dx  dy
1
32
y 1 
y 1
 3 6x 

6

1
3
3
  y 

dy

y


dx

3
y
 dx





y 0
y

0
y

0
2 0
2 


2
y 1
1
 y 
14 3
E  X   µX  3   3 
4 4
 4 0
4
 Thus E(Y) = µY = ¾
Chabot College Mathematics
25
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
WhiteBoard PPT Work
 Problems From §11.3
• P26 → Rat Maze
Chabot College Mathematics
26
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
All Done for Today
Exponential
PDF
Chabot College Mathematics
27
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot Mathematics
Appendix
r  s  r  s r  s 
2
2
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
2a
–
Chabot College Mathematics
28
BMayer@ChabotCollege.edu
2b
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
29
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
30
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
31
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
32
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
33
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
34
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Chabot College Mathematics
35
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
By MuPAD





Uf := int(a*x*E^(-b*x), x)
assume(b, Type::Positive):
U1 := int(a*x*E^(-b*x), x=0..infinity)
U2 := int(a*x*x*E^(-b*x), x=0..infinity)
P := int((1/9)*x*E^(-(1/3)*x), x=5..7)
 Pnum = float(P)
Chabot College Mathematics
36
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-21_sec_11-2_Continuous_PDFs.pptx
Download