Answers.Body: <p>Upper bounds on the number of allowable positions are discussed on the <a href="http://en.wikipedia.org/wiki/Shannon_number" rel="nofollow noreferrer">Shannon number</a>  Wikipedia page.</p>
  <p>There is an accepted upper bound of 1.8x10^46 by Shirish Chinchalkar, and an accurate estimate of 4.8x10^44 by <a href="https://github.com/tromp/ChessPositionRanking" rel="nofollow noreferrer">John Tromp</a>.</p>
  <p>By comparison, the number of atoms on earth is about 10^50.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-07T11:50:15.873Z
Answers.Text: @JohnTromp Do you have a new reference?
Answers.UserDisplayName: Dag Oskar Madsen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-07T13:11:57.757Z
Answers.Text: @JohnTromp and 'accurate' is subjective - you might want to add the uncertainty.
Answers.UserDisplayName: Glorfindel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-07T20:15:23.003Z
Answers.Text: @user30536 since the editor is the one being quoted, it makes sense, but we (the Chess.SE community) may roll it back if no clarification follows.
Answers.UserDisplayName: Glorfindel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-08T12:24:52.293Z
Answers.Text: For reference, see the section "Estimation from million sized samples" in the given link. Which also shows my objective use of "accurate", in that the 95% error bounds justify 2 digits of precision.
Answers.UserDisplayName: John Tromp
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-16T09:34:10.273Z
Answers.Text: The article fairly estimates the positions to be close to 10^50. Link is http://www.nwchess.com/articles/misc/Chess_Board_Positions_article.pdf
Answers.UserDisplayName: shoonya
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-16T10:11:38.473Z
Answers.Text: However this can be computed to a far better estimate, especially the cases when Kings are already in checks, Kings are simultaneously in check. The key thing being estimating this can allow us to typically find the optimal moves for a given position.
Answers.UserDisplayName: shoonya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2014-06-15T08:44:27.560Z
Answers.LastActivityDate: 2023-03-07T13:10:51.170Z
Answers.LastEditDate: 2023-03-07T13:10:51.170Z
Answers.UserDisplayName: Dag Oskar Madsen
Answers.Body: <p>Old question, but for people who just want a quick estimate they can do with basic math this is an easy way to go about it</p>
  <p>If we consider all 32 pieces, we can rearrange them P(64,32) or 64 permute 32 ways. If we then consider 31 pieces, we do the same as above with P(64,31) but this time we must factor in the choice of 31 out of the 32 pieces so we multiply P(64,31) by C(32,31) or 32 choose 31. If we continue along this manner we have the sum from n =2 to 32 of P(64,n)C(32,n) which gives <strong>1.24e54</strong> which is only a few orders of magnitude larger than the number given by Vicor Allis.</p>
  <p>Note that in the assumptions, we allowed illegal positions, and double or triple counted certain positions by treating each piece as distinct. But the number is reasonable compared to that above and more importantly is easily attainable with pretty basic math.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-21T04:58:29.243Z
