Answers.Body: <p>Whilst acknowledging the comment by @SmallChess that this is pointless, it is also relatively straightforward to do. I analysed 2,539,871 games from a ChessBase mega database counting the number of moves for the next player to move before each move was played. I did not include the number of moves available after the final move of the game had been played. The total number of moves played was 194,389,820 (76.5 per game) and the total number of available moves was 6,039,013,721 giving an average of about 31.1 per move.</p>
  
  <p>Here is an analysis of the average number of moves available for each colour at each move point for the first 100 moves of each. Move 0 is prior to the first move of each colour. It is interesting to observe that, on average, black has fewer options than white. I am not sure why this would be-hopefully, it isn't an error in the analysis (!) but I don't think it is.</p>
  
  <p><a href="https://i.sstatic.net/7eqPQ.gif" rel="noreferrer"><img src="https://i.sstatic.net/7eqPQ.gif" alt="Average number of moves available before each move"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-31T19:53:19.390Z
Answers.Text: it's not an error.  I did the same analysis and arrived at the same result: on average, white has more available moves.
Answers.UserDisplayName: Marc
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-31T23:31:15.677Z
Answers.Text: I think that makes sense; Black is more likely to go into a defense such as the French that limits one or more of his pieces.
Answers.UserDisplayName: D M
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-30T07:43:03.773Z
Answers.Text: +1; really nice effort! Any chance to also report some confidence intervals?
Answers.UserDisplayName: GloriaVictis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-30T19:15:16.937Z
Answers.Text: @GloriaVictis I can try, although I haven't coded that before. For a 95% confidence interval I am getting a margin of error around 0.01 after about 30 ply and about 0.026 after 100 ply. Are those the sort of values you would expect? What form would this data be most useful in?
Answers.UserDisplayName: kentdjb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-08T23:29:47.740Z
Answers.Text: What distribution would this be, lognormal? What are the parameters for these distributions?
Answers.UserDisplayName: Ivar Eriksson
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-14T18:29:02.977Z
Answers.Text: +1 for the nice graph :) Btw, thanks for sharing pgn-extract with us! @kentdjb
Answers.UserDisplayName: leonardo_assumpcao
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-26T22:01:08.017Z
Answers.LastActivityDate: 2019-04-30T19:21:13.887Z
Answers.LastEditDate: 2019-04-30T19:21:13.887Z
Answers.UserDisplayName: kentdjb
Answers.Body: <p>The variability in number of legal moves is about the same for black &amp; white... except for that odd little bump for white on move 7.  This phenomenon demands further research!</p>
  
  <p><a href="https://i.sstatic.net/jqKEl.png" rel="noreferrer"><img src="https://i.sstatic.net/jqKEl.png" alt="mean number of legal moves after move number"></a>
  <a href="https://i.sstatic.net/3FInO.png" rel="noreferrer"><img src="https://i.sstatic.net/3FInO.png" alt="std dev legal moves after move number"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-31T21:43:11.737Z
Answers.Text: Some very interesting data. Is that bump actually just on move 7, or is it spread out over moves 6 and 8 as the graph would suggest?
Answers.UserDisplayName: konsolas
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-02T08:03:13.973Z
Answers.Text: The anomaly is indeed spread over moves 5, 6, and 7, with its peak at move 6. I'll add a bar chart that makes it more clear.
Answers.UserDisplayName: Marc
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-07T21:39:07.847Z
Answers.Text: Perhaps at this point in the game W is more likely to have castling opportunities that B doesn't? There's a smaller anomaly bump for B a few moves later.
Answers.UserDisplayName: mVChr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-31T19:57:05.110Z
Answers.LastActivityDate: 2019-09-02T08:05:00.903Z
Answers.LastEditDate: 2019-09-02T08:05:00.903Z
Answers.UserDisplayName: Marc
Answers.Body: <p>What you are looking for is called the <a href="https://en.wikipedia.org/wiki/Branching_factor" rel="noreferrer">branching factor</a>, and I've always seen the number <strong>35</strong> mentioned, but I don't know what the original source is. I guess someone estimated it some 50 years ago by counting the number of moves in a number of random positions from games, and then it became "common knowledge". The number 35 is reasonable enough in practice, but of course is not exact.</p>
  
  <p>In today's age of big data, it should be easy to take a game database and answer the question of what is the exact average number of moves per position in the database. I'm sure someone must have tried that already, but I haven't seen it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-05T04:11:14.437Z
Answers.Text: Correct. Not a very hard exercise but pointless.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-05T15:15:42.683Z
Answers.Text: Are those 35 for a typical game of chess or an average over all possible positions of chess? A game database would not contain all positions, but only a fraction of possible positions which could affect the value.
Answers.UserDisplayName: user1583209
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-06T15:46:45.940Z
Answers.Text: @user1583209 I think it is the average of the played games.
Answers.UserDisplayName: Superluminal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-05T01:21:52.713Z
Answers.LastActivityDate: 2018-12-05T01:21:52.713Z
Answers.UserDisplayName: itub
Body: <p>For example in the first turn there are 20 possible legal moves (16 pawn moves and 4 knights moves). This number increases in the middlegame and then decreases in the Endgame.</p>
  
  <p>Are there some calculations on the average? Google search seem to be focused only on "average number of moves per game". Would appreciate if somebody have some links to some scientific researches or also blog posts. </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-04T17:36:58.570Z
