Earlier quoted context omitted.
The only requirement is that they're both perfect (or at least sufficiently good) logicians and arithmeticians.
In that case, I still don't get it.
Think of a Number. How Do Math Magicians Know What It Is?
41–50 of 60 posts
Re: Think of a Number. How Do Math Magicians Know What It Is?
#42Earlier quoted context omitted.
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 oth…
I am still not getting this. I think there is an assumption that both parties are ordering their possible choices in an identical manner, but I am unsure.
So if I told you the product of two numbers (positive integers) was 3, you immediately know 3 is prime and therefore the numbers are 1,3. Therefore either they cannot say they don't know if they were told 3. We can go through every combination and find what possibilities they could be.
Well, it cannot be 1,1 or 1,2 or 1,3 because those produce products of 1, 2 and 3 because they don't have any other pair that can generate them. The same is true of 2,3 which is the only way to get six or 2,4 the only way to get 8. And 3,3 or 3,4 which are the only way to get 9 and 12. And lastly 4,4 is the only way to get to 16. You'll note that this is almost all pairs which is easy to iterate over by making the second number greater than or equal to the first. The only pairs left are 1,4 and 2,2 both of which produce a product of 4. So we, as the sun person, now know the product must be four. Given the product and the sum, we can deduce that it's 1,4 because we were told the sun was 5.
When it goes to 100, it's the same process. Except now I have to iteratively eliminate pairs until there is only one solution.
Re: Think of a Number. How Do Math Magicians Know What It Is?
#43The Collatz Conjecture or the 3n+1 problem was mentioned last week https://news.ycombinator.com/item?id=31208035 Any positive integer you take, you end up in a 1-4-2-1 loop. It's not proved yet but there's no number found yet that satisfies otherwise. Very interesting. What's the use case of this? Impressing ladies at the bar with your 'deep connection'.
Re: Think of a Number. How Do Math Magicians Know What It Is?
#44The Collatz Conjecture or the 3n+1 problem was mentioned last week https://news.ycombinator.com/item?id=31208035 Any positive integer you take, you end up in a 1-4-2-1 loop. It's not proved yet but there's no number found yet that satisfies otherwise. Very interesting. What's the use case of this? Impressing ladies at the bar with your 'deep connection'.
Re: Think of a Number. How Do Math Magicians Know What It Is?
#45Then there's the time with David Blaine and George W. Bush: https://www.youtube.com/watch?v=0vzuDkjtDOY
Re: Think of a Number. How Do Math Magicians Know What It Is?
#46Earlier quoted context omitted.
Yeah, I read this explanation, and I'm probably being very dense, but I still don't get it :)
There are 4950 possible pairs in the initial problem statement. Sandy gets one of 197 possible sums, and Peter gets one of 2,869 possible products. Of those 2,869 products, 1,765 can be produced with only possible pair of numbers: something like 67 can only be (1, 67), whereas 240 could be (3, 80) or (5, 48) or (4, 60) or 5 other possible pairs. Peter doesn't know the answer, so when he tells that to Sandy, she learn…
Round #1: ... (many)
Round #2: ... (many)
Round #3: (1,4), (72,92) and (72,98)
Round #4: (2,3), (80,90)
Round #5: (1,6), (75,96)
Round #6: (72,99)
Round #7: (81,88)
Round #8: (70,99)
Round #9: (77,90)
Round #10: (72,95)
Round #11: (76,90)
Round #12: (70,96)
Round #13: (90,84)
Round #14: (66,98)
Round #15: Solution is "77" and "84"
Re: Think of a Number. How Do Math Magicians Know What It Is?
#47Earlier quoted context omitted.
In that case, I still don't get it.
Is the basic idea clear? I'd say it's just that the statement "I don't have enough information" is _itself_ information that can be used to eliminate some possibilities. After understanding that idea, the rest is just tedious logic/brute-force-search, I believe. It's also possible that there is ambiguity in the statement or something like that. Hard to say exactly what part isn't connecting with you.
I don't have any guarantees that both of them are sorting each list the same. So how does "I don't have enough information" relay which of those list items to eliminate?
Re: Think of a Number. How Do Math Magicians Know What It Is?
#48Earlier quoted context omitted.
Is the basic idea clear? I'd say it's just that the statement "I don't have enough information" is _itself_ information that can be used to eliminate some possibilities. After understanding that idea, the rest is just tedious logic/brute-force-search, I believe. It's also possible that there is ambiguity in the statement or something like that. Hard to say exactly what part isn't connecting with you.
Well, so they brute-force and come up with a set of possible answers, a list of tuples. I don't have any guarantees that both of them are sorting each list the same. So how does "I don't have enough information" relay which of those list items to eliminate?
When the person knowing the product says he doesn't know the answer, the sum person now checks the product list for all products with only 1 pair. These pairs can now be removed from the sum and product list. That actually culls the sum list and some entries that previously had 2 or more options now have 1 less. If the entry for the known sum has only 1 pair, he knows the answer. Otherwise he doesn't and now the culling continues with all sums that have only 1 pair. Repeat until you have the solution.
No ordering required. The algorithm can terminate at different rounds depending on the picked number and for some N (like 4) might not have a solution at all! For the given riddle the exact turn the solution was found is given through the conversation.
This is a pretty neat explanation https://alexanderell.is/posts/numbers-game/
Re: Think of a Number. How Do Math Magicians Know What It Is?
#49Reminds me of this problem: Two numbers are chosen randomly, both are positive integers smaller than 100. Sandy is told the sum of the numbers, while Peter is told the product of the numbers. Then, this dialog occurs between Sandy and Peter: Peter: I don't know the numbers. Sandy: I don't know the numbers. Peter: I don't know the numbers. Sandy: I don't know the numbers. Peter: I don't know the numbers. Sandy: I don'…
another variant:
Peter: If I divide by 4, I have remainder x Sandy: If I divide by 4, I have remainder y Peter: If I divide by 25, I have remainder a Sandy: If I divide by 25, I have remainder b Peter and Sandy (in unison): Got it!
Re: Think of a Number. How Do Math Magicians Know What It Is?
#50Reminds me of this problem: Two numbers are chosen randomly, both are positive integers smaller than 100. Sandy is told the sum of the numbers, while Peter is told the product of the numbers. Then, this dialog occurs between Sandy and Peter: Peter: I don't know the numbers. Sandy: I don't know the numbers. Peter: I don't know the numbers. Sandy: I don't know the numbers. Peter: I don't know the numbers. Sandy: I don'…
Here is some python code that might be more revealing https://www.online-python.com/c5nAfLoIqr
A code review would be greatly appreciated!