Skip to content

Instantly share code, notes, and snippets.

@cablehead
Last active June 19, 2026 18:08
Show Gist options
  • Select an option

  • Save cablehead/91f5f639448fbcf1d9d9854a4b3a0be3 to your computer and use it in GitHub Desktop.

Select an option

Save cablehead/91f5f639448fbcf1d9d9854a4b3a0be3 to your computer and use it in GitHub Desktop.
2048: why two identical boards can have different scores (the 432-point discrepancy)

2048: why two identical boards can have different scores

Two long games reached effectively the same position but finished with different scores: 1,811,320 vs 1,810,888, a gap of 432. The boards looked the same, so the scores "should" have matched. They don't, and there is no bug. Here is the full explanation, with the exact numbers.

The snapshot where the two boards coincide

There is a moment where both games show an identical set of 16 tiles (total mass 131,040), and the scores are exactly the quoted pair:

Game A (03g5vf4j) Game B (03gasnewa)
board identical tile set, mass 131040 identical tile set, mass 131040
score 1,811,320 1,810,888
4-tiles spawned all game 5,891 5,999

Same board, score differs by 432.

The "one board has a 4, the other has a 2" difference spotted between two screenshots is a red herring. It is just two adjacent frames, and a single small tile is worth at most a few points, not 432. The real cause is not visible on the board at all.

Why identical boards can have different scores

The score is not a function of the board alone. Let $b$ be the number of 4-tiles the game has spawned. The exact identity is:

$$\text{score} = \underbrace{\sum_i v_i \log_2 v_i}_{\text{board only}} - \underbrace{\sum_i v_i}_{\text{board mass}} - \underbrace{4b}_{\text{spawn luck}}$$

The first two terms depend only on the tiles in front of you. The last term depends on your spawn luck. So two players who reach the exact same board differ in score by precisely $4\Delta b$, where $\Delta b$ is the difference in how many 4s the RNG gave them.

Where the identity comes from

Every point of score comes from a merge: combining two tiles of value $v$ produces $2v$ and adds $2v$ to the score. Track the quantity $T = \sum_i v_i \log_2 v_i$ over the board:

  • A merge of two $v$ tiles changes $T$ by

$$2v\log_2(2v) - 2v\log_2 v = 2v,$$

which is exactly the score it adds.

  • A spawn of a tile of value $s$ adds $s\log_2 s$ to $T$ for free (no score). A spawned 2 adds $2$; a spawned 4 adds $8$.

So $T$ equals the score plus the sum of all spawn contributions. The total board mass $W = \sum_i v_i$ also equals the mass of all spawns,

$$W = 2 \cdot (\#\text{2-spawns}) + 4 \cdot (\#\text{4-spawns}),$$

because merges conserve mass. Substituting and simplifying gives

$$\text{score} = T - W - 4b.$$

A spawned 2 contributes $+2$ to $T$ and $+2$ to $W$, so it cancels and has no net effect. A spawned 4 contributes $+8$ to $T$ and $+4$ to $W$, a net $+4$ that the final term subtracts back out. The board terms are identical for identical boards, so only $b$ can move the score.

The mechanism in plain terms

A spawned 2 is neutral: you still have to merge your way up from it, scoring every step. A spawned 4 is 4 units of mass handed to you that you did not have to build by merging two 2s, and that merge would have scored 4 points. Every 4 the game spawns lowers your ceiling by 4 for the same final board.

The 432, exactly

Game B was handed 108 more 4-tiles over its ~59,500 moves than game A (5,999 vs 5,891). That is ordinary variance in the spawn RNG; both games expected roughly 5,950. Each extra 4 costs 4 points:

$$\Delta\text{score} = 4 \cdot \Delta b = 4 \times 108 = 432.$$

Game A merged up from 2s more often, so it banked 432 more points for the same board.

Verification

The identity was checked against every sampled snapshot of both full games (hundreds of thousands of moves). The implied 4-spawn count,

$$b = \frac{T - W - \text{score}}{4},$$

always came out a non-negative integer, never a fraction. If merges were miscounted or score leaked anywhere, $b$ would drift off-integer. It never did. The scoring is correct; the 432 is the right answer for two games that reached the same board through different spawn luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment