Answers.Body: <blockquote>
  <p>Is there a way to figure out the average number of moves of a game?</p>
  </blockquote>
  <p>The best way is to run a program which goes through a large database of games and calculates the average number of moves per game.</p>
  <blockquote>
  <p>The number of moves on record does not reflect the actual logical number of moves of which a game should consist.</p>
  </blockquote>
  <p>Games of chess are played between players of many different strengths. The &quot;logical number of moves&quot; a game should last after a particular position, even one where one player has lost queen for rook, will depend on the strengths of the two players and what mistakes they make on the way to finishing the game. That means that there is no &quot;logical number of moves of which a game should consist&quot;. There is only the actual number of moves of the game.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T21:55:18.300Z
Answers.Text: Well, in theory you could expand out the entire game tree and exhaustively count up how deep every single branch is, then take some sort of average. But to the best of my understanding, there is no efficient way to do it, and the brute force method is obviously wildly impossible.
Answers.UserDisplayName: Kevin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-25T17:45:22.503Z
Answers.Text: Seeing as the Shannon number is ~10^40 greater than the number of atoms in the observable universe, I would have to agree that brute force is not even worth a glance for this type of problem.
Answers.UserDisplayName: GOATNine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-25T19:12:40.433Z
Answers.Text: You could input all the recorded tournament games, up until one player resigns, and feed that position into Stockfish or whatever and see how many more moves it would've taken to actually mate, then calculate *those* averages.  Not sure what the value of that exercise would be though.  Doing every possible game is absurd, because the vast majority of *possible* games would never happen in reality if both players are actually trying to, you know, *win*...
Answers.UserDisplayName: Darrel Hoffman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-23T23:05:28.903Z
Answers.LastActivityDate: 2022-05-23T23:05:28.903Z
Answers.UserDisplayName: Brian Towers
Answers.Body: <p>Since actual games are almost always imperfect play, there is no <strong>logical</strong> number of moves from a given position, since the actual players would generally not play perfectly if forced to continue the game to the end. However, you can probably estimate the number of moves it would take a given pair of human players P1,P2 to finish a game past a resignation, by calibrating computer players C1,C2 to play similarly to each of them, and then using C1,C2 to finish the game! From this you can then obtain an estimate of the <strong>average</strong> number of moves that P1,P2 would take per chess game that they played but stopped upon resignation.</p>
  <p>The question then is, how can we calibrate computer players? A crude first-order approximation is as follows: Measure the centipawn loss distribution f of the human player over the opening and the middle-game and the end-game, according to an engine like StockFish. Then construct a smoothed version F of the cumulative function for f. Now make the computer player choose each move such that the smoothed cumulative function for the centipawn loss distribution for the chosen move is as close as possible to F!</p>
  <p>Better approximations are of course not hard to achieve. Just like Lichess can tailor puzzles to your weaknesses, which are all automatically computed, so also you can have different loss distributions for different types of moves (treating each position as a puzzle). It doesn't matter if the categories are humanly crafted (e.g. forks, pins, skewers, ...), because the goal is just to get a better result and not necessarily converge to a perfect simulation.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T21:08:48.527Z
