Assignment 1 Answers
Assignment 1 Answers
Assignment 1 Answers
Problem Sheet #1
1. A fair coin is tossed n times. What is the probability that the difference
between the number of heads and the number of tails is equal to n − 3?
Answer: If you have k heads, the difference between heads and tails is |k − (n −
k)| = |n − 2k|. Since k = 0, 1, · · · , the difference can only take values:
n, n − 2, · · · . Answer is zero.
3. A fair dice is rolled repeatedly till we get at least one 5 and one 6.
What is the probability that we need five rolls?
Answer: Let us calculate the probability that n rolls are needed. Let A be the
event that n rolls are needed and the last one is a 5 and let B be the
event that n rolls are needed and the last is a 6. These are mutually
exclusive and their union is what we want. Let Dk be the event of
getting exactly k 6’s out of n − 1 rolls with the remaining being any of
the other four numbers (other than 5 and 6). Then
k n−1−k
(n−1) 1 4
P (Dk ) = Ck
6 6
The events Dk for different k are mutually exclusive. Their union for
k = 1, · · · , n − 1, gives us the event that there are no 5’s and at least
1
one 6 in the first n − 1 rolls. This, along with a 5 on the next roll, gives
us the event A. Hence we have
n−1
1X
P (A) = P (Dk )
6 k=1
n−1 k n−1−k
1 X (n−1) 1 4
= Ck
6 k=1 6 6
" n−1 k n−1−k n−1 #
1 X (n−1) 1 4 4
= Ck −
6 k=0 6 6 6
" n−1 n−1 #
1 1 4 4
= + −
6 6 6 6
(The above expression is reasonable. The first term in the square brack-
ets is the probability of not getting a 5 in the n − 1 rolls. Out of that
we should remove the possibility of getting only one of the other four
numbers on all n − 1 rolls).
It is easy to see that P (B) would also be the same. Hence the needed
probability is "
n−1 n−1 #
1 5 4
−
3 6 6
Can we do some check for the answer? If we sum the above for n =
2, · · · , ∞, then we should get 1. (Note that we need at least two rolls
to get a 5 and a 6).
Answer: We want to split the required event into union of mutually exclusive
events. Let Bn be the event: ”E occurs before F and n repetions are
needed”. These are mutually exclusive for different n. Union over all
n is the event we want. For Bn to occur E or F should not occur in
the first n − 1 repetitions and on the nth trial E should occur. It is
2
easy to see that P (Bn ) = (1 − P (E ∪ F ))n−1 P (E). Hence the needed
probability is
∞
X P (E)
(1 − P (E ∪ F ))n−1 P (E) =
n=1
P (E) + P (F )
5. Suppose n men put all their hats together in a heap and then each man
selects a hat at random. Show that the probability that none of the n
men selects his own hat is
1 1 1 (−1)n
− + − ···
2! 3! 4! n!
Answer: Let Ei denote the event of ith man getting his own hat. Then P (Ei ) =
(n−1)!
n!
, for all i. This is because, after giving the ith man his hat,
we have (n − 1)! ways of arranging remaining ones. It is easy to see
that P (Ei ∩ Ej ) = (n−2)!
n!
because after giving i and j their hats, we
can arrange the remaining in (n − 2)! ways. By the same argument,
P (Ei ∩ Ej ∩ Ek ) = (n−3)!
n!
Now consider E = E1 ∪ · · · ∪ En . This denotes the event of at least
one of the men getting his own hat. Hence, the probability we want
is (1 − P (E)). We can calculate P (E) using the general formula for
unions.
X XX XXX
P (∪ni=1 Ei ) = P (Ei ) − P (Ei Ej ) + P (Ei Ej Ek ) − · · ·
i i j<i i j<i k<j
6. Suppose there are three special dice, A, B, C which have the following
numbers on their six faces:
A: 1, 1, 6, 6, 8, 8
3
B: 2, 2, 4, 4, 9, 9
C: 3, 3, 5, 5, 7, 7
The dice are fair in the sense that each of the faces have the same
probability of coming up.
(i). Suppose we roll dice A and B. What is the probability that the
number that comes up on A is less than the one that comes up on B?
(ii)Suppose your friend, with whom you go out for dinner often, offers
you the following. At the end of each dinner, you choose any one of the
three dice that you want. She/He would then choose one of the two
dice that are remaining. Then both of you roll your respective dice.
Whoever gets the smaller number would pay for the dinner. Would you
take the offer?
Hence, if you choose A your friend can choose B, if you choose B she/he
can choose C and if you choose C, she/he can choose A to ensure that
you have more than 50% chance of paying for the dinner.
4
Here, p[a|0] denotes the probability of the receiver putting out symbol
a when the symbol transmitted is 0 and similarly for all others. The
transmitter sends the two symbols with probabilities: P [0] = 0.4 and
P [1] = 0.6. Find P [1|a] and P [0|a]. When receiver puts out a what
should we conclude about the symbol sent? We would like to build a
decision device that will observe the receiver output (that is, a, b, or
c) and decide whether a 0 was sent or a 1 was sent. An error occurs
if the decision device says 1 when a 0 was sent or vice versa. Find
a decision rule that minimizes the probability of error. What is the
resulting (minimum) probability of error?
and hence P [0|a] = 1/4. Similarly we can calculate that P [1|b] = 3/7
and P [1|c] = 1/2. Hence, intutively, if we observe a we should say a 1
is sent; if we observe b we should say a zero is sent and when we observe
c we can say either 0 or 1.
Let h : {a, b, c} → {0, 1} denote a decision function (decision device).
That means when we observe a we output h(a) as the bit received. We
want to calculate probability of error for this decision function. For a
decision function h, given we observe a, the probability of error is same
as probability of sent bit being complement of h(a) (given we observe
a). We have
5
and similarly for h∗ (b) and h∗ (c). Thus, h∗ (a) = 1, h∗ (b) = 0 and
h∗ (c) = 0. The probability of error for this decision function is
We can calculate P [a] = P [a|1]P [1] + P [a|0]P [0] etc. This gives us
probability of error to be 0.36.
Note that the optimal decision function here is not unique. If we had
taken h∗ (c) = 1, then also we get the same probability of error.
(2a)k e2a
h(2, k) = .
k!
Now find the probability of s calls in 4 minutes.
6
Now, substituting for h(2, s)
k
X (2a)s e−2a (2a)k−s e−2a
P [k calls in 4 min] =
s=0
s! (k − s)!
k
k
X 1 k!
= e −4a
(2a)
s=0
s!(k − s)! k!
k
1 X
k k!
= e −4a
(2a)
k! s=0 s!(k − s)!
1 (4a)k e−4a
= e−4a (2a)k (1 + 1)k =
k! k!
Answer: Suppose we put 100 + x components in each box. Let p denote the
probability of any component being bad. We have p = 0.05. Assuming
that different components being bad is independent, this is like having
100 + x independent tosses and wanting at most x tails (of a coin with
probability of tails being p).
x
X
(100+x)
P [at most x bad ones] = Ck pk (1 − p)100+x−k
k=0