Re: OT: A puzzle -



On Thu, 08 May 2008 02:59:13 GMT, Wes Groleau
<groleau+news@xxxxxxxxxxxxx> wrote:

Quentin Grady wrote:
Think of a number between 7 and 100.

Divide by five. What is the remainder? Two I answered.
Divide by four What is the remainder? One I answered.
Divide by seven. What is the remainder? Zero.

The number is 77, my friend replied with little hesitation.

How much hesitation? It took me fifteen minutes
to come up with a method, but the first time
I used it, I had less than a second of hesitation:

(a) X mod 5 = 2 : last digit must be 7 or 2

(b) X mod 4 = 1 : X must be odd ( _7 )

(c) X mod 7 = 0 : X must be 7 or 77

(d) 7 mod 4 = 3 : X must be 77

G'day G'day Wes,

I'm sure that is likely to be the method my friend used. I must I'm
feeling particularly dumb now having explored some arcane methods
rather than the obvious. As it happens my friend actually said it
must be 7 or 77 No, No it must be 77.

I introduced the puzzle because I wanted to get past the idea of me
being brilliant. Believing that wouldn't have helped them find their
own solution in the future.

For (c) you only need to know the sevens--if you had said
remainder six, I would know that X + 1 must be 28 or 98.
If 0 < X < 100, then (c) has at most two choices, and
since the difference between them is seventy, only one
can have the desired mod four value.

How did I do all that in less than a second?
I didn't! My son picked a number, and I said,
"Divide by five and tell me the remainder."

He also said "Two," and so I knew the last digit
was either two or seven _before_ I finished saying,
"Divide by four and tell me the remainder."

He said "Two," and so I knew the number was
even (last digit two) _before_ I finished saying,
"Divide by seven and tell me the remainder."

He said, "Four," so in the time it takes to say,
"Your number is," I figured that it had to be
three less than a multiple of seven that ends in
five. There's only one choice: 32, so I did not need
the tie-breaker (d).

But I was wrong! The number is 92! How did that happen?

The instructions are not clear. His computations were:

Divide by five and tell me the remainder:
92 / 5 = 18 R 2

Divide by four and tell me the remainder:
18 / 4 = 4 R 2

Divide by seven and tell me the remainder:
4 / 7 = 0 R 4

which my method turns into
(a) X mod 5 = 2 : last digit must be 7 or 2
(b) X mod 4 = 2 : X must be even ( _2 )
(c) X mod 7 = 4 : X+3 can only be 35
: X = 32

If I had bothered to check
(d) 32 mod 4 = 0
then I might have realized that he did not do what I wanted.

Instead, I said, "Your number is 32" and he said "92"
I said "92 divided by seven has a reminder of one."
He said, "Oh, I thought you meant....."

Before I even worked out the technique, I had realized two
possible interpretations of the instructions, so if I had
checked step (d), I would have suspected what happened, and
I could have taken a little more time to figure:

Third remainder is also the dividend (divide X < 100 by 5,
second dividend < 20, divide that by four: less than
five).

So second dividend is 4 * 4 + 2 = 18 and
the number is 18 * 5 + 2 = 92

However, with a little more practice and thought, I would
have rephrased the instructions to make the alternate
method unnecessary.

Yes. The instructions weren't clear. It is just as they were given
to me originally. That's how stories are sometimes. The come with
their imperfectios.

Best wishes and thanks for your solutions. They've helped me
considerably.
--
Quentin Grady ^ ^ /
New Zealand, >#,#< [
/ \ /\
"... and the blind dog was leading."

http://homepages.paradise.net.nz/quentin
.



Relevant Pages

  • Re: If you were inventing CoBOL...
    ... ANSI X3.23-1968 is also regularly referred to as "First Standard COBOL". ... COBOL rules before 1968 were pretty much a gentlemen's agreement, ... I often want just the remainder, ... For example: divide 7 into ...
    (comp.lang.cobol)
  • Re: Assemblers are for hiding your work , not for faster code .
    ... I'm concatenating the 32-bit remainder ... Divide 0:H by 10; quotient is MS output, ... and drop one or more numerator digits to ...
    (comp.arch.embedded)
  • Re: OT: A puzzle -
    ... Divide by four What is the remainder? ... was either two or seven _before_ I finished saying, ... The instructions are not clear. ...
    (alt.support.diabetes)
  • Re: Fast Binary to BCD method on ARM9 with huge numbers?
    ... >> largest power of ten you can comfortably divide by. ... quotient. ... As to the remainder, the above does not generate it, and you have to ... multiplications and some simple logic. ...
    (comp.arch.embedded)
  • Re: The state-of-the-art in mathematics
    ... A and B are both nonempty. ... change state to the remainder and ... divide 10/3, change state to the remainder and ...
    (sci.math)