[Math] What are the chances of winning Higher/Lower

card-gamesprobability

Given the game 'higher/lower':

A deck of cards of size N is uniquely ranked. The deck is shuffled, lain in a row, and the first card is turned over. You have to guess whether the next card to be turned over is higher than this one or lower. The next card is flipped. If you're right, you continue with that card for the remaining deck. (After this, the next card flipped is compared to this one.) If you make it to the end, you win. Otherwise, you lose.

It is obvious that if someone keeps track of all cards in the deck, they can make the best call between the two choices of "higher" and "lower" (with the highest chance of winning).

Given that the deck is shuffled completely random, what is the chance that someone will win this game (through N cards) if this person tracks all cards in the deck and plays optimally?

I thought of this question myself and was intrigued by it, but couldn't find any clues to the answer.

Best Answer

For $0\le k\le n$, let $p(n,k)$ be the probability to win the game if it starts with $n+1$ cards $0,1,\ldots, n$ and the first card shown is card $k$. By symmetry, $p(n,k)=p(n,n-k)$. If $k\ge \frac n2$, then the first guess will be "lower" (where both possible guesses a just as good in case $k=\frac n2$) and succeed with $\frac{k}{n}$, namely if the next card $l$ is one of $0,\ldots,k-1$. This gives us the recursion $$ p(n,k)=\frac1n\sum_{l=0}^{\max(k,n-k)-1}p(n-1,l)$$ (with the bases case $p(0,0)=1$). If we start with $n$ cards and have not seen the first card yet, the winning probability is then $$p(n)=\frac1n\sum_{k=0}^{n-1} p(n-1,k)$$

I doubt that there is a simple closed formula for $p(n)$. One can combute by hand that with a five card deck the probability is $p(5)=\frac{31}{60}$, which is nicely close to $50:50$. Just for fun, I let my computer evaulate this for a deck of $32$, where the overall winning probability is $$p(32)=\frac{593119019981747761359995677819}{4111419327088961408862781440000000}\approx 0.00014 \approx0.7585^{32}$$ as well as for for a deck of $52$, where it is $$p(52)=\\\frac{2502415780357808863930924231118727082667638137165232707577843}{10082271896367984821457579607050470871911188180110409728000000000000}\\\approx 2.48\cdot10^{-7}\approx 0.7454^{52} $$ This may be surprising because the first guess will be correct with at least $\frac 34$. So how come that the $0.7585$ per round decrease to $0.7454$ per round when the deck is enlarged from $32$ to $52$ cards? The problem is that after a correct guess of "lower", say, all cards above the previuos card are excluded. Thus the next card is a bit more likely to be of medium size - but that's the situation where guessing right is harder!