Let's say a person with perfect memory is playing the card-matching game Concentration. He/she randomly lays out 2n cards (ie. n card pairs) sorted randomly and repeatedly takes turns consisting of flipping over two cards, one at a time (so you may look at the first card before flipping a second). When the cards match they are removed from play. When cards do not match, they are turned back over. The player wins when all pairs are found and all cards are removed.
A perfect game is played in just n turns, but even a perfect player (one with perfect memory) couldn't hope to come close to a perfect game as there would still be a lot of guessing required.
How to you calculate the expected number of turns required to win for player with perfect memory?
NOTE: this is a modification of this very similar question
I claim that the proper strategy is
Item 1 can occur any time you want, so it might as well be first. Otherwise, turning a known card gives no information, so you should turn an unknown. Item 3 is clear-if you turn another card you are one flip behind. Again for 4, you get information that you don't if you flip a known card.
Now we can define a function $N(n,k,m)$ which is the expected number of flips with $n$ pairs on the board, $k$ cards known and $m=1$ indicates that we have a match among the known cards. It only is defined before we flip the first card of a pair. When we turn the first card of a pair, we have two possible results-it matches a known card or not. Assuming it does not, when we turn the second card, it can match the first card turned, it can match another known card, or it can be new. The recurrence is $$N(n,k,1)=1+N(n-1,k-2,0)\\N(n,k,0)=1+\frac k{2n-k}N(n-1,k-1,0)+\frac {2n-2k}{2n-k}\left(\frac{k+1}{2n-k-1}N(n,k+2,1)+\frac {2n-2k-2}{2n-k-1}N(n,k+2,0)\right) $$ where the first comes from flipping the known pair. The $1$ in the second is this flip. The first term after the $1$ is from flipping a card that matches a known one, so you flip the match. The first term in the last parenthesis is from flipping an unmatch, then flipping a match. The second is from flipping two unmatches.