CSE 312 Homework 3, Due Friday, October 17

CSE 312 Homework 3, Due Friday, October 17
1. Die A has 4 red and 2 white faces, whereas die B has 2 red and 4 white faces. A fair coin is flipped
once. If it lands on heads, the game continues with die A; if it lands tails, then die B is to be used.
• Show that the probability of red at any throw is 1/2.
• If the first two throws result in red, what is the probability of red at the third throw?
• If red turns up at the first two throws, what is the probability that it is die A that is being used?
2. Consider the following guessing game. There is an opaque jar with 3 balls in it. Either the jar has 2
yellow balls and one blue ball (call this a “yellow jar”) or 1 yellow ball and 2 blue balls (call this a
“blue jar”).
Players enter a room sequentially one-by-one and without communicating with anyone else do the
following:
(a) The player sees a random ball from the jar (and returns it to the jar).
(b) The player sees the history of the other people’s guesses;
(c) The player writes down their guess of whether the jar is blue or yellow.
Each player tries to maximize the probability of guessing correctly given all the information they have
(and the information they have is the color of the random ball they saw and the guesses of all the
people that entered the room before them).
Thus, each player computes the probability pb that the jar is blue given the information they have and
the probability py that the jar is yellow given their information, and writes down blue if pb ≥ py and
yellow otherwise.
Suppose that the first person’s random draw is blue. What will his guess be? Suppose that the second
person’s random draw is also blue. What will her guess be?
What is the probability that the third person’s guess is blue given that the first two people draw blue
balls? What is the probability that the i-th person’s guess is blue given that the first two people draw
blue balls? (Do not be worried if this problem seems too easy. I’m trying to illustrate an interesting
phenomenon called “information cascades” that I will discuss a bit more in class.)
Show that with probability at least 1/9, every single person guesses incorrectly.
3. We are playing a tournament in which we stop as soon as one of us wins n games. We are evenly
matched, so each of us wins any game with probability 1/2, independently of other games. What is
the probability that the loser has won k games when the match is over?
4. A parallel system functions whenever at least one of its components works. Consider a parallel system
of n components and suppose that each component works with probability p independently. What is
the probability that component 1 works conditioned on the fact that the system is functioning?
5. Suppose 100 distinct names are hashed into a hash table with 200 buckets. Assume the hash function
assigns each distinct name to a bucket chosen uniformly at random (equally likely) from 1 to 200, and
the different names are assigned independently. What is the probability that there are no collisions?
(You do not need to simplify your expression.)
6. A and B play a series of games. Each game is independently won by A with probability p, and by B
with probability 1 − p. They stop when the total number of wins of one of the players is two greater
than that of the other player. The player with the greater number of wins is declared the match winner.
• Find the probability that a total of 4 games are played.
• Find the probability that A is the match winner.
1
7. I have a deck of 52 regular playing cards, 26 red, 26 black, randomly shuffled. They all lie face down
so that you can’t see them. I will draw a card off the top of the deck and turn it face up so that you
can see it, and then I will put it aside. I will continue to turn up cards like this but at some point
while there are still cards left in the deck, you have to declare that you want the next card that will
be turned up. If that next card turns up black, you win and otherwise you lose. Either way, the game
is then over.
(a) Show that if you take the first card before you have seen any cards, then you have probability
1/2 of winning the game.
(b) Suppose you don’t take the first card and it turns up red. Show that you then have a probability
of winning the game that is greater than 1/2.
(c) If there are r red cards left in the deck and b black cards, show that the probability of winning if
you take the next card is b/(r + b).
(d) Either,
i. come up with a strategy for this game that gives you a probability of winning strictly greater
than 1/2 and prove that the strategy works, or,
ii. come up with a proof that no such strategy can exist.
Hint: induction on the number of red and black cards remaining.
8. UW students sometimes delay laundry for a few days (to the chagrin of their roommates).
A busy student must complete 3 problem sets before doing laundry. Each problem set requires 1 day
with probability 2/3 and 2 days with probability 1/3. (The time it takes to complete different problem
sets is independent.) Let B be the number of days a busy student delays laundry. (i) What is the
probability mass function for B? (ii) Draw a graph showing the cumulative distribution function for
B. Example: If the first problem set requires 1 day and the second and third problem sets each require
2 days, then the student delays for B = 5 days.
9. Let X represent the difference between the number of heads and the number of tails obtained when a
fair coin is tossed independently 100 times. What are the possible values of X? What is the probability
that X = 4?
10. Extra Credit: The names of 100 people are placed into 100 closed bags, one name per bag, and the
bags are lined up on a table in a room. One by one the people are led into the room; each may look
in at most 50 bags, but must leave the room exactly as they found it. From the moment a person is
led into the room, that person is not allowed any further communication with the others.
The people have a chance to plot their strategy in advance (and come up with a coordinated strategy if
they so desire) and they are going to need it, because unless every single person finds their own name
among the 50 bags they look in, all of them will be shot!
We will now develop a strategy that guarantees that they won’t be shot with probability more than
0.3. The strategy is the following. The players first agree amongst themselves on a random labelling
of the bags with their names. Then, when a person walks into the room, he first looks at his own bag
(the one that has his label in the random labelling). If he doesn’t find his name inside, he looks into
the bag belonging to the name he just found, and then into the bag belonging to the name he found
in the second bag, etc. until he either finds his own name, or has opened 50 bags.
Let me run a quick example assuming 5 people that are each allowed to look into at most 3 bags.
Say the random labelling π the people agree on for the bags on the table is (Carol, Alice, Darin, Elise,
Bob) in order and suppose that what’s inside the corresponding bags in their order on the table are
the names (Alice, Bob, Elise, Darin, Carol)
Then when Alice comes in, she will go to the bag labelled with Alice’s name which is bag 2, see Bob’s
name inside it, then go to the bag labelled with Bob’s name (bag 5), see Carol’s name inside it and then
go to the bag labelled with Carol’s name and see her own name inside it. Yippee, she has found her
2
own name without looking into more than 3 bags. In fact, in this example, using the above strategy,
everyone will find their name without looking into more than 3 bags.
On the other hand, suppose that the random labelling π 0 of the bags on the table in order was (Darin,
Bob, Alice, Carol, Elise) (but still inside the bags the names are in the same order: Alice, Bob, Elise,
Darin, Carol) Then, using the above strategy, Bob will find his own name, but none of the rest of them
will find their names after looking in 3 bags, and so all will be shot.
Think of the names inside the bags in the order they are on the table as 1, 2, . . . n, and the random
labelling (random permutation) π the people agree on ahead of time as π1 , π2 , . . . , πn . Then the
strategy for the person whose name is i is to go to the bag j such that πj = i, then go to the bag k
such that πk = j and then go to the bag ` such that π` = k, until you either find your name or have
taken too many steps. Such a sequence is called a cycle in a permutation π. It is a sequence of indices
i1 , . . . , ik such that πi1 = ik , πi2 = i1 , πi3 = i2 . . ., πik = ik−1 .1
So in the first example above, if we think of (Alice, Bob, Elise, Darin, Carol) as (1, 2, 3, 4, 5) then the
random permutation π is (5, 1, 4, 3, 2) (i.e. π1 = 5, π2 = 1 and so on). Thus, in this permutation (2,
5, 1) is a cycle (because π2 = 1, π5 = 2 and π1 = 5). Similarly, (3, 4) is a cycle. and in the second
example, the permutation π 0 , (2) is a cycle and (3, 5, 4, 1) is a cycle. (You might want to convince
yourself that every permutation is the union of disjoint cycles).
Now the questions:
• Argue that if the random permutation that people pick has no cycle of length more than 50, then
they will not get shot.
• What is the probability that a random permutation of the numbers 1 to 2n does not contain any
cycle of length greater than n?
• Using the approximation
X 1
≈ ln(n),
i
1≤i≤n
evaluate the probability that the 100 people do not get shot. (FYI:
harmonic number and is denoted by Hn ).
1 This
is a non-standard definition of a cycle.
3
1
1≤i≤n i
P
is called the n-th