HP Forums

Full Version: An old puzzle, extended precision - and logs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I found an old [1907] puzzle book, Canterbury Puzzles One of the puzzles involved a cask holding 100 cups of wine. Every night, for 30 nights, a young monk steals a cup - and tops up the cask with a cup of water. The puzzle is to determine exactly how much wine the monk stole over those 30 nights.

This requires you to solve: 100 (1 - (99/100)^30) - which ends up having 60 decimal places.

While a quick Google search will find a arbitrary precision calculator, I was intrigued by the original 1907 answer: while giving the right value, it claimed the use of logarithms was required. I can see that:

log (0.99)^30 = 30 * log (0.99)

I just can't see how to calculate logs (and anti-logs) to the required number of decimal places. At best, in my youth, I saw tables of logarithms to 5 decimal places.

Is there a "lost art" for using log tables, to get the extended precision required? Or is there some other secret?
(07-28-2016 09:26 AM)sa-penguin Wrote: [ -> ]This requires you to solve: 100 (1 - (99/100)^30) - which ends up having 60 decimal places.

While a quick Google search will find a arbitrary precision calculator, I was intrigued by the original 1907 answer: while giving the right value, it claimed the use of logarithms was required.

No, logs are not required. But they can be used to evaluate 0,99^30.

(07-28-2016 09:26 AM)sa-penguin Wrote: [ -> ]I can see that:

log (0.99)^30 = 30 * log (0.99)

That's the way with using logs.

(07-28-2016 09:26 AM)sa-penguin Wrote: [ -> ]I just can't see how to calculate logs (and anti-logs) to the required number of decimal places. At best, in my youth, I saw tables of logarithms to 5 decimal places.

Do you really want a 60-digit result? Is this the result printed in the book?
Then there's another approach that can even be used with pencil and paper.

(07-28-2016 09:26 AM)sa-penguin Wrote: [ -> ]Is there a "lost art" for using log tables, to get the extended precision required? Or is there some other secret?

I don't think this is a secret, but here is how you can do it:

Code:
  (99/100)^30 
= 99^30 / 100^30
= 99^30 / 10^60

      99x = 100x - x

    99*99 = 9900 - 99         = 9801   (=99^2)
  9801*99 = 980100 - 9801     = 970299   (=99^3)
970299*99 = 97029900 - 970299 = 96059601   (=99^4)
      ...   ...

Do this until 99^30, then shift the decimal point 60 digits left to get 0,7397...
1 minus this is 0,2602996... so the answer (times 100) is 26 cups.

Dieter
(07-28-2016 12:16 PM)Dieter Wrote: [ -> ]I don't think this is a secret, but here is how you can do it:
Code:
  (99/100)^30 
= 99^30 / 100^30
= 99^30 / 10^60

      99x = 100x - x

    99*99 = 9900 - 99         = 9801   (=99^2)
  9801*99 = 980100 - 9801     = 970299   (=99^3)
970299*99 = 97029900 - 970299 = 96059601   (=99^4)
      ...   ...

Do this until 99^30, then shift the decimal point 60 digits left to get 0,7397...
1 minus this is 0,2602996... so the answer (times 100) is 26 cups.

Dieter
Very elegant!
A re-reading of the answer mentions a "simplified process of calculation".
Probably the same as you have shown.
Quote:and after the thirtieth theft there would remain in the cask the thirtieth power of 99 divided by the twenty-ninth power of 100.
This by the ordinary method of calculation gives us a number composed of 59 figures to be divided by a number composed of 58 figures!
But by the use of logarithms it may be quickly ascertained that the required quantity is
very nearly 73-97/100 pints of wine left in the cask. Consequently the cellarer stole nearly 26.03 pints.
The monks doubtless omitted the answer for the reason that they had no tables of logarithms, and did not care to face the task of making that long and tedious calculation in order to get the quantity "to a nicety," as the wily cellarer had stipulated.

By a simplified process of calculation, I have ascertained that the exact quantity of wine stolen would be:
26.0299626611719577269984907683285057747323737647323555652999
(07-28-2016 09:26 AM)sa-penguin Wrote: [ -> ]log (0.99)^30 = 30 * log (0.99)

