review of chapter 4 - 5. 2 outline random variables –expected value –variance discrete random...
TRANSCRIPT
Review of Chapter 4 - 5
2
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*
3
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
• Continuous random variables
1)( x
xp
1)( dxxp
4
• 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.
5
• Ex 1a. Suppose that X is a continuous random variable whose probability density function is given by
(a) What is the value of C?
(b) Find P(X > 1)
otherwise 0
20 )24()(
2 xxxCxf
8/3
13
22
1)24(
1)( Because (a)
0
232
2
0
2
C
xxC
dxxxC
dxxf
x
x
-
2
1)24(
8
3)()1( )b(
2
1
2
1
dxxxdxxfXP
6
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
• Continuous random variables
• If X lies in between a and b and so its expected value.
x
xxpXE )(][
dxxxfXE )(][
7
• 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
otherwise 0
10 if 2)(
xxxf
3/22)(][1
0
2
dxxdxxxfXE
8
Expectation of Function of Random Variables
• Discrete random variables
• Continuous random variables
• E[aX+b] = aE[X] + b
x
xpxgXgE )()()]([
dxxfxgXgE )()()]([
9
• 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]?
3/1
3
)(][ )a(
1
0
3
1
0
2
22
x
dxx
dxxfxXE
10
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.
11
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:
– cdf is a step function.
• Continuous
ax
xpaF all
)()(
adxxpaFaFPaXP )()()()(
12
Distribution Function
• Obtain distribution function from probability density function.– Discrete distribution
• Differences between steps are the probability value at corresponding points
– Continuous distribution• Integration
13
Compute Probabilities and PDF from Distribution Function - Discrete
4).(2 (d) and
1/2),( (c) 1),( (b) 3),( (a) Compute
3 1
32 12
11
21 3
2
10 2
10 0
)(
bygiven is variablerandom theoffunction on distributi The
XP
XPXPXP
x
x
x
x
x
xF
X
14
12
11)5.2()5.2()3( (a) FXPXP
6/12/13/2)99.0(3/2
)99.0()1(
)1()1()1( (b)
F
XPF
XPXPXP
(c) ( 1/ 2) 1 ( 1/ 2) 1 (1/ 2) 1/ 2P X P X F
12/1)2()4()42( (d) FFxP
15
• Let X be uniformly distributed over (0,1). What is the distribution function of the random variable Y, defined by Y = Xn?
• Distribution function
• Probability density function
Compute Probabilities and PDF from Distribution Function - Continuous
n
nX
n
n
Y
y
yF
yXP
yXP
yYPyF
/1
/1
/1
)(
)(
)(
)()(
10 )/1()( 1/1 yynyf nY
16
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 ippi
nip ini ,,1 ,0 )1()(
17
• 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).
5423 )2(.)8(.)2(.4
5)8(.)2(.
3
5
)5()4()3()3(
XPXPXPXP
18
Poisson Random Variables
• 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.
,...2 ,1 ,0 !
)()( ii
eiXPipi
19
• 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.
7358.!1!0
:1parameter on with DistributiPoisson
7361.)9(.)1(.1
10)9(.)1(.
0
10
: (10,0.1)parameter on with Distributi Binomial
1110
91100
eeee
20
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
5.35.35.3 5.415.31
)1()0(1
)2(1)2( )a(
eee
XPXP
XPXP
5.35.35.3 5.45.3
)1()0()1( )b(
eee
XPXPXP
21
Uniform Distribution
• X is a uniform random variable on the interval (α, β) if its probability function is given by
otherwise 0
if 1
)(
x
xf
1
0
)(
x
xx
x
xF
22
Normal Distribution
X
f(X)
X
f(X)
2 2( ) / 21( )
2xf x e
= Mean of random variable x 2 = Variance = 3.14159…e = 2.71828…
• Bell-shaped & symmetrical
• Random variable has infinite range
• Mean measures the center of the distribution
• Variance measures the spread of the distribution
23
Standard Normal
• Normal distribution with parameter (0, 1), N(0,1), is also called standard normal.
• If X is N(μ, σ2), then Z = (X - μ)/σ is standard normal.
2/2
2
1)( xexf
24
For negative values of x:
For standard normal: P(Z ≤ -x) = P(Z > x)
For X ~ N(μ, σ)
dyex
xx y
2/2
2
1)(
).Φ(by denoted is variablerandom normal
standard a offunction on distributi cumulative The
xxx - )(1)(
)()()()(
aaX
PaXPaFX
25
• 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).
3779.
)6293.1(7486.
3
11
3
2
3
1
3
2
)3
2
3
1(
)3
35
3
3
3
32()52(
)a(
ZP
XPXP
26
8413.)1(
)1(1
)1(
)3
30
3
3()0( )b(
ZP
XPXP
0456.)]2(1[2
)2()2(1
)2()2(
)3
33
3
3()
3
39
3
3(
)3()9()6|3(|
)c(
ZPZP
XP
XP
XPXPXP
27
• 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.
0559.0
)59.1(1
)7)(.3(.450
)3(.4505.150
)7)(.3(.450
)3(.450)5.150(
XPXP
Normal Approximation to the Binomial Distribution
28
Exponential Random Variables
• 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.
0 if 0
0 if )(
x
xexf
x
0 , allfor )()|( tssXPtXtsXP
a
ax
a x
e
e
dxe
aXPaF
1
|
)()( :functionon Distributi
0
0
29
• 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)