Unravelling the Mystery of a Party Trick

  • Thread starter Thread starter Hyperreality
  • Start date Start date
  • Tags Tags
    Mystery
AI Thread Summary
The discussion revolves around a problem from "In Code" by Saray Flannery, where the solution involves determining a person's age using the Chinese Remainder Theorem. The original poster expresses confusion about the formula used to derive the age based on given remainders and seeks clarification on its origin and alternative solving methods. They attempt to apply the extended Euclidean algorithm but encounter difficulties in achieving the correct results. Despite referencing Wikipedia articles for guidance, they are unable to reconcile their calculations with the expected outcomes. The conversation highlights the complexities of applying the Chinese Remainder Theorem and the challenges faced in understanding its implementation.
Hyperreality
Messages
201
Reaction score
0
I was reading In Code by Saray Flannery,one of the problem in the book bothered me, it is not the problem itself, it is the solution.

A Party Trick
If someone tells me 2, 2 and 3 are the remainders when she divides her age by 3, 5 and 7 respectively then I can work out her age.

Solution:
Let x = 2, y = 2, z = 3 and a = the age of the girl. Then she used this formula:

a = (70x + 21y + 15z)mod n
= (120 + 42 + 45)mod (3 x 5 x 7)
= 227mod105
= 17 years old

I have no idea of how this works. Where does this formula come from? There must be a logical way to explain this right? And are there any other ways of solving this kind of problem?
 
Mathematics news on Phys.org
This is an example of a famous result in elementary number theory called the Chinese Remainder Theorem. The site does a better job of explaining what's involved than I can.
 
I've been playing around with this theorem, but for the life of me i can't get it to work. I've been reading the wikipedia articles on chinese remainder theorem and euclidean algorthim
http://www.wikipedia.org/wiki/Chinese_remainder_theorem
http://www.wikipedia.org/wiki/Extended_Euclidean_algorithm
but it's not working. I was trying to solve the sample problem. Here it is:
Code:
x=2(mod 3)
x=3(mod 4)
x=2(mod 5)
"syntax": x=a[sub]i[/sub](mod n[sub]i[/sub])
First i have tried finding the values that satify
Code:
n = n[sub]1[/sub],...,n[sub]k[/sub]
r*n[sub]i[/sub] + s*n/n[sub]i[/sub]=1
I've been using the extended euclidean algorithm for that. Here (color coded for readability):
Code:
20/3 = 6 r 1 => 2 = 20 - 6(3)
3/2 = 1 r 1 => 1 = 3 - 1(2)  => 1= 3 -1 (20 - 6(3)) => 1 = -20 + 7(3)
That was just for n1 but the answer to the example says the equations should be
Code:
(-13)*3 + 2*20 =1
instead of
1 = -20 + 7(3)
The others (ni) also come out wrong. What did i do to upset the math Gods so (or to get it wrong)?

-HBar

#EDIT: Added the links
 
Last edited:
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top