OK, that was embarrassing. Sorry. Still I don’t regret it, we wouldn’t have been treated to that wonderful analysis by Half Man Half Wit of my beloved country music otherwise.
Anyway, this is the link I was trying for. Like I said I think it’s been done before but I couldn’t find it. A friend showed me this and wondered how it worked. I said I was sure it was math formula. He countered by saying you didn’t supply the computer enough information and challenged me to provide a formula that would work. I tried and couldn’t. What I was hoping for was a lay person version of how the trick works. Thanks.
Hopefully this brief version will suffice:
- Any number, when subtracted from a rearranged version of that number, yields a number that is divisible by 9.
- Any number that is divisible by 9, it’s digits also sum to a number that is divisible by 9.
- So if you remove any one of those digits, it’s easy to figure out which number is missing. (If the numbers now sum to 7, you must have removed a 2.)
The four-digit number you start with is a * 1000 + b100 + c10 + d. This has the same remainder when divided by 9 as a + b + c + d does, because all those powers of 10 have the remainder 1 when divided by 9.
When you jumble it up, you’re still looking at the same remainder when divided by 9, because you’ve just jumbled powers of 10 around from one place to another, but they all have the same remainder when divided by 9.
So, after you subtract, we know that what you get has to have the remainder 0 when divided by 9. That is, it has to be a multiple of 9. As you perhaps are familiar with, any multiple of 9 has digits which add up to a multiple of 9. Thus, after you’ve removed one of the digits, we can tell what it had to be, since it’s the unique choice which, when added back, gives a multiple of 9 (uniqueness follows from the fact that 0 has been outlawed; otherwise, there could be ambiguity between 0 and 9).
ETA: Boy, I’m getting beat for all the GQs today.
A bit more detail about the core nugget of trickery, point #1 above. It works in base 10.
Let’s say you have 52. That really means 10(5) + 1(2). If you switch the order of digits, you’ve changed it to 1(5) + 10(2). If you subtract one from the other, it looks like this:
10 fives minus 1 five = 9 fives
1 two minus 10 twos = -9 twos
When you move a digit, you’re really saying instead of x of that digit, count 10x or 100x or 1000x or 1/10thx or 100thx of that digit. When you compare 1x to 10x or 100x (etc. etc.) the difference between them is either 9x or 99x or 999x (etc. etc.), thus the trick.
On preview, what Indistinguishable said. He’s very good at explaining.
The formula, therefore, is this:
Someone gives you a bunch of digits and says “What’s the missing one?”. You add up those digits, take the remainder when dividing by 9, and then subtract that from 9.
Thanks. For what it’s worth, I thought your brief version was what I should have written to start with, before delving into the details.