*(from K. Levasseur) A parent and his child play the following game. A deck of 2n cards, n red and n black, is shuffled. The cards are turned up one at a time. Before each card is turned up, the parent and the child guess whether it will be red or black. Whoever makes more correct guesses wins the game. The child is assumed to guess each color with the same probability, so she will have a score of n, on average. The parent keeps track of how many cards of each color have already been turned up. If more black cards, say, than red cards remain in the deck, then the parent will guess black, while if an equal number of each color remain, then the parent guesses each color with probability 1/2. What is the expected number of correct guesses that will be made by the parent? Hint: Each of the (n2n) possible orderings of red and black cards corresponds to a random walk of length 2n that returns to the origin at time 2n. Show that between each pair of successive equalizations, the parent will be right exactly once more than he will be wrong. Explain why this means that the average number of correct guesses by the parent is greater than n by exactly one-half the average number of equalizations. Now define the random variable Xi to be 1 if there is an equalization at time 2i, and 0 otherwise. Then, among all relevant paths, we have
E(Xi)=P(Xi=1)=(n2n)(n−i2n−2i)(i2i).
Thus, the expected number of equalizations equals
E(i=1∑nXi)=(n2n)1i=1∑n(n−i2n−2i)(i2i).
One can now use generating functions to find the value of the sum.