Answers.Text: @DagOskarMadsen I did notice you have a PhD in math, so does this upper bound seem reasonable or is there a way to improve it?
Answers.UserDisplayName: Colin Hicks
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-21T12:32:13.077Z
Answers.Text: It's a start. You also have to take promotions into account which will make this bound much larger.
Answers.UserDisplayName: Dag Oskar Madsen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-21T17:24:33.733Z
Answers.Text: @DagOskarMadsen ah yes. I changed C(32,n) to C(96,n) to allow for all 16 pawns to assume the identity of the 4 other piece types other than king but now the value is 1.454e79 which is fairly off the mark haha
Answers.UserDisplayName: Colin Hicks
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-21T18:18:32.023Z
Answers.Text: Wikipedia mentions 2x10^40 as the best known upper bound without promotions.
Answers.UserDisplayName: Dag Oskar Madsen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-21T04:54:29.163Z
Answers.LastActivityDate: 2020-07-21T04:54:29.163Z
Answers.UserDisplayName: Colin Hicks
Answers.Body: <p>Here is a Python script that gives an upper bound of <strong>~10^51.431 positions (legal and illegal). Moreover, the script doesn't check for legality of positions or if a position is reachable, so the proportion of legal positions should be a few orders of magnitude lower.</strong> A bootstrap approach can be used to approximate this proportion.</p>
  <p>Note the following variables are updated:</p>
  <pre><code>squaresAvailable = Number of squares available to use
  whiteProm = Maximum number in promotions available on the position for white pieces
  blackProm = Maximum number in promotions available on the position for black pieces
  </code></pre>
  <pre><code>import math
  sum = 0
  tosum = 43
  for whitepawn in range(9): #whitepawn is the number of white pawns on the board (0 to 8)
      #wp represents the number of ways to arrange a given number of white pawns
      wp = math.comb(48, whitepawn)
      whiteProm = 8 - whitepawn
      blackProm = 8
      
      for blackpawn in range(9):
          bp = math.comb(48 - whitepawn, blackpawn)
          whiteProm = 8 - whitepawn
          blackProm = 8 - blackpawn
          squaresAvailable = 62 - whitepawn - blackpawn
          
          for whitelsbishop in range(2 + max(whiteProm, 0)):
              squaresAvailable =  62 - whitepawn - blackpawn - whitelsbishop
              wbls = math.comb(math.ceil(squaresAvailable/2), whitelsbishop)
              whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1)
              blackProm = 8 - blackpawn
              
              for blacklsbishop in range(2 + max(blackProm, 0)):
                  squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop
                  bbls = math.comb(math.ceil(squaresAvailable/2), blackbishop)
                  whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1)
                  blackProm = 8 - blackpawn - max(0, blacklsbishop - 1)
  
                  for whitedsbishop in range(2 + max(whiteProm, 0)):
                      squaresAvailable =  62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop
                      wbds = math.comb(math.ceil(squaresAvailable/2), whitedsbishop)
                      whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1)
                      blackProm = 8 - blackpawn - max(0, blacklsbishop - 1)
  
                      for blackdsbishop in range(2 + max(whiteProm, 0)):
                          squaresAvailable =  62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop
                          bbds = math.comb(math.ceil(squaresAvailable/2), whitedsbishop)
                          whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1)
                          blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1)
                      
                          for whitenight in range(3 + max(whiteProm, 0)):
                              squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight
                              wn = math.comb(squaresAvailable, whitenight)
                              whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2)
                              blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1)
                              
                              for blacknight in range(3 + max(blackProm, 0)):
                                  squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight
                                  bn = math.comb(squaresAvailable, blacknight)
                                  whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2)
                                  blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2)   
          
                                  for whiterook in range(3 + max(whiteProm, 0)):
                                      squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook
                                      wr = math.comb(squaresAvailable, whiterook)
                                      whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2) - max(0, whiterook - 2)
                                      blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2)
                                      
                                      for blackrook in range(3 + max(blackProm, 0)):
                                          squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook - blackrook
                                          br = math.comb(squaresAvailable, blackrook)
                                          whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2) - max(0, whiterook - 2)
                                          blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2) - max(0, blackrook - 2)
                                          
                                          for whitequeen in range(2 + max(whiteProm, 0)):
                                              squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook - blackrook - whitequeen
                                              wq = math.comb(squaresAvailable, whitequeen)
                                              whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2) - max(0, whiterook - 2) - max(0, whitequeen -1)
                                              blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2) - max(0, blackrook - 2)
          
                                              for blackqueen in range(2 + max(blackProm, 0)):
                                                  squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook - blackrook - whitequeen - blackqueen
                                                  bq = math.comb(squaresAvailable, blackqueen)
                                                  blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2) - max(0, blackrook - 2) - max(0, blackqueen -1 )
                                                  sum = sum + wp * bp * wbls * bbls * bbds * wbds * wn * bn * wr * br * wq * bq
                                                      
                                      
  #64 squares available for white king and 63 for black king as an upper bound
  print(math.log10(sum * 64 * 63))
  </code></pre>
  <pre><code>OUTPUT: 51.43108306627925
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-19T14:36:00.033Z
Answers.Text: Symmetrical positions? Positions that are not feasible? legal positions - we are hoping this shall be a big number
Answers.UserDisplayName: shoonya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-19T15:40:33.577Z
Answers.Text: All symmetrical positions are considered. The script doesn't check for legal positions is not implemented, although I have a few ideas to minimize the number of illegal positions. The result (10^51.431) is absolutely a huge number.
Answers.UserDisplayName: Yash Jain
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-19T05:52:47.683Z
Answers.LastActivityDate: 2024-03-19T06:29:50.000Z
Answers.LastEditDate: 2024-03-19T06:29:50.000Z
Answers.UserDisplayName: Yash Jain
Answers.Body: <p>It is really difficult to find out legal positions but total positions possible is <code>13^64</code> , assuming each piece can be positioned in every  available square</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-08T12:36:47.690Z
Answers.LastActivityDate: 2021-07-08T12:36:47.690Z
Answers.UserDisplayName: RAHUL JAISWAL
Body: <p>There have been several questions regarding the possible number of chess games. for example; <a href="https://chess.stackexchange.com/questions/2422/database-of-every-possible-move-in-chess">Database of every possible move in chess</a>. However,can there be an estimate on the number of &quot;allowable&quot; chess positions?</p>
  <p>For another example, White pawns cannot occupy the first row and Black pawns cannot occupy the eighth row. If a given chess piece is occupying a square, then another chess piece cannot occupy that. Using simple elimination rules coded, can we have an estimate on the number of unique positions that chess pieces can have since they would be reducing in number? An upper bound on positions before applying any elimination rules would be the sum of (64 C 32 + 64 C 32 ... + 64 C 2). This is less than 10^20. With elimination rules, they should be significantly lower.</p>
  <p>Any ideas on how elimination rules are written for chess pieces?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-06-16T10:36:01.993Z
