Physicist: The trick to this trick is hidden away in modular arithmetic. Modular arithmetic is regular arithmetic, except that you state that some number is now equal to zero. This has the effect of wrapping the number line into a loop. The number you set to zero is called the “mod” or “modulus”. So for example, counting in “mod 4” would be: 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, …
Clocks are just numbers mod 12. If someone told you “it’s 17 o’clock”, you might be inclined to say “do you mean 5 o’clock?” A mathematician would say “17 mod 12 equals 5 mod 12”. You can write this [17]12 = [5]12, or 17 mod 12 = 5 mod 12.
You can pass addition, subtraction and multiplication through the mod (though not division, that’s a whole thing). For example,
An example for multiplication:
So we’ve got
and
But when you do math mod nine you get one more, strange property: a number mod 9, is equal to the sum of its digits mod 9. In other words, if you write down a number as “abcd”, then [abcd]9=[a+b+c+d]9. All the fancy tricks you may have learned in grade school involving nines all boil down to this property. Personally, I’d say that this “nine property” is also what makes this seem more like a magic trick. It doesn’t feel like any useful information would survive digit adding.
Here’s a quick proof!
Any number of the form “9…99” is equal to 0 mod 9, because they’re all multiples of 9, so when you subtract 9 enough times (1…11 times, in fact) you’re left with zero.
So [9…99]9 = [0]9, and adding 1 to both sides you get, [10…00]9=[1]9. Now check this out! Take a number like 3427. You can figure out (with the help of a calculator or something) that [3527]9=[8]9.
Here’s a better way:
The trick: [52]9=[7]9. This trick amounts to saying: if [x+y]9=[7]9, then [x]9=[7-y]9.
y is the number of cards in the “hold pile”. Adding up the digits has no effect on the value mod 9. The subtraction (from 7 for 1≤y≤6, and from 16 for 7≤y≤9) amounts to subtracting from 7 mod 9. So the “prediction number” is exactly [7-y]9.
x is the number of cards in all of the other piles. It doesn’t matter if you look at x or the sum of x’s digits (don’t change mod 9). It also doesn’t matter if you split x into different piles, since [A+B]M=[A]M+[B]M.
So there it is. It also doesn’t matter that you’re using cards. Were you so inclined, you could do this same trick with any number of arbitrary objects. The only thing that changes is what number you subtract from (mod 9) to get the prediction number. Cards: [52]9=[7]9. With jokers: [54]9=[9]9. A big box of matches: [300]9=[3]9. Your mom: [1]9=[1]9.
By the by, the “mod 9 invariance” thing was used by accountants in ye olde times to double check their summations. Take the sum you got mod 9, and compare it to the sum of all the digits involved mod 9 (which is easier to do). If you get the same number, then you probably did the original sum right.
Or, at the very least, if you did the sum wrong there’s a 8 in 9 chance you’ll catch it.
STEP 1
Ask a friend to write down a number (any number with more than 3 digits will do, but to save time and effort you might suggest a maximum of 8 digits).
Example: 83 972 105
STEP 2
Ask them to add the digits.
Example: 8+3+9+7+2+1+0+5 = 35
STEP 3
Ask them to subtract this number from the original one.
Example: 83 972 105 – 35 = 83 972 070
STEP 4
Ask them to select any digit from this new number and strike it out, without showing you.
Example: 83 972 070
STEP 5
Ask them to add the remaining digits and write down the answer they get.
Example: 8+3+9+7+0+7+0 = 34
STEP 6
Ask them to tell you the number they get (34) and you will tell them which number they struck out.
SOLUTION
The way you do this is to subtract the number they give you from the next multiple of 9. The answer you get is the number they struck out.
Example: The next multiple of 9 here is 36 (9 x 4 =36)
36 – 34 = 2 and there you have your answer, easy isn’t it!
Note: If the number they give you after step 5 is a multiple of 9, there are two possible answers then you simply tell them that this time they crossed out either a 9 or a zero.
Physicist: In steps 2 and 3 you’re forcing your friend to create a new number X, such that [X]9 = [0]9. Since [83972105]9 = [8+3+9+7+2+1+0+5]9 = [35]9 you have [83972105 – 35]9 = [0]9. So X = 83972070. Let’s call the digit they remove “D” (in this case, D=2). Since the sum of X’s digits is [0]9, subtracting D leaves you with [-D]9 which is what you have at the end of step 5: [-D]9 =[34]9.The final subtraction done in the solution is subtracting negative D (leaving D). That multiple of 9 that you find is still equal to [0]9. It’s only purpose is to make the math a little easier to do in your head. So in this case [-(-D)]9 = [-34]9 = [-25]9 = [-16]9 = [-7]9 = [2]9. Or equivalently, [-34]9 = [0]9 + [-34]9 = [36]9 + [-34]9 = [2]9. It may seem strange that negative numbers are the same as positive numbers, but in modular arithmetic “positive” and “negative” don’t mean much, since you can add or subtract the modulus whenever. It’s like saying “negative 2 o’clock is equal to 10 o’clock” (just add 12!).
Say you have a number like 537 then you you mix them up to make another number like 375 then subtract 375 from 537 and its 162 and ill pick a number lets say 6( if its a zero you cant use it) ill tell you 1 and 2 and you guess 6.
Physicist: Clever! This trick is similar to the last one, and again involves forcing someone to come up with a number that’s equal to [0]9.
Say the original number is written “abc” (in the example a=5, b=3, c=7). The new number is X = abc-bca (any rearrangement is fine). Now check this out!
[X]9=[abc-bca]9=[abc]9-[bca]9=[a+b+c]9-[b+c+a]9=[a+b+c-b-c-a]9=[0]9. This follows from the rules for mod 9 arithmetic (near the top of this post), namely that [A+B]M=[A]M+[B]M and [abcd…]9=[a+b+c+d+…]9.
[X]9=[0]9 is just a fancy way of saying that X is a multiple of 9. Moreover (using that same rule again) the sum of X’s digits must also be a multiple of 9. With this information in hand, given all but 1 digit (or even just the sum of all but one digit), you can find the remaining digit.
In the example X=162. You know the sum of the digits must be a multiple of 9, so given 1 and 2, the remaining digit must be 6.
This system breaks down when the sum of the given digits is already 9. For example, if you’re given 5 and 4, you might guess 0 or 9 (540 and 549 are both multiples of 9, after all), but only one of them can be the hidden digit.
Who discovered, or what source is there for the 105 number trick:
The 105 Trick!
Ask your friend to think of a mystery number Q between 1 and 105.
Then ask him to work out [Q]mod3 and tell you the answer. (In other words he has to divide his mystery number by 3 and tell you what the remainder is). Call the answer x
Ask him to work out [Q]mod5. Call the answer y
Ask him to work out [Q]mod7. Call the answer z
You then put the answers for x,y and z in this formula: [70x+21y+15z]mod105
…and you can work out Q !
That’s the “Chinese Remainder Theorem“, named after little known mathematician “Friedrich Von Chinese”.
Pingback: Q: Why is it that (if you exclude 2 & 3) the difference between the squares of any two prime numbers is divisible by 12? « Ask a Mathematician / Ask a Physicist
I need help with math. The question is: The sum on this digital clock is 15. At what other times will the digits add up to 15? Give at least 2 answers.
Please email any questions you have to AskAMathematician@gmail.com.
Any idea how to solve this?
Find A,B.C,D, and E such that AB X C.DE = AB + C.DE. A,B,C,D, and E each stand for a distinct, single digit from 0 – 9
Pingback: Q: Does how you deal cards affect how random they are? | Ask a Mathematician / Ask a Physicist
i have one Q
my friend write 4 digit number and sys write any 4 digit number and write agian 4 digit number i agian i write one 4 digit number and my friend write one more 4 digit number
my friend ans write in first step how its work plz ans me
Exp
my firend write 4587 and tel me ans is 24575
As all these ‘9 tricks’ work in base 10 numbers, am I right to hypothesize that in base N you would get the same N-1 tricks?
Pingback: Q: When you write a fraction with a prime denominator in decimal form it repeats every p-1 digits. Why? | Ask a Mathematician / Ask a Physicist