My son recently came up with a challenge. The idea is you will be initially given a list with 20 empty slots in it. You will then roll a random number generator that will give you a number between 1 and 1000 inclusive and you have to put the number into an empty slot in the list while endeavouring to keep the list sorted. Repeat this random number generation 20 times (or until you hit a point where you can't put the most recently generated random number into an empty slot without breaking the list ordering). "Success" means placing all 20 numbers in the list and the list being correctly sorted.
I wrote a quick Python program to play this as a game and found it very difficult to beat. So then I wrote a solver which does the best it can to place numbers "sensibly" (I can share the algorithm I used for choosing a slot if anyone is interested) and found that it typically only succeeds in filling the list 1 or 2 times in 100,000 trials (0.001 or 0.002% of the time). My intuition says it should be possible to write a solver that is a LOT better than that.
My question is: is there a way to calculate the expected success rate of the idealised solver?