Straight Dope Message Board

Straight Dope Message Board (https://boards.straightdope.com/sdmb/index.php)
-   General Questions (https://boards.straightdope.com/sdmb/forumdisplay.php?f=3)
-   -   What makes these two math tricks work? (https://boards.straightdope.com/sdmb/showthread.php?t=802643)

aceplace57 08-26-2016 04:23 AM

What makes these two math tricks work?
 
Cracked has an article on mentalist tricks.

The one guessing a person's age has me stumped. The algorithm they give works.
http://s3.crackedcdn.com/phpimages/p.../568309_v1.jpg

Age 32

3 (1st digit) x 5 = 15 + 3 = 18 x 2 = 36 + 2 (2nd number in age) = 38

The person says 38 and you tell them they are 32. By subtracting 6. ***applause***

Age 57
5 (1st digit) x 5 = 25 + 3 = 28 x 2 = 56 + 7 (2nd digit) = 63

Minus 6 they are 57. ***applause***

It works with various ages I tried, but how?

This one is even more confusing. I understand you are working backwards from the answer. Page 108 and 9th entry. So you need a arithmetic operation that yields 1089

The random number at the beginning has me puzzled. How can this algorithm work when it must start with a random number picked by the person?

I'm tempted to write a quick program to see if it really works with all 3 digit number (with no duplicate digits) combinations. But I suspect it does. Somehow it yields 1089 every time.

http://s3.crackedcdn.com/phpimages/p.../568569_v1.jpg

741 reverse it 147
Subtract 741-147= 594 Reverse it 495
594 + 495= 1089. It works

Here is the entire article
http://www.cracked.com/photoplasty_2...youre-psychic/

naita 08-26-2016 04:55 AM

If you want to work out such tricks it often helps to do it algebraically for a general case.

Your first example. Say the person is ab years old, that's the same as 10*a + b.

a*5 = 5a (your use of equal signs as "execute" are a deadly sin to a mathematician by the way.)
(5a + 3) *2 = 10a + 6
10a + 6 + b - 6 = 10a + b

Indistinguishable 08-26-2016 05:01 AM

As for the second example, suppose we have the three digit number ABC with smaller reverse CBA. Since this is smaller, it must be that C < A. Subtracting the smaller from the larger gives us (A - C)0(C - A). Except C is less than A, so there must be a borrow for the last digit's subtraction: we actually get (A - C - 1)9(10 + C - A). Finally, adding this to its reverse gives 9(9 + 9)9 = 1089.

naita 08-26-2016 05:21 AM

On preview: Indistinguishable did it quicker and better. :mad:

Chronos 08-26-2016 07:41 AM

Quote:

Quoth naita:

(your use of equal signs as "execute" are a deadly sin to a mathematician by the way.)
Indeed. Read literally, the math in your OP contains a number of statements, one for each equal sign:
3 x 5 = 15 + 3
15 + 3 = 18 x 2
18 x 2 = 36 + 2
36 + 2 = 38
Of course, all of these but the last are incorrect.

aceplace57 08-26-2016 08:48 AM

I was showing my steps in the most compact way possible. To avoid a tedious and long post.

Both problem s are of course party tricks and the math is meant to be done in the person's head.

I can see this trick going horribly wrong. You're 39! No I'm not! Then it becomes obvious the mental arithmetic slipped a gear.

But it's still a neat party trick when it works.

Leo Bloom 08-26-2016 08:56 AM

What do you use instead of equals sign for "execute" in such a simple case as above? (Although I would have said "gives," were I orally stepping through the symbols).

I say "simple case" because no doubt simple opertions/demonstrations in other formalist endeavors are governed by unique symbologies.

aceplace57 08-26-2016 10:18 AM

Does the book trick only work for 108 and the 9th entry? I guess different books could be used. Anything with that many pages and distinct entries.

What if the magician wanted to use another page number? Could the trick be redesigned to work?

septimus 08-26-2016 10:27 AM

Quote:

Originally Posted by aceplace57 (Post 19583077)
Age 32

3 (1st digit) x 5 = 15 + 3 = 18 x 2 = 36 + 2 (2nd number in age) = 38

The person says 38 and you tell them they are 32. By subtracting 6. ***applause***

Age 57
5 (1st digit) x 5 = 25 + 3 = 28 x 2 = 56 + 7 (2nd digit) = 63

Minus 6 they are 57. ***applause***

One way to avoid the complaint about the "equalities" is to use parentheses;

(((3 x 5 = 15) + 3 = 18) x 2 = 36) + 2 = 38

(((5 x 5 = 25) + 3 = 28) x 2 = 56) + 7 = 63

sbunny8 08-26-2016 10:56 AM

Here's an easier version of the trick that's too obvious and lots of people would see right through it:

Take the first digit of your age, multiply it by ten, then add one, then add the second digit of your age and tell me the result. The result is 25? Aha! I know that your age is really 24.

To make it a little more sneaky, they added six instead of one, and they broke up the multiplying by ten into two steps, first asking you to multiply by five and then later multiply by two. And the icing on the cake is that instead of asking you to add six at the end, they had you add three just before you multiply by two, which has the same effect.

If AB is your age, i.e. A is the first digit of your age and B is the second digit...

"Multiply A by ten then add B" gives you the exact same answer as
"Multiply A by ten then add B then add six then subtract six" which is the same as
"Multiply A by ten then add six then add B then subtract six" which is the same as
"Multiply A by five then multiply again by two then add six then add B then subtract six" which is the same as
"Multiply A by five then add three then multiply by two then add B then subtract six".

aceplace57 08-26-2016 11:02 AM

Thank you for explaining the misdirection sbunny8.

I see now how clever they were. Adding steps to hide what they were really doing.

Understanding how it's designed makes me appreciate the trick much more.

Thudlow Boink 08-26-2016 11:31 AM

Quote:

Originally Posted by aceplace57 (Post 19583284)
I was showing my steps in the most compact way possible. To avoid a tedious and long post.

Understood; and in this context, I'm inclined to forgive you. In an educational context, however, you should bend over backward to avoid the "running equals sign," since thinking of = as "gives" or "execute" can be a serious stumbling block to kids' understanding of math. See "Studentsí Understanding Of The Equal Sign Not Equal" (or more discussion here, here, or here.

LSLGuy 08-26-2016 11:59 AM

Quote:

Originally Posted by Leo Bloom (Post 19583296)
What do you use instead of equals sign for "execute" in such a simple case as above? (Although I would have said "gives," were I orally stepping through the symbols).

I say "simple case" because no doubt simple opertions/demonstrations in other formalist endeavors are governed by unique symbologies.

One symbol commonly used is "=>" which is pronounced "yields" or "gives."

Quote:

Originally Posted by aceplace57 (Post 19583590)
Thank you for explaining the misdirection sbunny8.

I see now how clever they were. Adding steps to hide what they were really doing.

Understanding how it's designed makes me appreciate the trick much more.

Actually it proves how dirt-simple these puzzles are. Now that you know the tricks you can make up your own private version and baffle your friends.

As has been said, it all starts from the fact that all 2 digit numbers are actually in the form of 10a+b. So as long as you hide a multiply by 10 and a single addition in amongst a bunch of do-nothing steps you've got a working puzzle. e.g. take a digit, add 3 then double the result, then subtract 6, then divide by 2. Magically the same digit pops out. etc.

muldoonthief 08-26-2016 12:07 PM

Quote:

Originally Posted by LSLGuy (Post 19583741)
Actually it proves how dirt-simple these puzzles are. Now that you know the tricks you can make up your own private version and baffle your friends.

Though if you're actually a computer programmer, don't try them on your coworkers. They'll secretly laugh at the fact you think you're being "clever".

naita 08-26-2016 12:08 PM

Quote:

Originally Posted by LSLGuy (Post 19583741)
One symbol commonly used is "=>" which is pronounced "yields" or "gives."

I think I'd go for doing it vertically. As long as you don't do it while doing "real" maths.

3
x 5
= 15
+ 3
= 18
x 2
= 36
+ 2
= 38

Folly 08-26-2016 12:13 PM

The second one is a variation or consequence I guess of 'casting out nines'.

The digits, even when reversed, will add to the same number and the result when subtracted will always be divisible by 9.

BigT 08-26-2016 01:57 PM

The reversing one actually doesn't work, as it's possible to get a two digit number (99). Someone pointed this out in the comments.

Folly 08-26-2016 02:25 PM

You have to keep everything at 3 digits.
201
102
201-102=099

099 + 990 = 1089

Cayuga 08-26-2016 02:33 PM

Quote:

Originally Posted by Leo Bloom (Post 19583296)
What do you use instead of equals sign for "execute" in such a simple case as above?

3 (1st digit) x 5 = 15
15 + 3 = 18
18 x 2 = 36
36 + 2 (2nd number in age) = 38

markn+ 08-26-2016 02:49 PM

Also, don't try the first trick on a kid who's less than 10 years old, or an elderly person who's over 100.

--Mark

Little Nemo 08-26-2016 02:56 PM

Quote:

Originally Posted by aceplace57 (Post 19583590)
Thank you for explaining the misdirection sbunny8.

I see now how clever they were. Adding steps to hide what they were really doing.

Understanding how it's designed makes me appreciate the trick much more.

To make the trick less obvious, they should reverse the digits.

Pick a number between 11 and 99.
Take the second digit and multiply it by five.
Add three.
Multiply it by two.
Add the first digit from your original number.
What number did you come up with?
Your original number is...

All they do is take the number you gave them, subtract six, and reverse the order of the digits. But because of that reversal the trick is less obvious.

With the original trick

17 => 11
30 => 24
44 => 38
57 => 51
66 => 60
82 => 76
105 => 99

Even a person with limited arithmetic skills might spot such a simple pattern.

With the reverse trick

17 => 11
48 => 24
89 => 38
21 => 51
73 => 76
12 => 60
105 => 99

Cartoonacy 08-26-2016 03:13 PM

Quote:

Originally Posted by aceplace57 (Post 19583284)
I can see this trick going horribly wrong. You're 39! No I'm not! Then it becomes obvious the mental arithmetic slipped a gear.

Yeah. I remember when I was in 5th grade, trying a similar trick on my cousin, who is two years older:

"Think of a number. Double it. Add 10. Divide by 2. Subtract the number you first thought of. Your answer is 5."

He laughed hysterically, making fun of me because the trick didn't work. He had just learned about negative numbers in school, so he started with -1. He said that I wasn't so smart, because my trick doesn't work with negatives.

Two years later, I learned about negative numbers myself, and discovered that the trick works fine with them. I guess he didn't understand negatives as well as he thought. (I never did bring it up again, though.)

Leaffan 08-26-2016 03:57 PM

"When you subtract a negative, you add a positive." Burned into my brain for 40ish years.

Leo Bloom 08-26-2016 05:23 PM

Quote:

Originally Posted by LSLGuy (Post 19583741)
...

As has been said, it all starts from the fact that all 2 digit numbers are actually in the form of 10a+b. So as long as you hide a multiply by 10 and a single addition in amongst a bunch of do-nothing steps you've got a working puzzle. e.g. take a digit, add 3 then double the result, then subtract 6, then divide by 2. Magically the same digit pops out. etc.

But how is it seven?

pulykamell 08-26-2016 06:08 PM

Quote:

Originally Posted by LSLGuy (Post 19583741)

Actually it proves how dirt-simple these puzzles are. Now that you know the tricks you can make up your own private version and baffle your friends.

Indeed. I've never been impressed by these math tricks. They're all straightforward and formulaic (literally.)

Indistinguishable 08-26-2016 06:15 PM

Well, these are tricks to impress children, primarily, right? Illustrations of algebra to entice those who haven't yet thought about it.

Incidentally, even if it wasn't so smooth, you would imagine any series of steps of this sort could be undone easily enough: take your age, add 2, multiply it by 8, subtract 3, square it, reverse the digits, and tell me what you got. Ok, now I'll deduce your age: I'll reverse the digits, take the square root, add 3, divide by 8, and subtract 2. That sort of thing.

(Hell, since there's only so many ages someone (and particularly a child) might reasonably have, I may as well just invent any old random complicated but injective function from input ages to output whatevers and just memorize the mapping back from outputs to inputs.)

pulykamell 08-26-2016 06:29 PM

Quote:

Originally Posted by Indistinguishable (Post 19584769)
Well, these are tricks to impress children, primarily, right? Illustrations of algebra to entice those who haven't yet thought about it.

I think so, but after you get introduced to a couple, they are all kind of same-y. At least that's how they always seemed to me as a kid.

Indistinguishable 08-26-2016 07:12 PM

Ah, yes; agreed.

Left Hand of Dorkness 08-26-2016 10:42 PM

Nines lead to some real fun tricks. One I show my students goes like this:

Think of a four-digit number. Don't make it something easy like 5555; make it hard.
Now scramble the digits to make a new number.
Subtract the smaller number from the larger number. You'll probably end up with a four-digit number; if not, tell me the number of digits so I can direct the rest of the trick. (If the person's a prick and gets a one-digit number, you gotta tell them they're a prick and to rescramble; otherwise the adjustments should be obvious).
Take that new four-digit number and scramble it to get a new number.
Choose one of the digits in that new number and circle it. Don't circle a zero, that's already a circle. (If that line doesn't set off alarm bells in your head, you don't pay much attention to magic tricks). (Don't say that last part).
Take the three uncircled digits, and scramble them to make a new number.
Tell me what that new number is, and I'll tell you what number you circled.

***

As for the 1089 trick, I do it slightly differently: I show kids my new speedreading technique (riffling quickly through the pages of a book) and tell them that I've memorized the book completely. Then we do the addition/subtraction shenanigans--if they got a two-digit number after subtraction, it's 99, so I tell them to reverse and add twice instead of once. I tell them to look at the first two digits of their number to choose a page in the book, the third digit to choose the line number on that page, and the final digit to choose the word on that line. They tell me they're on the tenth page, line eight, word nine. I've memorized that sentence, so I make a big show of muttering it to my breath and counting words: "Hmm, Frodo's at the party, he's talking with Samwise, let's see, 'after, the, party, is, finished, would, you, be, so'--the word is 'so,' right?"

Indistinguishable 08-26-2016 11:22 PM

It's worth noting that there's two basic modes for these tricks: creating an injective [and indeed easily invertible] function, as in trick 1 in this thread (where the trickster can deduce the input from the trickee telling them the output), and creating a constant function, as in trick 2 in this thread (where the trickster can deduce the output even without knowing the trickee's input).

The latter form, though it sounds so unimpressive written out as just "this function turns out to be constant", connects to fond memories for me, as it was what they used to use at the end of some episodes of Square One TV, my first exposure to these tricks as a child (obviously, on TV, the interactivity required for the former couldn't be employed).

Indistinguishable 08-26-2016 11:36 PM

(That's for the tricks along the lines of the basic algebra in the OP. LHoD's "Nines lead to some real fun" trick is of a different genre...)

Indistinguishable 08-26-2016 11:40 PM

Speaking of four-digit numbers and constant functions, here's a trick:

Take any four digit number whose digits aren't all the same (e.g., 7274), rearrange its four digits into order (e.g., 2477), and subtract this from its reverse (e.g., 7742 - 2477 = 5265).

Keep repeating this process till you get the same value twice in a row (so, in this example, 5265 then becomes 6552 - 2556 = 3996; this in turn becomes 9963 - 3699 = 6264; and one can continue in this fashion a couple more times before getting a repeat).

What value did you get at that point? It'll always be the same: 6174.

Indistinguishable 08-26-2016 11:49 PM

(For the reversing step, do include initial zeros, treating everything at all times as a four digit number)

gigi 08-27-2016 02:45 AM

Quote:

Originally Posted by Folly (Post 19583774)
The second one is a variation or consequence I guess of 'casting out nines'.

The digits, even when reversed, will add to the same number and the result when subtracted will always be divisible by 9.

And that's how we bookkeeper types know we made a transposition error -- we're off by an amount that is divisible by nine.

Isilder 08-27-2016 04:51 AM

Quote:

Originally Posted by aceplace57 (Post 19583077)
Cracked has an article on mentalist tricks.

The one guessing a person's age has me stumped. The algorithm they give works.
http://s3.crackedcdn.com/phpimages/p.../568309_v1.jpg

Age 32

3 (1st digit) x 5 = 15 + 3 = 18 x 2 = 36 + 2 (2nd number in age) = 38

The person says 38 and you tell them they are 32. By subtracting 6. ***applause***

First digit times five... well in the two digit number, thats the number of tens, and the number of ones is being added on again later, so "times five" is really "divide by two".. 3 times five is 30 divide two... see ?

So then add 3, and then double . You can move the 3 to be after the double.. well the "add three" was doubled , so thats really add six.. which is then cancelled by subtract 6.

Then add in the ones column, and subtract six ...

basically the add 6 is disguised as "halve, add 3 and double", but the halve is disguised as tens column times 5...

rowrrbazzle 08-28-2016 12:12 AM

Quote:

Originally Posted by aceplace57 (Post 19583470)
What if the magician wanted to use another page number? Could the trick be redesigned to work?

Do it in base 8 with a calculator. Of course, digits 8 and 9 can't be used. The result will be 1067.

In fact, in any base > 2, the result will always be 1 0 (base-2) (base-1).

Indistinguishable 08-28-2016 03:40 AM

Here's a trick I like that looks somewhat similar to the previous examples, yet whose explanation may elude some, and which at any rate connects to interesting deeper math. Alas, its one fault is that most people aren't familiar with how to carry out the required large exponentiations. But, here, I'll link you to a calculator you can use for this purpose.

Pick any three-digit even number you like. Write a 1 after it, and then write in an exponent of 1 followed by three 0s. (For example, if your original number was 712, it would become 71211000)

Carry out this exponentiation. The result will have lots of digits; in particular, it will end in three 0s followed by a 1. Get rid of those. The result will still be huge; cut it down to size by keeping only the last three digits at this point. (For example, 71211000 is very large, and its last digits are "...2204035920001". Getting rid of the 0001 chunk and then keeping only the last three digits, we end up with 592). This value will be even, so halve it, and then tell me what you get. (In this case, that would be 592/2 = 296).

At this point, armed with nothing else, I will readily recover your original number. In fact, the most surprising thing is the way in which I will recover your original number: I raise the "magic number" 8221 to what you gave me, chop off the last digit, and then keep only the last three digits. [E.g., 8221296 has last digits "...733817121". Chopping off the last 1 and then keeping only the last three three digits, I get "712" back, just as you started with].

The challenge to you (after you are able to actually try out enough examples to assure yourself this does indeed work) is to explain: why does this work?

(In particular, you should know I can do this trick for any number of digits, in any base, just changing the "magic number" accordingly.)

Chronos 08-28-2016 08:45 AM

I haven't worked through all of it, but that looks suspiciously like paired-key encryption.

LSLGuy 08-28-2016 08:58 AM

My immediate thought as well.

The Great Unwashed 08-28-2016 11:12 AM

Quote:

Originally Posted by Indistinguishable (Post 19587528)

The challenge to you (after you are able to actually try out enough examples to assure yourself this does indeed work) is to explain: why does this work?


Isn't it perfectly obvious that (8221^((A(1+4995A+16616700A^2))mod1000)/2)-1)mod1000 = A ?


No. Please save me.

Leo Bloom 08-28-2016 01:02 PM

"Casting out nines": Wolfram Math: http://mathworld.wolfram.com/CastingOutNines.html


For a mess of them:
"Divisibility tests": Wolfram Math: http://mathworld.wolfram.com/DivisibilityTests.html

Indistinguishable 08-28-2016 01:31 PM

In RSA-style encryption, you first raise a secret to one power, then undo by raising to another power. But, here, we first raise the secret to some power, then undo by raising another base to that. So not quite the same.

Indistinguishable 08-28-2016 08:20 PM

An RSA-style trick would be this:

Pick any three digit number you like. Write a 1 after it and then raise it to the 63rd power. Chop off the last digit from the result, and then tell me the last three digits. (For example, if your original number was 712, it would become 712163, whose last digits are ...42419761, and you would tell me 976)

I can now recover your original number by adding back in the final 1 you chopped off, raising it to the 127th power, chopping off the last 1 again, and reporting the last three digits. (For example, 976 becomes 9761127, whose last digits are ...6061297121, and I would report to you 712)

And there are variants of this for any number of digits, any base, and also allowing different pair of exponents, and even allowing different digits to add and chop off, the latter subject to certain coherence conditions. That's an RSA-style trick.

But it's not what the trick in post #37 was.

The Great Unwashed 08-29-2016 05:16 AM

Quote:

Originally Posted by Indistinguishable (Post 19588792)
But it's not what the trick in post #37 was.


So, am I going to get anywhere looking at the binomial expansions of (1+A)^1000 and (1+8220)^B ? It started to look hopeless. If not, I give in. Term starts in two days and I've done exactly 0 prep.

Indistinguishable 08-30-2016 12:10 AM

Binomial expansions are certainly good things to look at. I'd advise (1 + 10A)^10. Indeed, I'd advise just playing around and seeing what happens to numbers ending in 1 as you repeatedly raise them to 10th powers. That should make at least some relevant patterns clear, which may spur further thoughts. I'll provide a fuller explanation in a few days if there's still interest.

Indistinguishable 08-30-2016 12:22 AM

I'll also note that the significance of the magic number 8221 is that there is a sense in which e20 = ...8221 (in base ten), and a sense in which the procedure outlined at the beginning of post #37 carries out the operation ln(1 + 10x)/20 in mod 1000 land.

Indistinguishable 09-02-2016 09:48 PM

Ah, there was not much interest, and so I'll leave it be for future readers to puzzle out.

[Dear future readers: it may be of use to you to more fully note that e20 = ...27197858457785818756568221.0, while ln(21) = ...06843588182236083829935820.0]

JKellyMap 09-03-2016 07:28 AM

Well, I opened this thread just now, hoping to learn the answer! If that doesn't rise to your definition of "interest," I'll understand.

j_sum1 09-04-2016 11:25 AM

First post in ummmmm a long time.

I like that trick, indistinguishable. I will give it some thought.

WildBlueYonder 09-04-2016 01:56 PM

While out process serving I get to guess ages all day long, its fun. Sometime dead on but always within 5 years and usually with 3.

Its hard sometimes because you dont want to insult the women

The weight too...pretty good at that one too! On women I always guess less than what they look like.....if I feel good that day I will do an obviously 30+ woman and guess 25...that really thrills them! Course I have to do anything to get them back in a good mood or in a good mood after I serve them!

Most dont like getting served. Not too many at all slam the door on me!!:D


All times are GMT -5. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2017 Sun-Times Media, LLC.