Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
HW MATH 461/561 Lecture Notes 15
1
Definition: Suppose that two random variables, either continuous or discrete, X and Y have joint density
f (x, y),
(x, y) ∈ ΛX,Y
and marginal densities
fX (x),
x ∈ ΛX ,
fY (y),
y ∈ ΛY .
The conditional probability density that Y takes on the value y
given that X is equal to x is denoted by fY |x(y) and is given by
fY |x(y) =
f (x, y)
fX (x)
(x, y) ∈ ΛX,Y , x ∈ ΛX
and the conditional probability density that X takes on the value
x given that Y is equal to y is denoted by fX|y (x) and is given by
fX|y (x) =
f (x, y)
fY (y)
(x, y) ∈ ΛX,Y , y ∈ ΛY
Example: In a box, there are 4 white balls, 3 black balls, 2 red
balls. We randomly select 2 balls without replacement. Define
X = {number of white balls}
Y = {number of black balls}
(1) Find density function f (x, y) and marginal densities fX (x) and
fY (y).
(2) Find the conditional probability
P(Y ≤ 1|X = 0).
(3) Find the conditional probability
P(X = 1|Y = 2).
HW MATH 461/561 Lecture Notes 15
2
Solution: (1) We can find
C22
1
P(X = 0, Y = 0) = 9 = ,
C2
36
C13C12
6
P(X = 0, Y = 1) =
=
C29
36
C23
3
P(X = 0, Y = 2) = 9 = ,
C2
36
C14C12
8
P(X = 1, Y = 0) =
=
C29
36
C14C13 12
= ,
P(X = 1, Y = 1) =
C29
36
C24
6
P(X = 2, Y = 0) = 9 =
C2
36
Dist. and marginal dists table
Y \X 0
1
2
fY (y)
0
1
36
8
36
6
36
15
36
1
6
36
12
36
0
18
36
2
3
36
0
0
3
36
fX (x)
10
36
20
36
6
36
(2)
f (0, 1)
6/36
=
= 3/5
fX (0)
10/36
f (0, 0)
1/36
fY |0(0) =
=
= 1/10
fX (0)
10/36
fY |0(1) =
Thus,
P(Y ≤ 1|X = 0) = fY |0(0) + fY |0(1) = 3/5 + 1/10 = 7/10.
P(X = 1|Y = 2) = fX|2(1) =
f (1, 2)
0
=
=0
fY (2)
3/36
HW MATH 461/561 Lecture Notes 15
3
Example: Given the joint pdf
f (x, y) = 2e−(x+y)
0 < x < y,
Find
(a) P(Y < 1|X = 1/2)
(b) P(Y < 1|X < 1)
Solution: (a) Since
Z
fX (x) =
∞
2e−xe−y dy = 2e−2x
x>0
x
Thus,
1
f ( 21 , y) 2e−(y+ 2 )
1
−y+ 12
fY | 1 (y) =
<y
=
=
e
,
1
2
2
fX ( 12 )
2e−2( 2 )
Z 1
√ −y 1
1 −y
1
2
P(Y < 1|X = 1/2) =
e dy = − ee | 1 = 1 − √
1
2
e
2
(b) Since
Z
P(X < 1) =
1
2e−2xdx = 1 − e−2 = 1 − 0.135 = 0.865
0
R1 Ry
P(X < 1, Y < 1) = 0 dy[ 0 2e−(x+y)dx]
R1
= 0 dy{2e−y [−e−x|y0 ]}
R 1 −y
= 0 {2e − 2e−2y }dy
= 1 − 2/e + e−2 = 0.39957
0.39957
= 0.46193
0.865
Intuitively, a mean or an expected value of a rv X is X’s central
tendency or average.
Definition:
P(Y < 1|X < 1) =
HW MATH 461/561 Lecture Notes 15
4
Given a discrete random variable X with range space Λ = {x1,· · · ,
xn} and the distribution table.
The distribution table of r.v X
X
x1
x2
p(x) p(x1) p(x2)
···
xn
···
p(xn)
The mean or expected value of X is defined by
µ = E(X) =
n
X
xip(xi)
i=1
Example: In a class A, there are total 20 students. The students’
scores of the final exam are divided into five categories. Let X
be a rv which associates each student’s score of the final exam
with a specified category. X has following distribution table:
X
1
2
3
4
5
p(x) 3/20 6/20 3/20 3/20 5/20
Find the average category of the students’ scores of the final
exam.
Solution:
E(X) = 1 × 3/20 + 2 × 6/20 + 3 × 3/20 + 4 × 3/20 + 5 × 5/20 = 3.05
Example: A company has five applicants for two positions: two
women and three men. Suppose that the five applicants are
equally qualified and that no preference is given for choosing
either gender. Let X equal the number of women chosen to fill
the two positions.
HW MATH 461/561 Lecture Notes 15
5
(a) Find the probability distribution of X;
(b) Find the average number of women who will be hired.
Solution: (a). The sample space
Ω = {ω1 = {M1M2}, ω2 = {M1M3}, ω3 = {M2M3},
ω4 = {W1M1}, ω5 = {W1M2}, ω6 = {W1M3}, ω7 = {W2M1},
ω8 = {W2M2}, ω9 = {W2M3}, ω10 = {W1W2}}
and the range space
Λ := {x1 = 0, x2 = 1, x3 = 2}.
p(x1) = p(0) = P(X = 0)
= P({ω1, ω2, ω3})
= P({{M1M2}, {M1M3}, {M2M3}})
=
3
10 ,
p(x2) = p(1) = P(X = 1) = P({ω4, ω5, ω6, ω7, ω8, ω9})
= P({{W1M1}, {W1M2}, {W1M3}, {W2M1}, {W2M2}, {W2M3}})
=
6
10 ,
p(x3) = p(2) = P(X = 2) = P({ω10 = {W1W2}}) =
1
10 .
HW MATH 461/561 Lecture Notes 15
6
Therefore,
The distribution table of r.v X
X
0
1
2
p(x) 3/10 6/10 1/10
(b)
µ = E(X) =
P
xi ∈Λ xi p(xi )
= 0(3/10) + 1(6/10) + 2(1/10) = 8/10.
Definition:
Given a continuous random variable X with range space Λ and
the density function: f (x), x ∈ Λ. The mean or expected value of
X is defined by
Z
µ = E(X) =
xf (x)dx
Λ
Example: Let X be a rv which represents the lifetime of a bulb.
X has pdf f (x) = λe−λx, x > 0, where λ > 0 is a constant. Find the
average lifetime of a bulb.
Solution: Using integration by part, we can get
R∞
µ = E(X) = 0 λxe−λxdx
= 1/λ
Theorem: Let X1, · · · , Xn be rv’s for which E(Xi) < ∞, i = 1, 2, · · · , n
and a1, · · · , an be constants. Then,
E(a1X1 + · · · + anXn) = a1E(X1) + · · · + anE(Xn)
Theorem: (1) Let X be a discrete rv with range space Λ =
{x1,· · · , xn} and the distribution table.
HW MATH 461/561 Lecture Notes 15
7
The distribution table of r.v X
X
x1
x2
p(x) p(x1) p(x2)
···
xn
···
p(xn)
Let g be a function such that
X
|g(xi)|p(xi) < ∞
xi ∈Λ
The mean of g(X) is given by
Eg(X) =
n
X
g(xi)p(xi)
i=1
(2) Let Y be a continuous rv with range space Λ and the density
function: h(y), y ∈ Λ. Let g be a function such that
Z
|g(y)|h(y)dy < ∞
y∈Λ
The mean of g(Y ) is given by
Z
Eg(Y ) =
g(y)h(y)dy
Λ
HW MATH 461/561 Lecture Notes 15
8
Theorem: If X and Y are two independent rv’s and E(X) <
∞,E(Y ) < ∞, then, we have
E(XY ) = E(X)E(Y ).
Example: Let X, Y be two independent rv’s with density functions :
fX (x) = 2x,
0<x<1
and
fY (y) = 1/2
0<y<2
Find E(2X − 3Y )2 = E[(2X − 3Y )2].
Solution: Since (2X − 3Y )2 = 4X 2 − 12XY + 9Y 2, we have
E(2X − 3Y )2 = 4E(X 2) − 12E(X)E(Y ) + 9E(Y 2).
Since
Z
1
x2xdx = 2/3
E(X) =
0
2
Z
y(1/2)dy = 1
E(Y ) =
0
Z
2
E(X ) =
1
x22xdx = 1/2
0
2
Z
E(Y )
2
y 2(1/2)dy = 4/3
0
Thus,
E(2X − 3Y )2 = 4(1/2) − 12(2/3)1 + 9(4/3) = 6
Definition:
Given a discrete random variable X with range space Λ = {x1,· · · ,
xn} and distribution table as follows:
HW MATH 461/561 Lecture Notes 15
9
The distribution table of r.v X
X
x1
x2
···
xn
p(x) p(x1) p(x2)
···
p(xn)
P
Let µ = E(X) = ni=1 xip(xi) be its mean. Then, the variance of X
is denoted by σ 2 or Var(X), is defined by
X
2
2
Var(X) = σ = E(X − µ) =
(xi − µ)2p(xi)
xi ∈Λ
The standard deviation of X is defined as σ =
√
σ2.
Remark: The variance of a rv X is a measurement to indicate
the dispersion of the distribution of X.
Example: A company has five applicants for two positions: two
women and three men. Suppose that the five applicants are
equally qualified and that no preference is given for choosing
either gender. Let X equal the number of women chosen to fill
the two positions.
Find the mean and standard deviation of X.
Solution: The sample space
Ω = {ω1 = {M1M2}, ω2 = {M1M3}, ω3 = {M2M3},
ω4 = {W1M1}, ω5 = {W1M2}, ω6 = {W1M3}, ω7 = {W2M1},
ω8 = {W2M2}, ω9 = {W2M3}, ω10 = {W1W2}}
and the range space
Λ := {x1 = 0, x2 = 1, x3 = 2}.
HW MATH 461/561 Lecture Notes 15
10
p(x1) = p(0) = P(X = 0)
= P({ω1, ω2, ω3})
= P({{M1M2}, {M1M3}, {M2M3}})
=
3
10 ,
p(x2) = p(1) = P(X = 1) = P({ω4, ω5, ω6, ω7, ω8, ω9})
= P({{W1M1}, {W1M2}, {W1M3}, {W2M1}, {W2M2}, {W2M3}})
=
6
10 ,
p(x3) = p(2) = P(X = 2) = P({ω10 = {W1W2}}) =
1
10 .
Therefore,
The distribution table of r.v X
x
0
1
2
p(x) 3/10 6/10 1/10
The mean is
µ = E(X) =
P
xi ∈Λ xi p(xi )
= 0(3/10) + 1(6/10) + 2(1/10) = 8/10.
The variance of X is
2
2
σ = E[(X − µ) ] =
P
xi ∈Λ (xi
− µ)2p(xi)
= (0 − 8/10)2(3/10) + (1 − 8/10)2(6/10) + (2 − 8/10)2(1/10) = 0.36
and
√
σ=
σ 2 = 0.6
HW MATH 461/561 Lecture Notes 15
11
Definition:
Given a continuous random variable X with density function
f (x),
x ∈ Λ.
R
Let µ = E(X) = Λ xf (x)dx be its mean. Then, the variance of X
is denoted by σ 2 or Var(X), is defined by
Z
Var(X) = σ 2 = E(X − µ)2 =
(x − µ)2f (x)dx
x∈Λ
The standard deviation of X is defined as σ =
√
σ2.
Theorem: Let X be a rv, discrete or continuous, have mean µ
and finite E(X 2). Then,
Var(X) = σ 2 = E(X − µ)2 = E(X 2) − µ2
Theorem: Let X be a rv, discrete or continuous, and a, b be two
constants. Then,
Var(aX + b) = a2Var(X)
Theorem: Let X1, · · · , Xn be independent rv’s, discrete or continuous. Then,
Var(X1 + · · · + Xn) = Var(X1) + · · · + Var(Xn)
Example: Let X,Y be two independent rv’s with following pdf ’s:
fX (x) = 2x,
0<x<1
fY (y) = 6y 5,
0<y<1
Find Var(7X + 8Y ).
Solution:
Z
E(X) =
0
1
x2xdx = 2/3x3|10 = 2/3
HW MATH 461/561 Lecture Notes 15
12
Z
1
y6y 5dy = 6/7x7|10 = 6/7
E(Y ) =
0
Var(7X + 8Y ) = Var(7X) + Var(8Y )
= 72Var(X) + 82Var(Y )
= 49(EX 2 − 4/9) + 64(EY 2 − 36/49)
Since
Z
2
1
x22xdx = 1/2
EX =
EY 2 =
Z
0
1
x26x5dx = 3/4
0
Thus,
Var(7X + 8Y ) = 49(EX 2 − 4/9) + 64(EY 2 − 36/49)
= 49(1/2 − 4/9) + 64(3/4 − 36/49) = 3265/882
Theorem: Let X be a rv with binomial distribution b(n, p). Then,
µ = E(X) = np and Var(X) = np(1 − p).
Example: Using
Var(X1 + · · · + Xn) = Var(X1) + · · · + Var(Xn)
if X1, · · · , Xn are independent, prove above theorem.
Example: Let X1, · · · , X100 be independent rv’s and each with
binomial distribution b(10, 1/3). Find
100
1 X
Xi}
E{
100 i=1
and
Var(
1
100
P100
i=1 Xi )