Live data from Hacker News

Think of a Number. How Do Math Magicians Know What It Is?

quantamagazine.org

11–20 of 60 posts

Re: Think of a Number. How Do Math Magicians Know What It Is?

#11
post #7

Earlier quoted context omitted.

I still don't get it :D

This comment from the linked Reddit thread explains how: > Each sentence is extra data given to the other person. > When Peter says "I don't know the numbers", means that he doesn't have enough information. For example, if the product of the numbers is 10, it could be (1,10) or (2,5). But if the product is 9801, then Peter would know the answer (99,99). Therefore, his first sentence reveals to Sandy that (99,99) isn'…

Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)

Re: Think of a Number. How Do Math Magicians Know What It Is?

#12

Earlier quoted context omitted.

This comment from the linked Reddit thread explains how: > Each sentence is extra data given to the other person. > When Peter says "I don't know the numbers", means that he doesn't have enough information. For example, if the product of the numbers is 10, it could be (1,10) or (2,5). But if the product is 9801, then Peter would know the answer (99,99). Therefore, his first sentence reveals to Sandy that (99,99) isn'…

Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)

Tip: A simpler variant of essentially the same puzzle principle is the xkcd "Blue Eyes" puzzle.

https://xkcd.com/blue_eyes.html

Re: Think of a Number. How Do Math Magicians Know What It Is?

#13
I've been working on something related for fair salary negotiations, where the two parties think of their honest salary proposal, exchange random numbers and exponents with each other, perform some arithmetic using the random number and their own secret honest salary number, and then decide whether the result is acceptable to both.

I started hacking on this protocol using a pencil and paper variation of Diffie-Hellman where instead of a secret key agreement you arrive at the same salary number (as a function of the difference in your secret numbers), but realized you can do a one-sided version of this where the potential employee says to the recruiter "think of your max budget for this role" using a variation the second puzzle in article, though unfortunately the recruiter would likely feel tricked, so I've gone back to working on a DH-like protocol ahead of time because it would be fairer.

Of course I would have liked to have made a blog post out of it, but this article is so close and mine is still half-baked, so if someone beats me to it and wants to leverage the power of being wrong on the internet in this comment thread, we could create a fair protocol that improves the lives of all parties involved in the hiring process.

Re: Think of a Number. How Do Math Magicians Know What It Is?

#14

Earlier quoted context omitted.

This comment from the linked Reddit thread explains how: > Each sentence is extra data given to the other person. > When Peter says "I don't know the numbers", means that he doesn't have enough information. For example, if the product of the numbers is 10, it could be (1,10) or (2,5). But if the product is 9801, then Peter would know the answer (99,99). Therefore, his first sentence reveals to Sandy that (99,99) isn'…

Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)

Since Peter is given the product of the two numbers, he should instantly know the pair if both numbers are prime, but since he doesn't it rules out pairs like (7x11) = 77 and (2x53) = 106.

Sandy knows the sum and has now been told that Peter doesn't know the pair. If the sum had been 6, the following pairs are possible: (1+5) (3+3) (4+2), Peter has just ruled out (1x5) and (3x3), so Sandy would be able to narrow it down to (1,5) if the sum had been 6.

So when she tells Peter she can't narrow it down, it tells him that the pair isn't (4,2) either (among many others).

And if Peter's number were 8: (1x8) or (2x4) he'd be able to solve it, but he doesn't so Sandy then knows that (1,8) isn't the solution either.

Re: Think of a Number. How Do Math Magicians Know What It Is?

#15
post #4

My immediate reaction to "Think of a number...Magicians...": The tricks probably require that their targets think of only natural numbers - {1, 2, 3, 4, ...}. And assume that most folks will pick small, dull natural numbers. (Vs., say, 2^24-1. Which is the maximum unsigned mediumint value in MySQL. Or, if you've ever been stuck doing low-level stuff with a 80286 CPU...) It'd be interesting to see if any of the tricks…

More precise phrasings of the questions are needed for them to work. Even just allowing the rationals makes most (all that I've seen) of these sorts of tricks fail. It could be an interesting problem to find such tricks in the Surreal numbers, since that's the most general form of number (ordered field).

Re: Think of a Number. How Do Math Magicians Know What It Is?

#16

Earlier quoted context omitted.

This comment from the linked Reddit thread explains how: > Each sentence is extra data given to the other person. > When Peter says "I don't know the numbers", means that he doesn't have enough information. For example, if the product of the numbers is 10, it could be (1,10) or (2,5). But if the product is 9801, then Peter would know the answer (99,99). Therefore, his first sentence reveals to Sandy that (99,99) isn'…

Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)

Think about it like this. There are two numbers, 1-99 choices. So there are 4545 possible pairs (since 2,5 and 5,2 are the same we ignore order). However there are only 197 sums (2-198) and only so many products (I don't want to do the math on that, but obviously a number like 60 is reached by quite a few pairs). Each time one of them says "I don't know", the other considers every sum (or product) and asks if the other person has received enough information that that sum or product they know has one unique unelimiated pair that generates it. For some pairs (1,1) both players will have a unique answer right away. Otherwise, both players eliminate from the set of possible answers any pair that would compute an answer that no other non-eliminated pair would compute. That means the next time the player says "I don't know" they were doing so with a more constrained set of pairs. Which provides more information. Until eventually they eliminate all other possibilities to calculate their product/sum.

Re: Think of a Number. How Do Math Magicians Know What It Is?

#17

Earlier quoted context omitted.

Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)

Since Peter is given the product of the two numbers, he should instantly know the pair if both numbers are prime, but since he doesn't it rules out pairs like (7x11) = 77 and (2x53) = 106. Sandy knows the sum and has now been told that Peter doesn't know the pair. If the sum had been 6, the following pairs are possible: (1+5) (3+3) (4+2), Peter has just ruled out (1x5) and (3x3), so Sandy would be able to narrow it d…

>since he doesn't it rules out pairs like (7x11) = 77 and (2x53) = 106.

I think pair (7x11)=77 can't be rule out, because pair (1x77) is also equal 77.

still don't got it...

Can you explain the situation for 3 turns before Peter knows, Sincere thanks.

Re: Think of a Number. How Do Math Magicians Know What It Is?

#18

Earlier quoted context omitted.

Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)

Since Peter is given the product of the two numbers, he should instantly know the pair if both numbers are prime, but since he doesn't it rules out pairs like (7x11) = 77 and (2x53) = 106. Sandy knows the sum and has now been told that Peter doesn't know the pair. If the sum had been 6, the following pairs are possible: (1+5) (3+3) (4+2), Peter has just ruled out (1x5) and (3x3), so Sandy would be able to narrow it d…

>he should instantly know the pair if both numbers are prime

That should actually be "if the product of their respective smallest prime factors is over 100". 7x11 can't be ruled out since 1x77 also produces 77, whereas 49x17 and Nx53 can be ruled out.

You can also rule out some of the larger squares, e.g. 25x25 and 64x64, so there's probably still a better phrasing for that

Edit: Can also rule out 1xPrime

Re: Think of a Number. How Do Math Magicians Know What It Is?

#20
One of my favorite versions of this trick was invented by Martin Gardner and actually uses a timing attack... on your brain! [0] Without apparently telling the magician anything, you end up giving enough information to uniquely identify your number!

[0] https://web.archive.org/web/20121228075545/http://devblog.bu...

Post reply on HN