Comments.Text: Your estimate is too low. You shouldn't just compute combinations, it matters which pieces are on which squares.
Comments.UserDisplayName: Dag Oskar Madsen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-27T12:25:18.390Z
Comments.Text: The maths goes like you choose the 32 squares possible, and find number of pieces you can place on each square.  Then multiply 64 C 32
Comments.UserDisplayName: QuIcKmAtHs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-08T15:39:19.357Z
Comments.Text: The number of legal chess positions is roughly 4x10^44: https://github.com/tromp/ChessPositionRanking
Comments.UserDisplayName: John Tromp
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-06T18:02:20.087Z
Comments.Text: Does this answer your question? [Is the number of possible chess games infinite?](https://chess.stackexchange.com/questions/8331/is-the-number-of-possible-chess-games-infinite)
Comments.UserDisplayName: BCLC
Tags: <mathematics><game-complexity>
Title: What is the number of legal positions in a chess game?
ThreadText: # What is the number of legal positions in a chess game?
  
  (Asked by: username_0 on 2014-06-15)
  
  There have been several questions regarding the possible number of chess games. for example; [Database of every possible move in chess](https://chess.stackexchange.com/questions/2422/database-of-every-possible-move-in-chess). However,can there be an estimate on the number of "allowable" chess positions?
  
  For another example, White pawns cannot occupy the first row and Black pawns cannot occupy the eighth row. If a given chess piece is occupying a square, then another chess piece cannot occupy that. Using simple elimination rules coded, can we have an estimate on the number of unique positions that chess pieces can have since they would be reducing in number? An upper bound on positions before applying any elimination rules would be the sum of (64 C 32 + 64 C 32 ... + 64 C 2). This is less than 10^20. With elimination rules, they should be significantly lower.
  
  Any ideas on how elimination rules are written for chess pieces?
  
  **Tags:** mathematics, game-complexity
  
  > **Comments:**
  > **username_1**: Your estimate is too low. You shouldn't just compute combinations, it matters which pieces are on which squares.  
  > **username_2**: The maths goes like you choose the 32 squares possible, and find number of pieces you can place on each square.  Then multiply 64 C 32  
  > **username_3**: The number of legal chess positions is roughly 4x10^44: https://github.com/tromp/ChessPositionRanking  
  > **username_4**: Does this answer your question? [Is the number of possible chess games infinite?](https://chess.stackexchange.com/questions/8331/is-the-number-of-possible-chess-games-infinite)  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2014-06-15. Score: 9
  
  Upper bounds on the number of allowable positions are discussed on the [Shannon number](http://en.wikipedia.org/wiki/Shannon_number) Wikipedia page.
  
  There is an accepted upper bound of 1.8x10^46 by Shirish Chinchalkar, and an accurate estimate of 4.8x10^44 by [username_3](https://github.com/tromp/ChessPositionRanking).
  
  By comparison, the number of atoms on earth is about 10^50.
  
  > **Comments:**
  > **username_0**: The article fairly estimates the positions to be close to 10^50. Link is http://www.nwchess.com/articles/misc/Chess_Board_Positions_article.pdf  
  > **username_0**: However this can be computed to a far better estimate, especially the cases when Kings are already in checks, Kings are simultaneously in check. The key thing being estimating this can allow us to typically find the optimal moves for a given position.  
  > **username_1**: @JohnTromp Do you have a new reference?  
  > **username_5**: @JohnTromp and 'accurate' is subjective - you might want to add the uncertainty.  
  > **username_5**: @user30536 since the editor is the one being quoted, it makes sense, but we (the Chess.SE community) may roll it back if no clarification follows.  
  > **username_3**: For reference, see the section "Estimation from million sized samples" in the given link. Which also shows my objective use of "accurate", in that the 95% error bounds justify 2 digits of precision.  
  
  ---
  
  ### Answer by username_6 on 2020-07-21. Score: 2
  
  Old question, but for people who just want a quick estimate they can do with basic math this is an easy way to go about it
  
  If we consider all 32 pieces, we can rearrange them P(64,32) or 64 permute 32 ways. If we then consider 31 pieces, we do the same as above with P(64,31) but this time we must factor in the choice of 31 out of the 32 pieces so we multiply P(64,31) by C(32,31) or 32 choose 31. If we continue along this manner we have the sum from n =2 to 32 of P(64,n)C(32,n) which gives **1.24e54** which is only a few orders of magnitude larger than the number given by Vicor Allis.
  
  Note that in the assumptions, we allowed illegal positions, and double or triple counted certain positions by treating each piece as distinct. But the number is reasonable compared to that above and more importantly is easily attainable with pretty basic math.
  
  > **Comments:**
  > **username_6**: @DagOskarMadsen I did notice you have a PhD in math, so does this upper bound seem reasonable or is there a way to improve it?  
  > **username_1**: It's a start. You also have to take promotions into account which will make this bound much larger.  
  > **username_6**: @DagOskarMadsen ah yes. I changed C(32,n) to C(96,n) to allow for all 16 pawns to assume the identity of the 4 other piece types other than king but now the value is 1.454e79 which is fairly off the mark haha  
  > **username_1**: Wikipedia mentions 2x10^40 as the best known upper bound without promotions.  
  
  ---
  
  ### Answer by username_7 on 2024-03-19. Score: 1
  
  Here is a Python script that gives an upper bound of ~10^51.431 positions (legal and illegal). Moreover, the script doesn't check for legality of positions or if a position is reachable, so the proportion of legal positions should be a few orders of magnitude lower. A bootstrap approach can be used to approximate this proportion.
  Note the following variables are updated:
  squaresAvailable = Number of squares available to use
  whiteProm = Maximum number in promotions available on the position for white pieces
  blackProm = Maximum number in promotions available on the position for black pieces
  
  import math
  sum = 0
  tosum = 43
  for whitepawn in range(9): #whitepawn is the number of white pawns on the board (0 to 8)
      #wp represents the number of ways to arrange a given number of white pawns
      wp = math.comb(48, whitepawn)
      whiteProm = 8 - whitepawn
      blackProm = 8
      
      for blackpawn in range(9):
          bp = math.comb(48 - whitepawn, blackpawn)
          whiteProm = 8 - whitepawn
          blackProm = 8 - blackpawn
          squaresAvailable = 62 - whitepawn - blackpawn
          
          for whitelsbishop in range(2 + max(whiteProm, 0)):
              squaresAvailable =  62 - whitepawn - blackpawn - whitelsbishop
              wbls = math.comb(math.ceil(squaresAvailable/2), whitelsbishop)
              whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1)
              blackProm = 8 - blackpawn
              
              for blacklsbishop in range(2 + max(blackProm, 0)):
                  squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop
                  bbls = math.comb(math.ceil(squaresAvailable/2), blackbishop)
                  whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1)
                  blackProm = 8 - blackpawn - max(0, blacklsbishop - 1)
  
                  for whitedsbishop in range(2 + max(whiteProm, 0)):
                      squaresAvailable =  62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop
                      wbds = math.comb(math.ceil(squaresAvailable/2), whitedsbishop)
                      whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1)
                      blackProm = 8 - blackpawn - max(0, blacklsbishop - 1)
  
                      for blackdsbishop in range(2 + max(whiteProm, 0)):
                          squaresAvailable =  62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop
                          bbds = math.comb(math.ceil(squaresAvailable/2), whitedsbishop)
                          whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1)
                          blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1)
                      
                          for whitenight in range(3 + max(whiteProm, 0)):
                              squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight
                              wn = math.comb(squaresAvailable, whitenight)
                              whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2)
                              blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1)
                              
                              for blacknight in range(3 + max(blackProm, 0)):
                                  squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight
                                  bn = math.comb(squaresAvailable, blacknight)
                                  whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2)
                                  blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2)   
          
                                  for whiterook in range(3 + max(whiteProm, 0)):
                                      squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook
                                      wr = math.comb(squaresAvailable, whiterook)
                                      whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2) - max(0, whiterook - 2)
                                      blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2)
                                      
                                      for blackrook in range(3 + max(blackProm, 0)):
                                          squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook - blackrook
                                          br = math.comb(squaresAvailable, blackrook)
                                          whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2) - max(0, whiterook - 2)
                                          blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2) - max(0, blackrook - 2)
                                          
                                          for whitequeen in range(2 + max(whiteProm, 0)):
                                              squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook - blackrook - whitequeen
                                              wq = math.comb(squaresAvailable, whitequeen)
                                              whiteProm = 8 - whitepawn - max(0, whitelsbishop - 1) - max(0, whitedsbishop - 1) - max(0, whitenight - 2) - max(0, whiterook - 2) - max(0, whitequeen -1)
                                              blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2) - max(0, blackrook - 2)
          
                                              for blackqueen in range(2 + max(blackProm, 0)):
                                                  squaresAvailable = 62 - whitepawn - blackpawn - whitelsbishop - blacklsbishop - whitedsbishop - blackdsbishop - whitenight - blacknight - whiterook - blackrook - whitequeen - blackqueen
                                                  bq = math.comb(squaresAvailable, blackqueen)
                                                  blackProm = 8 - blackpawn - max(0, blacklsbishop - 1) - max(0, blackdsbishop - 1) - max(0, blacknight - 2) - max(0, blackrook - 2) - max(0, blackqueen -1 )
                                                  sum = sum + wp * bp * wbls * bbls * bbds * wbds * wn * bn * wr * br * wq * bq
                                                      
                                      
  #64 squares available for white king and 63 for black king as an upper bound
  print(math.log10(sum * 64 * 63))
  
  OUTPUT: 51.43108306627925
  
  > **Comments:**
  > **username_0**: Symmetrical positions? Positions that are not feasible? legal positions - we are hoping this shall be a big number  
  > **username_7**: All symmetrical positions are considered. The script doesn't check for legal positions is not implemented, although I have a few ideas to minimize the number of illegal positions. The result (10^51.431) is absolutely a huge number.  
  
  ---
  
  ### Answer by username_8 on 2021-07-08. Score: 1
  
  It is really difficult to find out legal positions but total positions possible is `13^64` , assuming each piece can be positioned in every available square
  
  
  ---
  
  