Comments.Text: If I understand your question correctly, you would have to average over the number  of all possible chess positions, which is an extremely large number. Besides, I am not sure how meaningful this average is (might depend on what you need it for).
Comments.UserDisplayName: user1583209
Tags: <statistics><mathematics><game-complexity>
Title: What is the average number of legal moves per turn?
ThreadText: # What is the average number of legal moves per turn?
  
  (Asked by: username_0 on 2018-12-04)
  
  For example in the first turn there are 20 possible legal moves (16 pawn moves and 4 knights moves). This number increases in the middlegame and then decreases in the Endgame.
  
  Are there some calculations on the average? Google search seem to be focused only on "average number of moves per game". Would appreciate if somebody have some links to some scientific researches or also blog posts.
  
  **Tags:** statistics, mathematics, game-complexity
  
  > **Comments:**
  > **username_1**: If I understand your question correctly, you would have to average over the number  of all possible chess positions, which is an extremely large number. Besides, I am not sure how meaningful this average is (might depend on what you need it for).  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_10 on 2018-12-05. Score: 8 | Accepted answer
  
  What you are looking for is called the [branching factor](https://en.wikipedia.org/wiki/Branching_factor), and I've always seen the number **35** mentioned, but I don't know what the original source is. I guess someone estimated it some 50 years ago by counting the number of moves in a number of random positions from games, and then it became "common knowledge". The number 35 is reasonable enough in practice, but of course is not exact.
  
  In today's age of big data, it should be easy to take a game database and answer the question of what is the exact average number of moves per position in the database. I'm sure someone must have tried that already, but I haven't seen it.
  
  > **Comments:**
  > **username_11**: Correct. Not a very hard exercise but pointless.  
  > **username_1**: Are those 35 for a typical game of chess or an average over all possible positions of chess? A game database would not contain all positions, but only a fraction of possible positions which could affect the value.  
  > **username_0**: @username_1 I think it is the average of the played games.  
  
  ---
  
  ### Answer by username_2 on 2019-04-26. Score: 18
  
  Whilst acknowledging the comment by @username_11 that this is pointless, it is also relatively straightforward to do. I analysed 2,539,871 games from a ChessBase mega database counting the number of moves for the next player to move before each move was played. I did not include the number of moves available after the final move of the game had been played. The total number of moves played was 194,389,820 (76.5 per game) and the total number of available moves was 6,039,013,721 giving an average of about 31.1 per move.
  
  Here is an analysis of the average number of moves available for each colour at each move point for the first 100 moves of each. Move 0 is prior to the first move of each colour. It is interesting to observe that, on average, black has fewer options than white. I am not sure why this would be-hopefully, it isn't an error in the analysis (!) but I don't think it is.
  
  [![Average number of moves available before each move](https://i.sstatic.net/7eqPQ.gif)](https://i.sstatic.net/7eqPQ.gif)
  
  > **Comments:**
  > **username_5**: +1; really nice effort! Any chance to also report some confidence intervals?  
  > **username_2**: @username_5 I can try, although I haven't coded that before. For a 95% confidence interval I am getting a margin of error around 0.01 after about 30 ply and about 0.026 after 100 ply. Are those the sort of values you would expect? What form would this data be most useful in?  
  > **username_3**: it's not an error.  I did the same analysis and arrived at the same result: on average, white has more available moves.  
  > **username_4**: I think that makes sense; Black is more likely to go into a defense such as the French that limits one or more of his pieces.  
  > **username_6**: What distribution would this be, lognormal? What are the parameters for these distributions?  
  > **username_7**: +1 for the nice graph :) Btw, thanks for sharing pgn-extract with us! @username_2  
  
  ---
  
  ### Answer by username_3 on 2019-08-31. Score: 8
  
  The variability in number of legal moves is about the same for black & white... except for that odd little bump for white on move 7. This phenomenon demands further research!
  
  [![mean number of legal moves after move number](https://i.sstatic.net/jqKEl.png)](https://i.sstatic.net/jqKEl.png)
  [![std dev legal moves after move number](https://i.sstatic.net/3FInO.png)](https://i.sstatic.net/3FInO.png)
  
  > **Comments:**
  > **username_8**: Some very interesting data. Is that bump actually just on move 7, or is it spread out over moves 6 and 8 as the graph would suggest?  
  > **username_3**: The anomaly is indeed spread over moves 5, 6, and 7, with its peak at move 6. I'll add a bar chart that makes it more clear.  
  > **username_9**: Perhaps at this point in the game W is more likely to have castling opportunities that B doesn't? There's a smaller anomaly bump for B a few moves later.  
  
  ---
  
  