Answers.Text: This is a good answer with a bunch of interesting stuff regarding mimicking human play, but in this one particular case it's probably not sufficient, because we simply don't have data regarding how P1,P2 will play past resignation point, as they don't tend to play these positions (that's the rub: they've resigned by then!).
Answers.UserDisplayName: Mobeus Zoom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T21:27:06.600Z
Answers.Text: @MobeusZoom: True, but we have to make simplifying assumptions if we want to get anything at all. Suppose that we want to know what happens if the world chess federation changes the rules to forbid resignation, just before a tournament. Then how would P1,P2 play in that tournament? Suppose that this does not affect their play up to the point where P1 would want to resign in the original world. Suppose further that the stakes are high, so P1 won't just concede defeat by making a silly move. Then our best estimate is to categorize each subsequent position so as to guess how P1,P2 would play.
Answers.UserDisplayName: user21820
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T21:41:18.850Z
Answers.Text: @user2180 Agreed. My only point is that the error bars are likely to be very large, because the same positions we are trying to make predictions about here are the very positions we don't have data about because resignation has occurred before them by definition. If the rules were changed as you suggest, we could start collecting that data and I guess considerably shorten the error bars quite quickly.
Answers.UserDisplayName: Mobeus Zoom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T10:09:08.557Z
Answers.LastActivityDate: 2022-05-24T10:09:08.557Z
Answers.UserDisplayName: user21820
Answers.Body: <p>Here are the results based from the games at TC 10minutes + 6s inc. The games are not adjudicated. You can download the games at <a href="http://www.fastgm.de/10min.html" rel="nofollow noreferrer">http://www.fastgm.de/10min.html</a>.</p>
  <p>These games have PlyCount tag, we can use this to get the approximate average number of moves on the games. You can use python chess modules to do this.</p>
  <p>pgn file: Top10-10min.pgn</p>
  <pre><code>average ply: 198
  approximate average number of moves: 99
  </code></pre>
  <p>Python code</p>
  <pre><code>import chess
  import chess.pgn
  import statistics
  
  
  fn = 'Top10-10min.pgn'
  
  data = []
  
  with open(fn, 'r') as f:
      while True:
          game = chess.pgn.read_game(f)
          if game is None:
              break
  
          plycnt = int(game.headers['PlyCount'])
          data.append(plycnt)
  
  
  print(f'average ply: {statistics.mean(data)}, approximate average number of moves: {statistics.mean(data)//2}')
  </code></pre>
  <h2>Other stats on ply numbers.</h2>
  <pre><code>file: Top10-10min.pgn
  src: http://www.fastgm.de/10min.html
  
  Game Ply Stats
  Average: 198.0
  Minimum: 25
  Maximum: 909
  Stdev: 96.0
  </code></pre>
  <h5>Average plies by ECO</h5>
  <pre><code>eco                                       opening  ave_plies
  D80                                     Gruenfeld      225.0
  E45                                  Nimzo-Indian      222.0
  A17                                       English      221.0
  E20                                  Nimzo-Indian      218.0
  E11      Bogo-Indian defense, Gruenfeld Variation      216.0
  E22                                  Nimzo-Indian      215.0
  C07                                        French      214.0
  D30                       Queen's gambit declined      214.0
  B17                                     Caro-Kann      213.0
  C70                                     Ruy Lopez      213.0
  A11                                       English      211.0
  A13                               English Opening      211.0
  B32                              Sicilian defense      211.0
  D51                                           QGD      211.0
  E15                                Queen's Indian      211.0
  A49                                 King's Indian      209.0
  C05                                        French      208.0
  D90                                     Gruenfeld      208.0
  B50                                      Sicilian      207.0
  E60                         King's Indian defense      207.0
  A25                                       English      205.0
  C55 Two knights defense (Modern Bishop's Opening)      205.0
  D82                                     Gruenfeld      205.0
  B10                                     Caro-Kann      204.0
  B20                                      Sicilian      204.0
  C08                                        French      204.0
  C60                                     Ruy Lopez      204.0
  E14                                Queen's Indian      204.0
  A16                               English Opening      203.0
  A20                               English Opening      203.0
  C43                                        Petrov      203.0
  E10                             Queen's pawn game      203.0
  A57                                  Benko gambit      202.0
  D10          QGD Slav defense, Alekhine Variation      202.0
  A30                                       English      200.0
  A15                               English Opening      199.0
  C57                           Two knights defense      199.0
  D03          Torre attack (Tartakower Variation )      199.0
  E30                                  Nimzo-Indian      199.0
  B30                                      Sicilian      198.0
  A46                             Queen's pawn game      197.0
  A48                                 King's Indian      197.0
  B22                                      Sicilian      197.0
  C53                                  Giuoco Piano      197.0
  E24                                  Nimzo-Indian      197.0
  C00                                        French      196.0
  D21                                           QGA      196.0
  C15                                        French      195.0
  A34                                       English      194.0
  C24                              Bishop's Opening      194.0
  E61                  King's Indian defense, 3.Nc3      194.0
  A45  Trompovsky attack (Ruth, Opovcensky Opening)      193.0
  B90                                      Sicilian      193.0
  D31                                           QGD      193.0
  D85                                     Gruenfeld      192.0
  C42                     Petrov Three knights game      191.0
  C64                                     Ruy Lopez      190.0
  C65                                     Ruy Lopez      190.0
  B23                                      Sicilian      189.0
  E70                                 King's Indian      189.0
  A56                                Benoni defense      188.0
  A21         English, Kramnik-Shirov counterattack      187.0
  D02                           Queen's Bishop game      187.0
  B27                                      Sicilian      185.0
  B40                              Sicilian defense      184.0
  E00                               Catalan Opening      184.0
  E32                                  Nimzo-Indian      183.0
  A27                                       English      180.0
  C10                                        French      179.0
  A18                                       English      178.0
  C11                                        French      178.0
  C50                                  Giuoco Piano      178.0
  D70                         Neo-Gruenfeld defense      176.0
  D20                                           QGA      174.0
  A19                                       English      173.0
  C03                                        French      168.0
  C16                                        French      168.0
  E12                                Queen's Indian      165.0
  C69                                     Ruy Lopez      163.0
  </code></pre>
  <h5>python source</h5>
  <pre><code>&quot;&quot;&quot;
  game src: http://www.fastgm.de/10min.html
  
  Dependencies:
     pip install chess
     pip install pandas
  &quot;&quot;&quot;
  
  import chess.pgn
  import pandas as pd
  
  
  fn = 'Top10-10min.pgn'
  
  data = []
  
  with open(fn, 'r') as f:
      while True:
          game = chess.pgn.read_game(f)
          if game is None:
              break
  
          plycnt = int(game.headers['PlyCount'])
          eco = game.headers['ECO']
          opening = game.headers['Opening']
          data.append([eco, opening, plycnt])
  
  df = pd.DataFrame(data)
  df.columns = ['eco', 'opening', 'plies']
  df.to_csv('plies.csv', index=False)
  
  print(f'file: {fn}')
  print('src: http://www.fastgm.de/10min.html')
  print('Game Ply Stats')
  
  print(f'Average: {df[&quot;plies&quot;].mean().round()}')
  print(f'Minimum: {df[&quot;plies&quot;].min()}')
  print(f'Maximum: {df[&quot;plies&quot;].max()}')
  print(f'Stdev: {df[&quot;plies&quot;].std().round()}')
  
  df1 = df.groupby('eco', as_index=False, sort=False).agg({'plies': 'mean', 'eco': 'first', 'opening': 'first'})
  df1.plies = df1.plies.round()
  df1 = df1.rename(columns={'plies': 'ave_plies'})
  df1 = df1[['eco', 'opening', 'ave_plies']]
  
  print(f'Average plies by ECO')
  df1 = df1.sort_values(by=['ave_plies', 'eco'], ascending=[False, True])
  print(df1.to_string(index=False))
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T05:13:22.477Z
Answers.LastActivityDate: 2022-05-25T01:27:05.910Z
Answers.LastEditDate: 2022-05-25T01:27:05.910Z
Answers.UserDisplayName: ferdy
Answers.Body: <p>In a pure sense, you would have to play out (virtually simulate) all possible games and then take the average number of moves across all of them.</p>
  <p>You could start with the <a href="https://en.wikipedia.org/wiki/Shannon_number" rel="nofollow noreferrer">Shannon Number</a> as an idea of roughly how much computing power you would need (hint: it's more than is available in our universe) but since it's based on estimating the average game length it wouldn't work for determining that length itself without enumerating all of possible games.</p>
  <p>What is more interesting is to look at the number of possible moves after each number of plies as well as the number of checkmates (or more generally, any end of the game).   For the first 9 plies one in 6095 games has ended in checkmate, but comparing to 1 in 8628 for the first 8 plies, 1 in 8334 for the first 7 plies, and 1 in 10996 for the first 6 plies (as well as a little common sense) it's obvious that the percentage of checkmates after a given ply, while not always increasing, is tending in that direction.  If you plotted this curve of percentage of games ended by the nth ply you <em>might</em> (assuming the path isn't too chaotic) start to estimate how the curve might continue past the limits of your computations and get a rough guess as to the average length.</p>
  <p>Best case with some smoothing you might find some kind of bell-like curve where most games end in the middle, with a few obvious truncation artifacts from things like the 50 move rule preventing a long tail.</p>
  <p>You could also try a Monte Carlo simulation of games randomly chosen from legal moves. While most paths on the game tree consist of lots of moves that make no strategic or tactical sense, this might give you a &quot;truer&quot; picture of the actual average length of the whole game tree.  Or if you are only interested in certain types of games you could create games played between computers of various strengths.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T21:39:19.653Z
Answers.LastActivityDate: 2022-05-24T21:39:19.653Z
Answers.UserDisplayName: Michael
Body: <p>Is there a way to figure out the average number of moves of a game? Looking at games on record, it is 40 or so. OK, but what about in pure chess sense? For instance, I was looking at game in which one player won Queen for Rook in the middle game. After a few moves the weaker side resigned. Fair enough. But playing the game out to the final result took seventy or so more moves! The number of moves on record does not reflect the actual logical number of moves of which a game should consist.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T15:45:20.590Z
Comments.Text: So, should we ever solve chess, the "logical number of moves of which a game should consist" will be zero, right? :)
Comments.UserDisplayName: AakashM
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T17:03:37.777Z
Comments.Text: @AakashM: Exactly. In the improbable case White wins the starting position, we could give the longest variant until mate, though, so a number would make sense.
Comments.UserDisplayName: Hauke Reddmann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T18:39:14.000Z
Comments.Text: It took seventy or more moves presumably with an engine playing both sides close-to-perfectly (or more precisely an endgame table). That doesn't mean the two players would have taken 70 moves to mate if they continued playing, the player in losing position would most likely make more suboptimal moves than the other player and shorten the mating process significantly. I mean, look at the marathon Carlsen/Nepo game (https://www.chess.com/analysis/game/pgn/5H2V3LF8r2), there were long stretches where it was a dead draw by the engine. Is the logical end of that game the first time that happens?
Comments.UserDisplayName: llama
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T20:16:22.917Z
Comments.Text: Is this a purely game theoretic question asking about what happens in the case of optimal play? Or is this asking about actual real games played by human players who make mistakes?
Comments.UserDisplayName: Shufflepants
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T20:54:44.217Z
Comments.Text: @comic4relief It's absolutely crucial to answer Shufflepants' question. Are you asking (a) consider the resignation point of human games, then calculate the game-theoretic distance to mate in those positions (i.e. the fewest moves within which the winning-eval side can theoretically force mate) - this is the way Hauke Redmann has taken the question (and also my first impression); or, (b) how long would the human games last if resignation were not an allowed part of the game and the two humans played their sides out to checkmate (as Brian Towers and user21820 have taken it in their answers).
Comments.UserDisplayName: Mobeus Zoom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T20:58:10.580Z
Comments.Text: Without this clarity, I would say the question should be closed. In any case, despite user21820's fairly valiant attempt, it seems hard to believe any reasonable answer is possible in case (b). There are just way too many variables, including psychology (by resignation point, the loser-to-be likely will not play his best in defending the position; but who knows? We hardly have data how humans play past resignation point).
Comments.UserDisplayName: Mobeus Zoom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-24T21:15:27.070Z
Comments.Text: Can you explain what difference it might make if all games were played to completion? What other options do you see?
Comments.UserDisplayName: Robbie Goodwin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-25T07:51:11.650Z
Comments.Text: So, you would like to check database for average number of moves for just the games that were played by actual players to completion? Or do you want to also include those games where engine sees a forced checkmate in N from final position? Or even give the position in which players stopped playing to an engine and let it play itself until checkmate/draw? I believe these will all lead to different answers. Former two should keep number of moves somewhat manageable - say 50 instead of 40 on average. Last can give you astronomical number of moves.
Comments.UserDisplayName: Zizy Archer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-25T13:17:54.577Z
Comments.Text: Could one not construct a scenario with an  "almost" infinite number of moves, assuming neither gave up.  I suppose there would be a large finite number where moves would be repeated, but in practice, it would never be reached.
Comments.UserDisplayName: JosephDoggie
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-25T23:07:54.577Z
Comments.Text: How would you define the "logical number of moves" in the case of an agreed draw?  For example, you can play out a drawn KR vs. KR position to completion by immediately trading rooks to reach a dead position, repeating three times, or shuffling pieces around for 50 moves.  Which of these is the most "logical" to you?
Comments.UserDisplayName: Ravi Fernando
Tags: <statistics>
Title: Is there a way to figure out what the average number of moves would be if all games were played to completion?
ThreadText: # Is there a way to figure out what the average number of moves would be if all games were played to completion?
  
  (Asked by: username_0 on 2022-05-23)
  
  Is there a way to figure out the average number of moves of a game? Looking at games on record, it is 40 or so. OK, but what about in pure chess sense? For instance, I was looking at game in which one player won Queen for Rook in the middle game. After a few moves the weaker side resigned. Fair enough. But playing the game out to the final result took seventy or so more moves! The number of moves on record does not reflect the actual logical number of moves of which a game should consist.
  
  **Tags:** statistics
  
  > **Comments:**
  > **username_1**: So, should we ever solve chess, the "logical number of moves of which a game should consist" will be zero, right? :)  
  > **username_2**: @username_1: Exactly. In the improbable case White wins the starting position, we could give the longest variant until mate, though, so a number would make sense.  
  > **username_3**: It took seventy or more moves presumably with an engine playing both sides close-to-perfectly (or more precisely an endgame table). That doesn't mean the two players would have taken 70 moves to mate if they continued playing, the player in losing position would most likely make more suboptimal moves than the other player and shorten the mating process significantly. I mean, look at the marathon Carlsen/Nepo game (https://www.chess.com/analysis/game/pgn/5H2V3LF8r2), there were long stretches where it was a dead draw by the engine. Is the logical end of that game the first time that happens?  
  > **username_4**: Is this a purely game theoretic question asking about what happens in the case of optimal play? Or is this asking about actual real games played by human players who make mistakes?  
  > **username_5**: @username_0 It's absolutely crucial to answer username_4' question. Are you asking (a) consider the resignation point of human games, then calculate the game-theoretic distance to mate in those positions (i.e. the fewest moves within which the winning-eval side can theoretically force mate) - this is the way Hauke Redmann has taken the question (and also my first impression); or, (b) how long would the human games last if resignation were not an allowed part of the game and the two humans played their sides out to checkmate (as username_10 and username_14 have taken it in their answers).  
  > **username_5**: Without this clarity, I would say the question should be closed. In any case, despite username_14's fairly valiant attempt, it seems hard to believe any reasonable answer is possible in case (b). There are just way too many variables, including psychology (by resignation point, the loser-to-be likely will not play his best in defending the position; but who knows? We hardly have data how humans play past resignation point).  
  > **username_6**: Can you explain what difference it might make if all games were played to completion? What other options do you see?  
  > **username_7**: So, you would like to check database for average number of moves for just the games that were played by actual players to completion? Or do you want to also include those games where engine sees a forced checkmate in N from final position? Or even give the position in which players stopped playing to an engine and let it play itself until checkmate/draw? I believe these will all lead to different answers. Former two should keep number of moves somewhat manageable - say 50 instead of 40 on average. Last can give you astronomical number of moves.  
  > **username_8**: Could one not construct a scenario with an  "almost" infinite number of moves, assuming neither gave up.  I suppose there would be a large finite number where moves would be repeated, but in practice, it would never be reached.  
  > **username_9**: How would you define the "logical number of moves" in the case of an agreed draw?  For example, you can play out a drawn KR vs. KR position to completion by immediately trading rooks to reach a dead position, repeating three times, or shuffling pieces around for 50 moves.  Which of these is the most "logical" to you?  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_10 on 2022-05-23. Score: 17
  
  > Is there a way to figure out the average number of moves of a game?
  
  The best way is to run a program which goes through a large database of games and calculates the average number of moves per game.
  
  > The number of moves on record does not reflect the actual logical number of moves of which a game should consist.
  
  Games of chess are played between players of many different strengths. The "logical number of moves" a game should last after a particular position, even one where one player has lost queen for rook, will depend on the strengths of the two players and what mistakes they make on the way to finishing the game. That means that there is no "logical number of moves of which a game should consist". There is only the actual number of moves of the game.
  
  > **Comments:**
  > **username_11**: Well, in theory you could expand out the entire game tree and exhaustively count up how deep every single branch is, then take some sort of average. But to the best of my understanding, there is no efficient way to do it, and the brute force method is obviously wildly impossible.  
  > **username_12**: Seeing as the Shannon number is ~10^40 greater than the number of atoms in the observable universe, I would have to agree that brute force is not even worth a glance for this type of problem.  
  > **username_13**: You could input all the recorded tournament games, up until one player resigns, and feed that position into Stockfish or whatever and see how many more moves it would've taken to actually mate, then calculate *those* averages.  Not sure what the value of that exercise would be though.  Doing every possible game is absurd, because the vast majority of *possible* games would never happen in reality if both players are actually trying to, you know, *win*...  
  
  ---
  
  ### Answer by username_14 on 2022-05-24. Score: 6
  
  Since actual games are almost always imperfect play, there is no **logical** number of moves from a given position, since the actual players would generally not play perfectly if forced to continue the game to the end. However, you can probably estimate the number of moves it would take a given pair of human players P1,P2 to finish a game past a resignation, by calibrating computer players C1,C2 to play similarly to each of them, and then using C1,C2 to finish the game! From this you can then obtain an estimate of the **average** number of moves that P1,P2 would take per chess game that they played but stopped upon resignation.
  
  The question then is, how can we calibrate computer players? A crude first-order approximation is as follows: Measure the centipawn loss distribution f of the human player over the opening and the middle-game and the end-game, according to an engine like StockFish. Then construct a smoothed version F of the cumulative function for f. Now make the computer player choose each move such that the smoothed cumulative function for the centipawn loss distribution for the chosen move is as close as possible to F!
  
  Better approximations are of course not hard to achieve. Just like Lichess can tailor puzzles to your weaknesses, which are all automatically computed, so also you can have different loss distributions for different types of moves (treating each position as a puzzle). It doesn't matter if the categories are humanly crafted (e.g. forks, pins, skewers, ...), because the goal is just to get a better result and not necessarily converge to a perfect simulation.
  
  > **Comments:**
  > **username_5**: This is a good answer with a bunch of interesting stuff regarding mimicking human play, but in this one particular case it's probably not sufficient, because we simply don't have data regarding how P1,P2 will play past resignation point, as they don't tend to play these positions (that's the rub: they've resigned by then!).  
  > **username_14**: @MobeusZoom: True, but we have to make simplifying assumptions if we want to get anything at all. Suppose that we want to know what happens if the world chess federation changes the rules to forbid resignation, just before a tournament. Then how would P1,P2 play in that tournament? Suppose that this does not affect their play up to the point where P1 would want to resign in the original world. Suppose further that the stakes are high, so P1 won't just concede defeat by making a silly move. Then our best estimate is to categorize each subsequent position so as to guess how P1,P2 would play.  
  > **username_5**: @user2180 Agreed. My only point is that the error bars are likely to be very large, because the same positions we are trying to make predictions about here are the very positions we don't have data about because resignation has occurred before them by definition. If the rules were changed as you suggest, we could start collecting that data and I guess considerably shorten the error bars quite quickly.  
  
  ---
  
  ### Answer by username_15 on 2022-05-24. Score: 3
  
  Here are the results based from the games at TC 10minutes + 6s inc. The games are not adjudicated. You can download the games at http://www.fastgm.de/10min.html.
  These games have PlyCount tag, we can use this to get the approximate average number of moves on the games. You can use python chess modules to do this.
  pgn file: Top10-10min.pgn
  average ply: 198
  approximate average number of moves: 99
  
  Python code
  import chess
  import chess.pgn
  import statistics
  
  
  fn = 'Top10-10min.pgn'
  
  data = []
  
  with open(fn, 'r') as f:
      while True:
          game = chess.pgn.read_game(f)
          if game is None:
              break
  
          plycnt = int(game.headers['PlyCount'])
          data.append(plycnt)
  
  
  print(f'average ply: {statistics.mean(data)}, approximate average number of moves: {statistics.mean(data)//2}')
  
  Other stats on ply numbers.
  file: Top10-10min.pgn
  src: http://www.fastgm.de/10min.html
  
  Game Ply Stats
  Average: 198.0
  Minimum: 25
  Maximum: 909
  Stdev: 96.0
  
  Average plies by ECO
  eco                                       opening  ave_plies
  D80                                     Gruenfeld      225.0
  E45                                  Nimzo-Indian      222.0
  A17                                       English      221.0
  E20                                  Nimzo-Indian      218.0
  E11      Bogo-Indian defense, Gruenfeld Variation      216.0
  E22                                  Nimzo-Indian      215.0
  C07                                        French      214.0
  D30                       Queen's gambit declined      214.0
  B17                                     Caro-Kann      213.0
  C70                                     Ruy Lopez      213.0
  A11                                       English      211.0
  A13                               English Opening      211.0
  B32                              Sicilian defense      211.0
  D51                                           QGD      211.0
  E15                                Queen's Indian      211.0
  A49                                 King's Indian      209.0
  C05                                        French      208.0
  D90                                     Gruenfeld      208.0
  B50                                      Sicilian      207.0
  E60                         King's Indian defense      207.0
  A25                                       English      205.0
  C55 Two knights defense (Modern Bishop's Opening)      205.0
  D82                                     Gruenfeld      205.0
  B10                                     Caro-Kann      204.0
  B20                                      Sicilian      204.0
  C08                                        French      204.0
  C60                                     Ruy Lopez      204.0
  E14                                Queen's Indian      204.0
  A16                               English Opening      203.0
  A20                               English Opening      203.0
  C43                                        Petrov      203.0
  E10                             Queen's pawn game      203.0
  A57                                  Benko gambit      202.0
  D10          QGD Slav defense, Alekhine Variation      202.0
  A30                                       English      200.0
  A15                               English Opening      199.0
  C57                           Two knights defense      199.0
  D03          Torre attack (Tartakower Variation )      199.0
  E30                                  Nimzo-Indian      199.0
  B30                                      Sicilian      198.0
  A46                             Queen's pawn game      197.0
  A48                                 King's Indian      197.0
  B22                                      Sicilian      197.0
  C53                                  Giuoco Piano      197.0
  E24                                  Nimzo-Indian      197.0
  C00                                        French      196.0
  D21                                           QGA      196.0
  C15                                        French      195.0
  A34                                       English      194.0
  C24                              Bishop's Opening      194.0
  E61                  King's Indian defense, 3.Nc3      194.0
  A45  Trompovsky attack (Ruth, Opovcensky Opening)      193.0
  B90                                      Sicilian      193.0
  D31                                           QGD      193.0
  D85                                     Gruenfeld      192.0
  C42                     Petrov Three knights game      191.0
  C64                                     Ruy Lopez      190.0
  C65                                     Ruy Lopez      190.0
  B23                                      Sicilian      189.0
  E70                                 King's Indian      189.0
  A56                                Benoni defense      188.0
  A21         English, Kramnik-Shirov counterattack      187.0
  D02                           Queen's Bishop game      187.0
  B27                                      Sicilian      185.0
  B40                              Sicilian defense      184.0
  E00                               Catalan Opening      184.0
  E32                                  Nimzo-Indian      183.0
  A27                                       English      180.0
  C10                                        French      179.0
  A18                                       English      178.0
  C11                                        French      178.0
  C50                                  Giuoco Piano      178.0
  D70                         Neo-Gruenfeld defense      176.0
  D20                                           QGA      174.0
  A19                                       English      173.0
  C03                                        French      168.0
  C16                                        French      168.0
  E12                                Queen's Indian      165.0
  C69                                     Ruy Lopez      163.0
  
  python source
  """
  game src: http://www.fastgm.de/10min.html
  
  Dependencies:
     pip install chess
     pip install pandas
  """
  
  import chess.pgn
  import pandas as pd
  
  
  fn = 'Top10-10min.pgn'
  
  data = []
  
  with open(fn, 'r') as f:
      while True:
          game = chess.pgn.read_game(f)
          if game is None:
              break
  
          plycnt = int(game.headers['PlyCount'])
          eco = game.headers['ECO']
          opening = game.headers['Opening']
          data.append([eco, opening, plycnt])
  
  df = pd.DataFrame(data)
  df.columns = ['eco', 'opening', 'plies']
  df.to_csv('plies.csv', index=False)
  
  print(f'file: {fn}')
  print('src: http://www.fastgm.de/10min.html')
  print('Game Ply Stats')
  
  print(f'Average: {df["plies"].mean().round()}')
  print(f'Minimum: {df["plies"].min()}')
  print(f'Maximum: {df["plies"].max()}')
  print(f'Stdev: {df["plies"].std().round()}')
  
  df1 = df.groupby('eco', as_index=False, sort=False).agg({'plies': 'mean', 'eco': 'first', 'opening': 'first'})
  df1.plies = df1.plies.round()
  df1 = df1.rename(columns={'plies': 'ave_plies'})
  df1 = df1[['eco', 'opening', 'ave_plies']]
  
  print(f'Average plies by ECO')
  df1 = df1.sort_values(by=['ave_plies', 'eco'], ascending=[False, True])
  print(df1.to_string(index=False))
  
  
  ---
  
  ### Answer by username_16 on 2022-05-24. Score: 1
  
  In a pure sense, you would have to play out (virtually simulate) all possible games and then take the average number of moves across all of them.
  
  You could start with the [Shannon Number](https://en.wikipedia.org/wiki/Shannon_number) as an idea of roughly how much computing power you would need (hint: it's more than is available in our universe) but since it's based on estimating the average game length it wouldn't work for determining that length itself without enumerating all of possible games.
  
  What is more interesting is to look at the number of possible moves after each number of plies as well as the number of checkmates (or more generally, any end of the game). For the first 9 plies one in 6095 games has ended in checkmate, but comparing to 1 in 8628 for the first 8 plies, 1 in 8334 for the first 7 plies, and 1 in 10996 for the first 6 plies (as well as a little common sense) it's obvious that the percentage of checkmates after a given ply, while not always increasing, is tending in that direction. If you plotted this curve of percentage of games ended by the nth ply you *might* (assuming the path isn't too chaotic) start to estimate how the curve might continue past the limits of your computations and get a rough guess as to the average length.
  
  Best case with some smoothing you might find some kind of bell-like curve where most games end in the middle, with a few obvious truncation artifacts from things like the 50 move rule preventing a long tail.
  
  You could also try a Monte Carlo simulation of games randomly chosen from legal moves. While most paths on the game tree consist of lots of moves that make no strategic or tactical sense, this might give you a "truer" picture of the actual average length of the whole game tree. Or if you are only interested in certain types of games you could create games played between computers of various strengths.
  
  
  ---
  
  