Number of Different Ways to play First n Moves in Chess
- $20, 400, 8902, 197 \, 742, \ldots$
The count for the fourth move is already ambiguous, as it depends on whether only legal moves count, or whether all moves, legal or illegal, are included.
The count as given here does include illegal moves in addition to legal ones.
There are $20$ ways to make the $1$st move by White:
- Each of the $8$ pawns may be moved either $1$ or $2$ squares forward, making $16$ moves
- Each of the $4$ knights may be moved to either of $2$ squares before it, making $4$ moves.
For each of those $20$ first moves by White, Black has the same $20$ options.
Thus there are $20 \times 20$ possible different games after the $2$nd move.
To count the $3$rd moves, one needs to consider cases.
First note that after the $1$st move, whatever it was, there are $7$ pawns on the $2$nd rank, each of which can be moved $1$ or $2$ squares forward, making $14$ moves for each of those $400$ possibilities.
Thus there are $400 \times 14 = 5600$ possible moves involving a so-far unmoved pawn.
For each of the $400$ positions, there are exactly $8$ which consist of two pawns in opposition on the $4$th and $5$th rank.
There are also another $4 \times 20 = 80$ positions in which white moved a knight.
For all other $400 - 88 = 312$ positions, the already-moved pawn has the option of moving another square forward.
This gives another $312$ options for the $3$rd move.
We now need to take into account the possibility that White may be able to capture a Black pawn.