Number Of Uncompleted Tic Tac Toe Games I want to create a dataset of Tic Tac Toe games, in order to feed it into a machine learning algorithm and create a Tic Tac Toe Engine. Assuming that we have a 3 by 3 board, I want the dataset to contain:


*

*All the possible uncompleted games, so in all board states in the dataset, will be at least one empty square (Up to 8 empty squares).

*I want to keep the rotated duplicate boards.

*So the only types of games that wont be in the dataset are completed games, and invalid games, where it continues to play even if someone wins.


I created a software that computes this, and got 294777 different games. Is that number right? And regarding if it's right or wrong, how do we compute the number mathematically?
 A: http://www.se16.info/hgb/tictactoe.htm and http://www.mathrec.org/old/2002jan/solutions.html show there are $255168$ possible completed games (before symmetries reduce this to perhaps $26830$) but there will be fewer board positions
The numbers on those sites can easily be transferred to incomplete games, so your number of incomplete games of $294777$ is in a sense almost correct.  It is made up of 
     9 incomplete games with 1 move
    72 incomplete games with 2 moves
   504 incomplete games with 3 moves
  3024 incomplete games with 4 moves
 13680 incomplete games with 5 moves
 49392 incomplete games with 6 moves
100224 incomplete games with 7 moves
127872 incomplete games with 8 moves

though I think you should also add in 
     1 incomplete game  with 0 moves  

Even before symmetries, this overstates the number of positions: 


*

*for example there are only $252$ positions after $3$ moves ($38$ taking account of symmetries), all incomplete 

*overall there are $4520$ incomplete positions and $958$ completed positions ($627$ incomplete positions and $138$ completed positions taking account of symmetries)

