Midterm 2: Sc-215 Probability and Statistics Winter 2012 Duration: 1Hr
Midterm 2: Sc-215 Probability and Statistics Winter 2012 Duration: 1Hr
(1) The arrival frequency of a bus at a station is an exponential random variable with
1
parameter λ = 15 . You arrive at a station at 8:15 am in the morning and by inquir-
ing with the people at the station you come to know that a bus hasn’t arrived for
atleast 15 minutes. What is the probability that you will have to wait for at least an
additional 10 minutes ?
Solution
Let X be the random variable that is the interarrival time between two buses. We
need to compute P (X > 15 + 10|X > 15) which by the memoryless property is
10 3
P (X > 10) = e−λ10 = e− 15 = e− 2
(Note due to the memoryless property the information that the train hasn’t arrived
for atleast 15 mins is redundant).
(2) Information (in the form of bits) is to be sent across a noisy communication channel.
The channel noise is such that if a 0/1 is sent then a bit flip occurs with probability
p and the bit is preserved with probability 1 − p. A scheme is proposed such that if
0/1 is to be communicated then 00000/11111 is transmitted. The receiver applies the
majority rule code to decode the bit (if 3 or more bits are ones/zeros then a one/zero
is concluded) What is the probability of error ? Compute the probability of error for
the specific case where p = 0.1. On an average how many error bits are there per
transmission ?
Solution
A error occurs if out of the 5 bits that are sent (either 00000 or 11111) 3 or more
bits are flipped. Therefore the probability of error when either a 0 or 1 is to be
communicated is
5
X 5 i
Pe = p (1 − p)5−i
i=3
i
Putting p = 0.1 in the above equation we get that the probability of error when the
bit flip probability is 0.1 is
5
X 5
Pe = 0.1i 0.95−i = 0.008551
i=3
i
This is significantly smaller than the 0.1 value if we were transmitting only one bit(of
course at the expense of communicating only 1 bit of information per 5 uses of the
channel).
The number of error bits per transmission is a binomial (n,p) random variable
(with n = 5, p = 0.1). Therefore the average number of errors is np = 5 × 0.1 = 0.5
1
2
pits/transmission.
(3) A dice is rolled continuously till all the numbers occur at least once. Let N be the
random variable that denotes the total number of rolls. Compute E(N ) and Var(N ).
Solution
Let ti be the waiting time for the ith new P6number to appear. We argue similar to
the coupon collecting problem that N = i=1 ti where ti are independent geometric
random variables with parameters pi = 6−i+1 6
. By linearity of expectations E(N ) =
P6
i=1 E(ti ) and using the fact that the expectation of a geometric random variable is
1
p
we get
6 6
X 6 X1
E(N ) = =6
i=1
6−i+1 i=1
i
147
= = 14.7
10
Since ti ’s are independent random variables
6 6
X X qi
V ar(N ) = V ar(ti ) =
i=1
p2
i=1 i
6
X (i − 1)
= 6 2
= 11.99
i=1
(7 − i)
(4) The price of a stock in a days trading is modeled as Sf = Si + K, where Si is the
stock price at the beginning of the day and Sf is the stock price at the end of the
day and K is a Normal random variable with mean 0 and variance 4. What is the
probability that the difference between initial and the final stock price for the day is
more than Rs 3/- ?
Solution
We need to compute P (|Si − Sf | > 3) which is P (|K| > 3) where K is N (0, 4).
P (|K| > 3) = P (K > 3) + P (K < −3)
K−0
Since K is N (0, 4), 2
is N (0, 1). Therefore
K −0 3−0 K −0 −3 − 0
P (K > 3) + P (K < −3) = P ( > ) + P( < )
2 2 2 2
3 −3
= P (Z > ) + P (Z < ) Z ≡ N (0, 1)
2 2
= 1 − Φ(1.5) + 1 − Φ(1.5)
= 2(1 − Φ(1.5))
= 2(1 − 0.9332) = 0.1336
(5) a)Describe the inverse transform method to generate an exponential random variable
with parameter λ.
b) Write an algorithm to generate the random variable X with probability mass func-
tion P (X = 1) = 0.18, P (X = 2) = 0.4, P (X = 3) = 0.22,P (X = 4) = 0.20. What
is E(X)?
3
c)A library gets books via mail. The inter arrival times between mails are exponen-
tial random variables with parameter λ. When a mail arrives the number of books
arrived in that mail is a random number whose distribution is given in part b). Write
an algorithm to compute the expected number of books arrived in the library by
some time T . What answer should you expect?
Solution
a) Given a distribution function FX (x) of a random variable X the inverse transform
method to generate the X has two steps
1. Generate U (U is Uniform (0,1))
2. Set X = FX−1 (U )
For the exponential random variable FX (x) = 1 − e−λx we compute the inverse Let
y = 1 − e−λx , therefore 1 − y = e−λx and log(1 − y) = −λx, so x = log(1−y)
−λ
. Therefore
−1 log(1−x)
FX (x) = −λ . The following function generates GenExp(λ) generates an expo-
nential random variable:
1.Gen U
2.Set X = log(U
−λ
)
1 − U can be replaced by U since both of them are uniform (0,1) random variables)