Higher or Lower

Higher or Lower

Consider the following card game. A dealer holds a shuffled deck of cards numbered 11 through 1313 and turns them over one at a time, without replacement. Before each new card is revealed, you wager on whether it will be higher or lower than the one currently showing, at even money. You start with a bankroll of 10001000 and may only stake multiples of 100100. What is your strategy for maximising your wealth?

This is a Kelly betting problem, see earlier post, but with the win probability pp changing each round. As an optimal strategy, Kelly says to stake a fraction 2p−12p - 1 of your bankroll, where pp is the current probability of winning. We demonstrate the approach below, and then argue formally that it is optimal.

Example #

Suppose the dealer opens with a 22, and the game runs as follows. Shaded cards are still in the deck, the black card is the one showing, and struck-out cards have already been dealt.

Round 1

1 lower 11 higher

Of the twelve cards left, only the 11 is below the 22 and the other 11 are above it, giving p=11/12p = 11/12 of a higher card on the next reveal. Kelly suggests we stake 2p−1=562p - 1 = \frac{5}{6} of the bankroll, which is 800800 at 100100 lot size. A 1010 is drawn, so the bet wins and the bankroll becomes 18001800.

Round 2

8 lower 3 higher

The 22 has already gone, so eight cards lie below the 1010 rather than nine, and the probability of a lower card is p=8/11p = 8/11. The Kelly stake is then again 800800. A 55 is drawn, taking the bankroll to 26002600.

Round 3

3 lower 7 higher

Here, the probability of a higher card is p=7/10p = 7/10. The Kelly stake is now 10001000, purely because the bankroll has grown. This time a 33 is drawn and the bet loses, bringing the bankroll back down to 16001600.

Play continues in this way for twelve rounds, until the deck is exhausted.

Game #

Below is the game that you can play through. During the game, try to keep tabs on your current bankroll, cards dealt, and the probability of winning each round. All of that is hidden by default, but revealed along with the deck if you would rather read it off than count it.

Dealer

Deck

Formalising the Game #

Let (c0,c1,…,c12)(c_{0}, c_{1}, \ldots, c_{12}) be a uniformly random ordering of {1,…,13}\{1, \ldots, 13\}, where cjc_{j} is the jjth card turned over and c0c_{0} is the dealer’s opening card. Write Fj:=σ(c0,…,cj)\mathcal{F}_{j} := \sigma (c_{0}, \ldots, c_{j}) for the information available once cjc_{j} has been seen. All randomness is carried by this initial shuffle.

There are twelve betting rounds, the opening reveal not being a bet: round kk is placed on the face-up card ck−1c_{k - 1} and settled by the next reveal ckc_{k}, for k=1,…,12k = 1, \ldots, 12. Everything known at the moment of betting therefore carries the card index k−1k - 1, which is easier to read relabelled by the round,

fk:=ck−1,Rk:={1,…,13}∖{c0,…,ck−1},∣Rk∣=13−k, f_{k} := c_{k - 1}, \qquad R_{k} := \{1, \ldots, 13\} \setminus \{c_{0}, \ldots, c_{k - 1}\}, \qquad |R_{k}| = 13 - k,

the card showing at round kk and the deck it is played against. Note that fk∉Rkf_{k} \notin R_{k}, and that ckc_{k} is drawn uniformly from RkR_{k}.

Per-Round Win Probability #

Given Fk−1\mathcal{F}_{k - 1}, define

Hk:=∣{x∈Rk:x>fk}∣,Lk:=∣{x∈Rk:x<fk}∣, \begin{aligned} H_{k} & := & |\{x \in R_{k} : x > f_{k}\}|, \\ L_{k} & := & |\{x \in R_{k} : x < f_{k}\}|, \end{aligned}

the unseen cards above and below the card showing, so that Hk+Lk=∣Rk∣=13−kH_{k} + L_{k} = |R_{k}| = 13 - k. Since ckc_{k} is uniform on RkR_{k}, backing the larger side dk∈{H,L}d_{k} \in \{H, L\} wins with probability

pk=max⁡{Hk,Lk}13−k≥12, p_k = \frac{\max\{H_k, L_k\}}{13 - k} \geq \frac{1}{2},

with pk=1/2p_k = 1/2 exactly when Hk=LkH_k = L_k, and pk=1p_k = 1 when every card in RkR_{k} lies on one side of fkf_{k}.

The Bankroll Process #

Let Tk=+1T_{k} = +1 if ckc_k falls on the backed side dkd_{k} and −1-1 otherwise, so that TkT_{k} is Fk\mathcal{F}_{k}-measurable with P(Tk=1∣Fk−1)=pk\mathbb{P} (T_{k} = 1 \mid \mathcal{F}_{k - 1}) = p_{k}. Staking a fraction λk∈[0,1]\lambda_{k} \in [0, 1] of the bankroll, fixed before the card is turned and so Fk−1\mathcal{F}_{k - 1}-measurable,

Wk=Wk−1(1+λkTk),W0=1000. \begin{aligned} W_{k} &= W_{k - 1} (1 + \lambda_{k} T_{k}), \\ W_{0} &= 1000. \end{aligned}

