Tutorial 10 Solution
Tutorial 10 Solution
Conditional Probability
Conditional Expectation
A Function of Two Random Variables
Conditional Probability and Independence
2
X and Y are discrete RVs
P Y k , X j p X ,Y ( j , k )
pY | X (k | j ) if p X ( j ) 0 ; undefined, otherwise
P X j
pX ( j )
k
pY | X (k | j ) 1
p X ,Y ( j , k ) pY | X (k | j ) p X ( j ) p X ,Y ( j , k ) p X |Y ( j | k ) pY (k )
FY X y x
X ,Y
if f X x 0 and undefined otherwise
fX x
f X ,Y x, y
fY X y x
fX x
Properties of conditional pdf
f X ,Y ( x, y ) f X |Y ( x | y ) fY ( y ) f X ,Y ( x, y ) fY | X ( y | x) f X ( x)
Total probability theorem: fY ( y ) fY | X ( y | x) f X ( x)dx
Bayes Theorem: f X |Y ( x | y ) fY | X ( y | x) f X ( x)
fY | X ( y | x) f X ( x)dx
Example 1
The total number of defects X on a chip is a Poisson random variable
with mean α. Suppose each defect has a probability p of falling in a
specific region R and that the location of each defect is independent
of the others. Let Y be the number of defects inside the region R, and
let Z be the number of defects outside the region.
(a) Find the joint pmf of Y and Z.
(b) Find the conditional pmf of Z given Y. (Hint: !
)
5
Example 1 Solution
X=Y+Z is a Poisson random variable, , for 0,1, …
!
(a) , , , ,
| 1 ,
!
, 0,1, …
(b) ∑ , , ∑ 1
!
∑ 1
! ! ! !
∑
! ! ! !
, , !
,
| | =
!
!
6
Example 2
Suppose that X and Y are continuous random variables whose joint
density is constant in the shaded area shown and zero otherwise.
y
1
0 0.5 1 x
8
Example 2 - Solution
(b)
9
Example 3
10
Solution
(a) pN |T (k | t ) ( t ) k
e t for k {0,1, 2,...}
k!
fT (t ) e t u (t ) where u (t ) is the unit step
Example 3 Solution
11
By the total probability theorem, pN (k ) 0 pN |T (k | t ) fT (t )dt
( t )k t k
pN ( k ) t
0 e
e e dt t k ( ) t
dt for k {0,1, 2,...}
0 k! k!
k 1 k r
Letting r ( )t and dr ( )dt , pN (k ) ( ) k 1 k ! 0 r e dr
It turns out the integral is a gamma function, ( z ) x z 1e x dx z 0
k 1 0
pN (k ) (k 1)
( ) k !
k 1
a)
b)
FY | X y | x P Y y | x P X N y | x P N y X | x
FN | X y x | x FN y x
Example 4 Solution
15
c)
d)
One Function of Two Discrete Random Variables
16
Example 1
Let K and N be independent random variables with nonnegative
integer values.
(a) Find an expression for the pmf of M = K + N.
(b) Find the pmf of M if K and N are binomial random variables
with parameters (k, p) and (n, p)
Function of Two Discrete Random Variables – Example
1 Solution
17
Example 2
Alice and Bob arrive at different queues in the supermarket at the
same time. The time Alice needs to wait (measured in minutes)
follows a geometric distribution with mean 3 minutes and the waiting
time of Bob is also geometrically distributed but with mean 5
minutes. Assume the waiting times of Alice and Bob are independent.
Since they intend to leave together, the longest waiting time of them
max , becomes important.
Note: The range of both and is 1, 2, 3, ⋯ .
(a) Find the cdf of .
(b) Find the pmf of .
(c) Find the value of .
Hint: You may need the following equality:
1
1 , where 0 1.
18
Example 2 Solution
(a) Considering the geometric distribution defined on 1, 2, 3, ⋯, we have
max , , P
2 4
1 1
3 5
2 4 8
1 1
3 5 15
(b) From the results of (a), we have
1
1 2 1 4 7 8
1
3 3 5 5 15 15
(c) From the results of (b), we have
1 2 1 4 7 8
3 3 5 5 15 15
15 41
3 5
7 7
19
Function of Two Continuous Random Variables
20
1 e z z0
FZ z
0 otherwise
21
Function of Two Continuous Random Variables –
Example 1 Solution
22
Function of Two Continuous Random Variables – Example 2
Consider the MTR Tseung Kwan O line starting from North Point towards Po
Lam and LOHAS Park. To operate this line, MTR instituted a “3+1" service
whereby, for every 4 successive trains, the first three run to Po Lam and the fourth
train runs to LOHAS Park. Suppose that the amount of time MTR trains stay at
Tseung Kwan O station is independent and exponentially distributed with a mean
value of 1 minute. Assume the time interval between 2 successive trains begins
when the first train leaves and ends when the next train arrives. Regardless how
long a train stays at Tseung Kwan O station, the time intervals between any 2
successive trains are independent and exponentially distributed with a mean value
of 3 minutes.
(a) Suppose Jack arrives at Tseung Kwan O station when a train just arrived,
however he decides not to take this train. Find the pdf and cdf of the amount
of time he will wait until the next train arrives.
(b) Suppose Jack arrives at Tseung Kwan O station when a train to LOHAS Park
just left. What is the expected value of the amount of time that he will wait
until the next train to LOHAS Park arrives?
(c) Suppose Jack arrives at Tseung Kwan O station when a train just left. Find
the expected value of the amount of time he will wait until the next train to
Po Lam arrives. 23
Function of Two Continuous Random Variables – Example 2
(a) Let denote the amount of time that a train stays at the station, Y denote the time interval
of 2 successive trains, denote the amount of time that the next train will arrive. Therefore,
.
As the mean of exponential distribution is , we can get the pdf of X and Y as:
, 0 , 0
,
0, 0,
Then the joint pdf of and is easy to know since their independence relationship.
1
, , 0, 0
, 3
0,
To compute the cdf of , we should integrate , , over the region
, : , 0, 0
1 1 3
, , 1
3 2 2
Differentiate:
1 1
2 2
24
Function of Two Continuous Random Variables – Example 2 solution
(b) Let denote the amount of time that the next train runs to LOHAS Park will
arrive. Therefore, . Because X and Y are
independent random variables, we can obtain the expected value of as,
. 3 1 4 3 15
(c) Let denote the event that the next train runs to LOHAS Park, denote that
the next train runs to Polam. B denote the waiting time for the next train runs to
Polam.
We can compute that , .
If happens, the expectation of B is | 1 2 3 7,
if happens, the expectation of B is | 3.
Then the expected time he will wait is
| | 4
25