Download Review Chapter4-5

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Probability wikipedia , lookup

Statistics wikipedia , lookup

Randomness wikipedia , lookup

Transcript
Review of Chapter 4 - 5
Outline
• Random Variables
– Expected Value
– Variance
• Discrete Random Variable
– Bernoulli and Binomial
– Poisson
• Continuous Random Variable
– Normal Random Variables
– Exponential Random Variables
– Other continuous distributions*
2
Random Variables
• Real-valued functions defined on sample space.
– The outcomes of coin flips
• the function value is 1 if the outcome is H, and 0 if the outcome is
T.
– The number of heads in three flips of a coin.
• Probability of random variables
• Discrete random variables
 p( x)  1
x
• Continuous random variables



p( x)dx  1
3
• Probabilities of all possible values of X, if X is the
number of heads in three coin flips.
– S = {HHH, HHT, HTH, THH, HTT, THT, TTH,
TTT}.
–
–
–
–
P(X=0) = P{(T,T,T)} = 1/8
P(X=1) = P{(T,T,H), (T,H,T), (H,T,T)} = 3/8
P(X=2) = P{(T,H,H), (H,T,H), (H,H,T)} = 3/8
P(X=3) = P{(H,H,H)} = 1/8
• If X is uniform in [0, 2], what is the probability of a
particular value of X?
– 0
– The frequency of a particular value in [0, 2] is 1/2.
4
• Ex 1a. Suppose that X is a continuous random variable whose
probability density function is given by
 C (4 x  2 x 2 ) 0  x  2
f ( x)  
otherwise
0
(a) What is the value of C?
(b) Find P(X > 1)
(a) Because


-
f ( x)dx  1
2
C  (4 x  2 x 2 )dx  1
0
 2 2 x3 
C 2 x 

3


C  3/8
(b) P( X  1)  

1
x 2
1
x 0
3 2
1
f ( x)dx   (4 x  2 x 2 )dx 
8 1
2
5
Expected Values
• Expected value of random variable X is a weighted
average of the possible values that X can take on,
each value being weighted by the probability that X
assumes it.
• Discrete random variables
E[ X ]   xp( x)
x
• Continuous random variables

E[ X ]   xf ( x)dx

• If X lies in between a and b and so its expected value.
6
• Find E[X] where X is the outcome when we roll a fair
die.
– Since p(1) = p(2) = p(3) = p(4) = p(5) = p(6) = 1/6, we have
– E[X] = 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) =
7/2
– Expected values can be out of the range of the possible
values of the random variable.
• Find E[X] when the density function of X is
2 x if 0  x  1
f ( x)  
 0 otherwise

1

0
E[ X ]   xf ( x)dx   2 x 2 dx  2 / 3
7
Expectation of Function of Random
Variables
• Discrete random variables
E[ g ( X )]   g ( x) p( x)
x
• Continuous random variables

E[ g ( X )]   g ( x) f ( x)dx

• E[aX+b] = aE[X] + b
8
• Let X denote a random variable that takes on any of the values
-1, 0, 1 with respective probabilities
P(X = -1) = .2, P(X = 0) = .5, P(X = 1) = .3
E[X2] = ?
E[X2] = (-1)2(.2) + 02(.5) + 12(.3) = .5
• What is expected value of X2 if X is uniformly distributed over
[0,1]?

(a ) E[ X 2 ]   x 2 f ( x)dx

1
  x 2 dx
0

3 1
x
3
0
 1/ 3
9
Variance
• Variance measures how far apart random variable X
would be from its mean on the average.
• Var(X) = E[(X-μ)2]
• Var(X) = E[X2] – (E[X])2
• Var(aX+b) = a2Var(X)
• Compute variance of a random variable X
– Find the expected value of X
– Find the expected value of X2.
10
Cumulative Distribution Functions
• Cumulative distribution function (cdf), also called
distribution function, is defined on the real numbers
by F(x) = P(X<=x).
– Probability that X is smaller than certain value.
• Every cdf is an increasing function.
– Its limit at negative infinity (to the left) is 0 and its
limit at positive infinity (to the right) is 1.
• Discrete:
F (a) 
 p ( x)
