Well, you basically pick a 3 or 4 digit number, scramble it, and subtract the smaller number from the larger. From the remainder, you type in all digits but one, and the game guesses the number you withheld. It's about 100% accurate.
Possible answer (if correct, credit goes to SurfaceDog):
There are actually only a small number of 4-digit combnations (much less than 8,999 actually).
Take that finite database. Now calculate the result to subracting the various anagrams with each one. This yields yet another finite database.
I would bet that every four-digit combination in that data base is unique. For example, I picked "1257", and subtracted it from "5721", yielding the number 4464. I circled the 6 and typed in "444".
Now I would bet you that, within the finite answer database, "444" appears only once - in the number 4464. Thus the program knew that 6 was the answer.
(Plus, remember that you aren't allowed to cirlce zero, by the rules of the game - this significantly reduces the size of the database).
Maybe, I don't know. Working with 4 digits, you would have 10 possibilities per position, with the exception of the first position, which can only have 9, because you can't use zero. That would mean 9,000 possibilities, with a like number of possible sums. Hmmm.....he's right, because all possible sums can be stored into a database, and they're each unique. All it takes is a little number crunching.
If it works, Gordon is down to economic genius and EU membership - else Tory boom/bust mishandling of economy.
Anyway - yeah, rule of 9 comes into it, or rule of remainders really
e.g. 5 figures
AB,CDE :: A+B+C+D+E = 'T' (Total), reorganise as
dc,bea :: d+c+b+e+a must still equal T, as they're the same numbers but we'll call it 't'
But both are a multplie of 9 WITH A REMAINDER, which is the same
The subtractions will therefore balance out, although you'll have to add 10 to some small numbers - and subtract 1 from the previous (senior) number.
Hence the individual differences will be
A-d ( poss less 1) times 10 times 10 times 10 etc
B-c (poss + 10, poss less 1) ..... you get the idea
C-b (poss + 10, poss less 1) ..... mmm
D-e (poss + 10, poss less 1) ...... etc
E-a (poss + 10 )
Or ... T (plus a multiple of 9 - more nines - who cares?) minus t, ...... in the end you're only concerned with the remainder after dividing by 9 which won't change.
....... Pauses for thought ........(and check puzzle) ...... (and slurp some coffee)
You now rearrange numbers (red herring) and remove one. All you've got is a multiple of nines plus remainder. If the remainder now is less than the remainder you started with that's it. If it's less than zero ADD 9.
MoD "On this day" 21st August - 1740: Admiral Edward Vernon, known as "Old Grogram" after the material from which his cloak was made, ordered sailors' rum ration to be served mixed with water. The mixture was quickly named grog. There's inspiration for you.