user11021: Greetings fellow chess friends,
Here is a quick idea that came to my mind.
I am interested in writing a software that is able to calculate and/or guess the first n unknown moves of a given chess game.
For example take this game:

?? ??
?? ??
Nf3 b6 
g3 Ba6 
Nbd2 Bb4
a3 Bxd2+ 
Nxd2 Bb7 
Nf3 d5 
cxd5 Bxd5 
Bg2 O-O 
O-O Nbd7
Bf4 c5 
dxc5 1/2-1/2 

You don't know the first two moves. Would it be possible to "calculate" them from the rest of the game and if yes, with what certainty? For example the move 9. cxd5 implies that a pawn has been placed on c4 earlier during the game.
Do you think this would be possible and if yes, for what maximum amount n of unknown moves?
Cheers
(Edit: corrected the 8th move, but need 6 characters to edit)

user9293: The way I see it, there's no way to know for certain which order the moves were played in. For example, in the game you listed, it's not difficult to determine what the moves are. Following Aric Fowler's method, d4 and c4 for white and Nf6 and e6 for black are the moves. As for the order, however, there are four combinations:

1. d4 Nf6

2. c4 e6


1. d4 e6

2. c4 Nf6


1. c4 Nf6 

2. d4 e6


1. c4 e6

2. d4 Nf6

Obviously, case 1 is the most likely, assuming the players know and follow basic opening theory, but I don't think there's any way to determine the order for sure.

user10887: Well, this should be semi-simple for a computer, at least. We know with absolute certainty that there are only 20 possible moves for both black and white (pawns and knights) on the first turn. After that, the only possible moves are moving the piece moved again, moving another pawn or knight, or moving a piece freed by the first move.
Knowing this, we can calculate the number of possible board positions after two turns. Luckily this has already been done here:

There are 400 possible chess positions after two ply moves (first ply move for White followed by first ply move for Black). 
  There are 5,362 possible positions (White’s second ply move) or 8,902 total positions after two ply moves each. There are 71,852 possible positions or 197,742 total positions after four moves.

This is a LOT, but it is possible to at least guess which one was used in the game.
The method I propose is to go though all of the movements of the game after the first four, but starting with the default chessboard as if the game had only just started. If a move occurs which is impossible, this indicates that this move has been made by a piece moved in the first two turns.
Despite this, there could be cases where a pawn moved on white's first turn and a pawn moved on white's third turn can take the same piece. If white takes with the pawn moved on the first turn, there would be no way to spot this, since you would assume the pawn moved on the third turn was used.
Sorry that this is only a half-answer; I will try to find more information to improve this.

11021: <p>Greetings fellow chess friends,</p>

<p>Here is a quick idea that came to my mind.</p>

<p>I am interested in writing a software that is able to <strong>calculate and/or guess the first <code>n</code> <em>unknown</em> moves of a given chess game</strong>.
For example take this game:</p>

<ol>
<li>?? ??</li>
<li>?? ??</li>
<li>Nf3 b6 </li>
<li>g3 Ba6 </li>
<li>Nbd2 Bb4</li>
<li>a3 Bxd2+ </li>
<li>Nxd2 Bb7 </li>
<li>Nf3 d5 </li>
<li>cxd5 Bxd5 </li>
<li>Bg2 O-O </li>
<li>O-O Nbd7</li>
<li>Bf4 c5 </li>
<li>dxc5 1/2-1/2 </li>
</ol>

<p>You don't know the first two moves. Would it be possible to "calculate" them from the rest of the game and if yes, with what certainty? For example the move <code>9. cxd5</code> implies that a pawn has been placed on c4 earlier during the game.</p>

<p>Do you think this would be possible and if yes, for what maximum amount <code>n</code> of unknown moves?</p>

<p>Cheers</p>

<p>(Edit: corrected the 8th move, but need 6 characters to edit)</p>
 9293: <p>The way I see it, there's no way to know for certain which order the moves were played in. For example, in the game you listed, it's not difficult to determine <em>what</em> the moves are. Following Aric Fowler's method, d4 and c4 for white and Nf6 and e6 for black are the moves. As for the order, however, there are four combinations:</p>
<p>
1. d4 Nf6
<br>
2. c4 e6
</p>
<p>
1. d4 e6
<br>
2. c4 Nf6
</p>
<p>
1. c4 Nf6 
<br>
2. d4 e6
</p>
<p>
1. c4 e6
<br>
2. d4 Nf6
</p>
<p>Obviously, case 1 is the most likely, assuming the players know and follow basic opening theory, but I don't think there's any way to determine the order for sure.</p>
 10887: <p>Well, this should be semi-simple for a computer, at least. We know with absolute certainty that there are only 20 possible moves for both black and white (pawns and knights) on the first turn. After that, the only possible moves are moving the piece moved again, moving another pawn or knight, or moving a piece freed by the first move.</p>

<p>Knowing this, we can calculate the number of possible board positions after two turns. Luckily this has already been done <a href="https://www.chess.com/chessopedia/view/mathematics-and-chess" rel="nofollow">here</a>:</p>

<blockquote>
  <p>There are 400 possible chess positions after two ply moves (first ply move for White followed by first ply move for Black). 
  There are 5,362 possible positions (White’s second ply move) or 8,902 total positions after two ply moves each. There are 71,852 possible positions or 197,742 total positions after four moves.</p>
</blockquote>

<p>This is a LOT, but it is possible to at least guess which one was used in the game.</p>

<p>The method I propose is to go though all of the movements of the game after the first four, but starting with the default chessboard as if the game had only just started. If a move occurs which is impossible, this indicates that this move has been made by a piece moved in the first two turns.</p>

<p>Despite this, there could be cases where a pawn moved on white's first turn and a pawn moved on white's third turn can take the same piece. If white takes with the pawn moved on the first turn, there would be no way to spot this, since you would assume the pawn moved on the third turn was used.</p>

<p>Sorry that this is only a half-answer; I will try to find more information to improve this.</p>