The increments are neither independent nor identically distributed, since the law of TkT_{k} depends on the cards already seen. To see how the bankroll moves in expectation, note that Wk−1W_{k - 1} and λk\lambda_{k} are both known at the moment of betting and so come out of the conditional expectation as constants, leaving only

E[Tk∣Fk−1]=(+1)pk+(−1)(1−pk)=2pk−1, \mathbb{E} [T_{k} \mid \mathcal{F}_{k - 1}] = (+1) p_{k} + (-1) (1 - p_{k}) = 2 p_{k} - 1,

the profit per unit staked on an even-money bet won with probability pkp_{k}. Hence

E[Wk∣Fk−1]=Wk−1(1+λk(2pk−1)). \mathbb{E} [W_{k} \mid \mathcal{F}_{k - 1}] = W_{k - 1} \big( 1 + \lambda_{k} (2 p_{k} - 1) \big).

Any stake grows the bankroll in expectation whenever pk>1/2p_{k} > 1/2, but the growth is linear in λk\lambda_{k}: on this criterion alone one would stake everything, every round, and be wiped out by the first loss. Sizing the stake sensibly needs a different objective.

The Kelly Stake for One Round #

Each round is an even-money bet at Fk−1\mathcal{F}_{k-1}-measurable odds pkp_{k}, so the Kelly argument applies stage by stage: the fraction maximising E[log⁡(Wk)∣Fk−1]\mathbb{E} [\log (W_{k}) \mid \mathcal{F}_{k - 1}] is

πk:=2pk−1=∣Hk−Lk∣13−k∈[0,1]. \pi_{k} := 2 p_{k} - 1 = \frac{|H_{k} - L_{k}|}{13 - k} \in \left[ 0, 1 \right].

Opening on a 22 gives H1=11H_1 = 11, L1=1L_1 = 1 and π1=56\pi_{1} = \frac{5}{6}; opening on a 11 gives π1=1\pi_1 = 1, the whole bankroll staked on a certainty.

Kelly’s fraction is therefore exactly the conditional mean of TkT_{k} computed above, and putting λk=πk\lambda_{k} = \pi_{k} into the expected-wealth identity gives

E[Wk∣Fk−1]=Wk−1(1+πk2)≥Wk−1, \mathbb{E} [W_{k} \mid \mathcal{F}_{k - 1}] = W_{k - 1} (1 + \pi_{k}^{2}) \geq W_{k - 1},

with equality exactly when Hk=LkH_{k} = L_{k}: the bankroll grows in expectation precisely in those rounds where counting gives an edge. The square is πk\pi_{k} appearing twice for two different reasons, once as the fraction staked and once as the profit per unit staked.

All of this concerns the round in front of you. That the same fraction is also right for the game as a whole does not follow automatically, since a myopic rule can in general be beaten by one that gives up something now to set up later rounds.

Optimality Over the Whole Game #

The horizon here is finite, twelve rounds, so the asymptotic growth-rate argument does not apply directly. Kelly is nonetheless globally optimal, because log-utility separates additively across rounds. Taking logarithms of the recursion,

log⁡(W12)=log⁡(W0)+∑k=112log⁡(1+λkTk), \log (W_{12}) = \log (W_{0}) + \sum_{k = 1}^{12} \log (1 + \lambda_{k} T_{k}),

and applying the tower property,

E[log⁡(W12)]=log⁡(W0)+∑k=112E[E[log⁡(1+λkTk)∣Fk−1]]. \mathbb{E} [\log (W_{12})] = \log (W_{0}) + \sum_{k = 1}^{12} \mathbb{E} \Big[ \mathbb{E} \big[ \log (1 + \lambda_{k} T_{k}) \mid \mathcal{F}_{k - 1} \big] \Big].

Each summand depends only on the Fk−1\mathcal{F}_{k - 1}-measurable choice of λk\lambda_{k}, not on λj\lambda_{j} for j≠kj \neq k, so maximising each conditionally maximises the sum, and each is maximised at λk=πk\lambda_{k} = \pi_{k}. The one-step-ahead rule is therefore optimal for the whole game under this objective; maximising E[W12]\mathbb{E} [W_{12}] instead returns to the linear identity above and stakes the entire bankroll every round, as in the Kelly Criterion post.

The $100 Lot Constraint #

Writing BkB_{k} for the cash staked in round kk, the derivation allows any Bk∈[0,Wk−1]B_{k} \in [0, W_{k - 1}] and settles on Bk=πkWk−1B_{k} = \pi_{k} W_{k - 1}. The game permits only multiples of $100, so one takes the largest such multiple not exceeding that,

Bk=100⌊πkWk−1100⌋, B_{k} = 100 \left\lfloor \frac{\pi_{k} W_{k - 1}}{100} \right\rfloor,

which is why the example stakes 800800 rather than π1W0=833.3‾\pi_1 W_0 = 833.\overline{3}. Rounding down errs on the conservative side of the optimum.