all x  a
– cdf is a step function.
• Continuous
a
P( X  a)  P( F  a)  F (a)   p( x)dx

11
Distribution Function
• Obtain distribution function from probability
density function.
– Discrete distribution
• Differences between steps are the probability value at
corresponding points
– Continuous distribution
• Integration
12
Compute Probabilities and PDF from
Distribution Function - Discrete
The distributi on function of the random variable X is given by
x0
0
1
 2 0  x 1
 2
1 x  2
F ( x)  
3
11 2  x  3
12
 1
3 x
Compute (a) P( X  3), (b) P( X  1), (c) P( X  1/2),
and (d) P(2  X  4).
13
11
(a) P( X  3)  P( X  2.5)  F (2.5) 
12
(b) P( X  1)  P( X  1)  P( X  1)
 F (1)  P( X  0.99)
 2 / 3  F (0.99)  2 / 3  1 / 2  1 / 6
(c) P( X  1/ 2)  1  P( X  1/ 2)  1  F (1/ 2)  1/ 2
(d) P(2  x  4)  F (4)  F (2)  1 / 12
14
Compute Probabilities and PDF from
Distribution Function - Continuous
• Let X be uniformly distributed over (0,1). What is the
distribution function of the random variable Y, defined by Y =
Xn?
• Distribution function
FY ( y )  P(Y  y )
 P( X n  y )
 P ( X  y1 / n )
 FX ( y1/ n )
 y1 / n
• Probability density function
fY ( y)  (1 / n) y1/ n1 0  y  1
15
Bernoulli and Binomial Random
Variables
• Experiments with two outcomes
– H or T
– success or failure
– defective or qualified
• Bernoulli (p): p(0) =1-p, p(1) = p, where p is the
probability that the outcome is a success.
• Binomial (n, p): n Bernoulli trials, where X is the
number of successes that occur in the n trials.
n i
p(i)    p (1  p) n i
i
i  0, 1,, n
16
• A communication channel transmits the digits 0 and 1.
However, due to static, the digit transmitted is incorrectly
received with probability .2. Suppose that we want to transmit
an important message consisting of one binary digit. To reduce
the chance of error, we transmit 00000 instead of 0 and 11111
instead of 1. If the receiver of the message uses majority
decoding, what is the probability that the message will be
wrong when decoded?
• The message is wrong if at least three errors made when
transmitting 5 digits (at least three 0s when 1 is transmitted or
at least three 1s when 0 is transmitted).
• The number of errors made when transmitting 5 digits is
Binomial with parameter (5, .2).
P( X  3)  P( X  3)  P( X  4)  P( X  5)
 5 3
 5 4
2


  (.2) (.8)   (.2) (.8)  (.2)5
 3
 4
17
Poisson Random Variables
p(i)  P( X  i)  e

i
i!
i  0, 1, 2,...
• Poisson random variables are usually used in modeling rare
events, where λ is the average number of occurrances of the
event in certain interval.
• Poisson random variable can be used as an approximation for a
binomial random variable with parameters (n, p) when n is
large and p is small so that np is a moderate size. λ = np.
18
• Suppose that the probability that an item produced by
a certain machine will be defective is .1. Find the
probability that a sample of 10 items will contain at
most 1 defective item.
Binomial Distributi on with parameter (10,0.1) :
10  0
10  1
10
 (.1) (.9)   (.1) (.9) 9  .7361
0
1
Poisson Distributi on with parameter 1 :
e 
0
0!
 e 
1
1!
 e 1  e 1  .7358
19
The monthly worldwide average number of airplane crashes of
commercial airlines is 3.5. What is the probability that there
will be
(a) at least 2 such accidents in the next month
(b) at most 1 accidents in the next month?
Poisson with parameter λ = 3.5
(a ) P( X  2)  1  P( X  2)
 1  P( X  0)  P( X  1)
 1  e 3.5  3.5e 3.5  1  4.5e 3.5
