Practice Sheet 1
Practice Sheet 1
2. Sum of samples
An urn contains n balls numbered 1,2,...,n. We remove k balls at random (without replacement)
and add up their numbers. Find the expected value of this final number.
3. Surviving couples
Of the 2n people in a given collection of n couples, exactly m die. Assuming that the m have been
picked at random, find the expected number of surviving couples.
4. Magnet blocks
A total of n bar magnets are placed end to end in a line with random independent orientations.
Adjacent like poles repel, ends with opposite polarities join to form blocks. Find the expected
number of blocks of joined magnets.
5. Stick break
Given a stick with n joints. The stick is dropped from certain height. During the fall, each joint
breaks with probability p independent of other joints. What is the expected number of pieces into
which the stick breaks ?
6. Memoryless Guessing
To amaze your friends, you have them shuffle a deck of n cards and then turn over one card at
a time. Before each card is turned over, you predict its identity. Unfortunately, you don’t have
any particular psychic abilities - and you are not good at remembering what has been turned over
already- so your strategy is simply to guess a card uniformly at random from the deck. What is
the expected number of correct predictions that you would make with this strategy ?
1
9. Two urns with white and black balls
Urn 1 contains 1933 white and 2067 black balls, while urn 2 contains 191 white and 167 black balls.
43 balls are randomly selected from urn 1 and are then put in urn 2. If 46 balls are then randomly
selected from urn 2, compute the expected number of white balls in the trio.
(a) Find the conditional probability that bin 1 has one ball given that exactly one ball fell into
the first three bins.
(b) Find the conditional probability that the number of balls in bin 1 is 2 under the condition that
bin 2 received n/2 balls.
(c) What is the conditional probability that nth bin is empty given that the bins numbered 1 to
n/2 are empty ?
• Let Xi be the random variable which denote the number of balls choosing ith bin. Are
therandom variables Xi ’s independent ?
• Let Yi be the random variable which denotes the destination bin for ith ball. Are the
randomvariables Yi ’s independent ?
14. Recall Frievald’s algorithm for checking equality A × B = C. We selected a random {0,1}-vector:
each entry was selected randomly uniformlyindependently from {0, 1}. The error probability was
bounded by 2 essentially because there were 2 choices. What is wrong with the following arguments
?
Select a random vector wherein each entry is a real number selected randomly uniformly and in-
dependently from [0, 1]. The error probability of the algorithm will be 0. In this manner we get
adeterministic algorithm for the problem !
2
Let S be the set of elements for which we wish to build a binary search tree. Build the tree
incrementally as follows: Select and remove a uniformly random element from S and make it the
root. Now repeat the following step until S becomes empty: Select and remove a randomly and
uniformly selected element from S and insert it into the present binary search tree.
• Prove that the expected depth (distance from the root) of each element in the tree will be
O(log n).
Note: There are a few questions in this sheet which were asked during the lectures.