Brain-Teaser 159: Fallen leaves
From The Sunday Times, 26th April 1964 [link]
Three leaves fall from a book. The total of the page numbers remaining in the second half of the book is now three times the total of the page numbers remaining in the first half.
The total of the page numbers on the fallen leaves lies between 1050 and 1070, and is the highest which could have produced this effect.
How many numbered pages did the book contain originally?
I found many solutions, which improve on the published answer. So I have marked the puzzle as flawed.
This puzzle is included in the book Sunday Times Brain Teasers (1974).
[teaser159]
Jim Randell 2:06 pm on 24 July 2022 Permalink |
I think this puzzle is flawed, as I found many solutions that seem to satisfy the puzzle text, and are different from the published solution.
If we suppose the book consists of n leaves (= 2n pages), and that the leaves are 1|2, 3|4, …, (2n − 1)|(2n).
And the two halves of the book are pages 1 – n and (n + 1) – (2n).
Then the initial sum of page numbers in each half of the book are:
Now, if the three leaves removed are (2a − 1)|(2a), (2b − 1)|(2b), (2c − 1)|(2c).
Then the total of the page numbers removed is t = 4(a + b + c) − 3, and this is in the range 1050 – 1070.
So (a + b + c) is in the range 264 – 268, and we want this to take on the highest possible value (i.e. 268 if possible, which corresponds to t = 1069).
If the sum of the removed pages in the first and second halves is t1, t2 (t1 + t2 = t), then we have:
This Python program starts looking for values of t from 268 down to 264, and stops when it finds a value that gives viable books. It runs in 74ms. And it finds many possible solutions.
from enigma import (irange, decompose, printf) # solve with leaves removed (even page numbers given) def solve(*vs): # calculate the removed page numbers (x, y, z) = (2 * v for v in vs) ps = (x - 1, x, y - 1, y, z - 1, z) # split the pages at index i for i in irange(2, 4): t1 = sum(ps[:i]) t2 = sum(ps[i:]) # calculate the number of leaves (so there are 2n pages) n = 3 * t1 - t2 if n < 3 or ps[-1] > 2 * n: continue # and check the split occurs between the halves if i > 0: if ps[i - 1] > n: continue if i < 6: if not (ps[i] > n): continue yield (n, ps, t1, t2) # record solutions (number of pages = twice the number of leaves) ss = set() # t = a + b + c for t in irange(268, 264, step=-1): # calculate possible a, b, c values for (a, b, c) in decompose(t, 3): for (n, ps, t1, t2) in solve(a, b, c): printf("[t={t}: a={a} b={b} c={c} -> {ps}; t1={t1} t2={t2}; n={n}]") ss.add(2 * n) # are we done? if ss: printf("pages = {ss}", ss=sorted(ss)) breakSolution: The book could have: 310, 318, 342, 350, 374, 406, 438, 470, 502, 534, 566, 598, 630, 662, 694, 6414 pages.
Here is one of the solutions found:
If the book has 203 leaves = 406 pages, numbered 1|2, 3|4, …, 203|204, …, 405|406.
Then the sum of the page numbers in the first half of the book is: sum(1..203) = 20706.
And the sum of the page numbers in the second half of the book is: sum(204..406) = 61915.
(Note that if leaf 203|204 is removed, that is one page from each half of the book).
Now, if pages 1|2, 157|158, 375|376 are removed (total = 1069, the largest possible value).
Then the pages removed from the first half are: 1, 2, 157, 158; sum = 318, so the sum of the remaining pages in the first half is 20706 − 318 = 20388.
And the pages removed from the second half are: 375, 376; sum = 751, so the sum of the remaining pages in the second half is 61915 − 751 = 61164.
And: 61164 = 3 × 20388, as required.
The published solution (and that given in the 1974 book) is that the book initially had 302 pages (i.e. 151 leaves), and the removed pages are 75|76, 151|152, 301|302. Which gives a total of 1057.
But I have shown above that this is not the largest total possible.
It was also noted: “Only 4 correct answers in a very small entry”. So it seems I wasn’t the only one that had issues with this puzzle.
The solution in the book only considers 3 ways that leaves can be removed: 1 from the first half + 2 from the second half; 2 from the first half + 1 from the second half; 1.5 from each half. In terms of pages these are 2+4, 3+3, 4+2, but my program also considers 0+6, 1+5, 5+1, 6+0. However the example I give is a 4+2 combination, which should be accounted for by the published solution. But it has arrived at the conclusion that the maximum viable total of the numbers on the removed pages for a book with x leaves is 7x, so 1057 is the maximum possible (with 151 leaves), but I think this is faulty reasoning.
(The only thing I can think of is that the two halves of the book are considered after the leaves have been removed. (Although the solution given in the book doesn’t seem to support this). But even with this interpretation there are multiple solutions with a total of 1069 – any that removes 3 pages from the first half and three from the second half will leave the boundary unchanged).
LikeLike