jack: (Default)
[personal profile] jack
Puzzle: I have two identical cylindrical lemonade bottles I punched small holes into the sides of, just above the bottom1. I find that when I fill them each with water the first empties in 225 seconds and the second more quickly in 75 seconds. Without any other form of measurement, how do I use them to time 25 seconds?

Q. That's just one of those hourglass/numerology puzzles. If one hourglass empties in time p minutes, and the second in time q, then calculate p-1 mod q, and you know pp-1=1 (mod q) so pp-1=1+nq. Run glass Q n times and glass P p-1 times; when the first has finished you have exactly one minute before the second does.
A. If you think that's easy, try it.

Q. It's a trick, isn't it.
A. Probably.

Q. Tilt one of the bottles...
A. If you like. They *are* cylindrical, so you *can* halve the amount of water by tilting them until the water only just covers the base, if you think it'll help.

Q. I could use a...
A. No other equipment is necessary. You can use additional vessels of unknown size if you want to.

Q. How quickly did you solve it?
A. Actually, I made the puzzle up myself last night.

Q. Are you sure your solution works?
A. I may be mistaken. In which case I apologise, and promise to feel very embarassed.

Q. Do I need to use much maths for this?
A. Some. Nothing not taught at A-level IIRC.

Q. Can I find a different solution?
A. I don't think so, but try; it might be better.

[-1] That's not a footnote, that means 'inverse of p'
[1] Really.

Date: 2006-03-01 07:03 pm (UTC)
From: [identity profile] naath.livejournal.com
As an aside mod N in this context is arithmetic modulo N so count 1,2,3,4,1,2,3,4... rather than continuing to 5, also sometimes called 'clock' arithmetic. I did this at school when discussing ciphers, but this may not be universally true.

Date: 2006-03-01 07:08 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
I think we were taught it early on, but not as something *useful*. I can't remember if it was in GCSE or A-level anywhere.

Date: 2006-03-01 08:32 pm (UTC)
From: [identity profile] feanelwa.livejournal.com
Arithmetic modulo? Ciphers? I know nothing about that, either.

Date: 2006-03-02 12:05 am (UTC)
From: [identity profile] naath.livejournal.com
So normally if I want to add 6 to 7 I get 13 but if I'm telling the time I might get 1, that's modulo 12 arithmetic.

Ciphers as in where you take A and add 2 to get C and also you take Z and add 2 to get B, that's modulo 26.

It's also a key component of RSA, but we didn't do that in school.

Date: 2006-03-02 12:12 am (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Whoah! Syncronicity.

Date: 2006-03-02 12:59 am (UTC)
From: [identity profile] feanelwa.livejournal.com
Ooh shiny. I will learn that, after first year physics, first year NSmaths and Japanese refreshing.

Date: 2006-03-02 12:12 am (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
For the record: http://en.wikipedia.org/wiki/Clock_arithmetic.

I don't know if you *care* but I'm bored. Clock (aka modulo) arithmetic is where you count 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3... For instance, 11+2=1. This is mod 12.

Another way of saying the same thing, this time for mod 10 now. Think about long addition, and just watch the units digits. 9+1=10, but we're just looking at the right hand column, so 10 is the same thing as 0.

This is the normal formal definition, two numbers are the "congruent mod 11" if they differ by a multiple of 11. Now we can multiply.

Division is trickier. Always think "x divided by two means 'the number which, when doubled, is x.'" Sometimes this doesn't exist. In mod 10, none of the digits double to give 3.

But modulo prime numbers, you always will be able to divide (aka it is a group). This isn't completely obvious, but is true. This becomes very important in cryptography because multiplying things is easy (do long multiplication and discard all the multiples of the modulo number), but dividing things is hard (you basically have to try all possibilities).

It's useful for hourglasses, because if they run down in times p and q, where q is bigger and a prime number, then "you must be able to divide by p" which turns out to be the same as saying "you can multiply p by something to get very close to a multiple of q", which translates into "Run this hourglass several times, and that one two, and eventually they will finish close together, ie. 1 min apart"

We cuold have done that without the modulo arithmetic, it might even have been easier. But saying modulo is funnier to mathmos :)