OK, since I am a guru.(with a couple of math degrees)... I'll try this one
This trick challenges you to pick a four digit number and then scamble it. Subtract the smaller from the larger and then without knowing the two original numbers, you are asked to produce 3 of the 4 digits in the difference and somehow from that, the remaining digit of the difference can be ascertained
Example 3192 now scramble into 9132
Subtract the smaller 3192 from 9132 and you get 5940.
You are asked to provide any three digits from 5940 and miraculously the challenger can correctly guess the remaining one without knowing the random 3192 you started with or the random scramble of 3192 into 9132...
The trick is that regardless of what number you pick (and this works for 3,4,...digits), When you pick this number, scramble the digits and subtract the smaller from the larger, the difference will always have one property and that is that if you sum the digits in this difference it will always be a multiple of 9. Why.... It would take too long to go though that.. for now take my word and try it yourself.
Now lets call the Sum of the 3 digits provided sum3 and the missing number mnum
The formula to get the missing number is simply
mnum = 9 - (sum2 mod 9)
mod or modulo provides the remainder of one number divided by another.
Syntax
dividend mod divisor
Arguments
dividend
Is the numeric expression to divide. (A modulo is the integer that remains after two integers are divided.)
divisor
Is the numeric expression to divide the dividend by.
Getting back to our example, the difference between the two digits was 5940, whose sum of digits = 18
If I give the program 5, 9, 0 the sum or these three digits is 14 (sum3)
9 - (14 mod 9) =
9 - 5 = 4, the remaining digit.
The key trick in this brain teaser is that the resulting sum of digits for difference any number and any random scrambling of this number is always a number divisible by 9.
There the secret is now divulged... go impress your neighbors,
DB