(b) P( X  1)  P( X  0)  P( X  1)
 e 3.5  3.5e 3.5  4.5e 3.5
20
Uniform Distribution
• X is a uniform random variable on the interval
(α, β) if its probability function is given by
 1
if   x  

f ( x)     

otherwise
0
0
 x  
F ( x)  
 
 1
x 
 x
x
21
Normal Distribution
• Bell-shaped & symmetrical
f(X)
• Random variable has
infinite range
• Mean measures the center
of the distribution
• Variance measures the
spread of the distribution
X
1
 ( x   )2 / 2 2
f ( x) 
e
2
 = Mean of random variable x
2 = Variance
 = 3.14159…
e = 2.71828…
22
Standard Normal
• Normal distribution with parameter (0, 1), N(0,1), is
also called standard normal.
1  x2 / 2
f ( x) 
e
2
• If X is N(μ, σ2), then Z = (X - μ)/σ is standard normal.
23
The cumulative distributi on function of a standard
normal random variable is denoted by Φ( x).
1 x  y2 / 2
 ( x) 
e
dy

2 
For negative values of x: ( x)  1  ( x) -   x  
For standard normal: P(Z ≤ -x) = P(Z > x)
For X ~ N(μ, σ)
FX (a)  P( X  a)  P(
X 


a

)  (
a

)
24
• If X is a normal random variable with parameter μ = 3 and σ2 =
9, find (a) P(2 < X < 5); (b) P(X > 0); (c) P(|X-3| > 6).
(a )
P(2  X  5)  P(
23 X 3 53


)
3
3
3
1
2
 P(  Z  )
3
3
2
 1
      
3
 3
2 
 1 
    1   
3 
 3 
 .7486  (1  .6293)
 .3779
25
X 3 03
(b) P( X  0)  P(

)
3
3
 P( Z  1)
 1  (1)
 (1)  .8413
( c)
P(| X  3 | 6)  P( X  9)  P( X  3)
X 3 93
X 3 33

)  P(

)
3
3
3
3
 P( Z  2)  P( Z  2)
 P(
 1   (2)   (2)
 2[1   (2)]  .0456
26
Normal Approximation to the
Binomial Distribution
• When n is large, a binomial random variable with parameter n
and p will have approximately the same distribution as a
normal random variable with the same mean and variance.
• The ideal size of a first-year class at a particular college is 150
students. The college, knowing from past experience that on
the average only 30 percent of those accepted for admission
will actually attend, uses a policy of approving the applications
of 450 students. Compute the probability that more than 150
first-year students attend this college.
 X  450(.3) 150.5  450(.3) 

P( X  150.5)  P

 450(.3)(.7)
450(.3)(.7) 

 1  (1.59)
 0.0559
27
Exponential Random Variables
e x if x  0
f ( x)  
if x  0
0
• The distribution of the amount of time until some specific
event occurs.
– The amount of time until an earthquake occurs.
• Exponential random variables are memoryless.
P( X  s  t | X  t )  P( X  s) for all s, t  0
Distributi on function : F (a)  P( X  a)
a
  e x dx
0
 e x |0a
 1  e  a
28
• Jones figures that the total number of thousands of miles that an auto can be
driven before it would need to be junked is an exponential random variable
with parameter 1/20 (in thousand miles). Smith has a used car that he
claims has been driven only 10,000 miles. If Jones purchases the car, what
is the probability that she would get at least 20,000 additional miles out of
it? Repeat under the assumption that the lifetime mileage of the car is not
exponentially distributed but rather is uniformly distributed over (0,
40,000). How about the assumption is that the lifetime of the car is
normally distributed with parameter (μ = 20,000, σ = 10,000)?
• P(X>20) = 1 - P(X ≤ 20) = e-20*1/20 = e-1 ≈ 0.368
• P(X > 30 | X > 10) = P(X>30) / P(X>10) = (1/4)/(3/4) = 1/3
• P(X > 30 | X > 10) = P(X>30) / P(X>10) = P((X-20)/10)>1) / P((X-20)/10)
> -1) = (Z > 1) / (Z > -1)
29