I just noticed that of course this has to read

log(0,99^30) = 30 · log(0,99)

Dieter
Just as an aside to the discussion, my father, a mariner had a large volume of 10-figure tables of all kinds, for navigation and other nautical purposes. Sadly, I lost them in a house move some years ago. Presumably larger precision tables would have been more commonplace in the pre-digital era.
(07-30-2016 04:10 PM)ColinJDenman Wrote: [ -> ]Just as an aside to the discussion, my father, a mariner had a large volume of 10-figure tables of all kinds, for navigation and other nautical purposes. Sadly, I lost them in a house move some years ago. Presumably larger precision tables would have been more commonplace in the pre-digital era.

The well known "Abramowitz & Stegun" (Handbook of Mathematical Functions) includes 10-digit tables of logs, powers and roots. The ln table has 15 digits, e^x has 18 and sin/cos even 23 digits. At least if you have a printed version or a PDF where the tables have not been removed. ;-)

Dieter
(07-30-2016 07:56 PM)Dieter Wrote: [ -> ]At least if you have a printed version or a PDF where the tables have not been removed. ;-)

Dieter

Thank you for the suggestion -- another wasted afternoon guaranteed ;-)) Purely for old times sake.
(07-29-2016 11:48 AM)sa-penguin Wrote: [ -> ]
(07-28-2016 12:16 PM)Dieter Wrote: [ -> ]I don't think this is a secret, but here is how you can do it:
Code:
  (99/100)^30 
= 99^30 / 100^30
= 99^30 / 10^60

      99x = 100x - x

    99*99 = 9900 - 99         = 9801   (=99^2)
  9801*99 = 980100 - 9801     = 970299   (=99^3)
970299*99 = 97029900 - 970299 = 96059601   (=99^4)
      ...   ...

Do this until 99^30, then shift the decimal point 60 digits left to get 0,7397...
1 minus this is 0,2602996... so the answer (times 100) is 26 cups.

Dieter
Very elegant!
A re-reading of the answer mentions a "simplified process of calculation".
Probably the same as you have shown.
Quote:and after the thirtieth theft there would remain in the cask the thirtieth power of 99 divided by the twenty-ninth power of 100.
This by the ordinary method of calculation gives us a number composed of 59 figures to be divided by a number composed of 58 figures!
But by the use of logarithms it may be quickly ascertained that the required quantity is
very nearly 73-97/100 pints of wine left in the cask. Consequently the cellarer stole nearly 26.03 pints.
The monks doubtless omitted the answer for the reason that they had no tables of logarithms, and did not care to face the task of making that long and tedious calculation in order to get the quantity "to a nicety," as the wily cellarer had stipulated.

By a simplified process of calculation, I have ascertained that the exact quantity of wine stolen would be:
26.0299626611719577269984907683285057747323737647323555652999

Earlier the problem referred to cups, but here we have " 26.03 pints".
Is that a typo or is the size of a cup in pints known?
I am guessing they are pint-sized cups.
I think he was stealing with a cup that held one pint.
(07-29-2016 11:48 AM)sa-penguin Wrote: [ -> ]
Quote:By a simplified process of calculation, I have ascertained that the exact quantity of wine stolen would be:
26.0299626611719577269984907683285057747323737647323555652999

We can use the following program with Free42 Decimal:
Code:
00 { 3-Byte Prgm }
01 LN1+X
02 ×
03 E↑X-1
04 END

30
ENTER
-.01
R/S

-2.602996266117195772699849076832851e-1
(07-28-2016 09:26 AM)sa-penguin Wrote: [ -> ]This requires you to solve: 100 (1 - (99/100)^30) - which ends up having 60 decimal places.

While a quick Google search will find a arbitrary precision calculator...

Such as the HP 50g in exact mode:

Code:

\<<1 99 100 / 30 ^ - 100 * EVAL
\>>
Not to mention newRPL, of course:

Code:
«
  60 SETPREC
  1 99 100 / 30 ^ - 100 *
»
Reference URL's