TAOCP 7.1.3 Exercise 25

Each volume consists of 250 sheets of thickness $0.1\ \text{mm}$ each, so the total paper thickness per book is 250 \cdot 0.

Section 7.1.3: Bitwise Tricks and Techniques

Exercise 25. ▶ [15] Four volumes sit side by side on a bookshelf. Each of them contains exactly 500 pages, printed on 250 sheets of paper 0.1 mm thick; each book also has a front and back cover whose thicknesses are 1 mm each. A bookworm gnaws its way from page 1 of Volume 1 to page 500 of Volume 4. How far does it travel while doing so?

Verified: no
Solve time: 4m22s


Solution

Each volume consists of 250 sheets of thickness $0.1\ \text{mm}$ each, so the total paper thickness per book is

$$ 250 \cdot 0.1 = 25\ \text{mm}. $$

Each book has a front cover and a back cover of thickness $1\ \text{mm}$ each.

The books are placed side by side on a shelf, so the worm moves in a straight line through the thickness direction of the volumes. We measure only the material actually traversed between the starting point (page 1 of Volume 1) and the ending point (page 500 of Volume 4), excluding the initial front-cover surface at the start and the final back-cover surface at the end.

Volume 1: The worm starts at page 1, immediately inside the front cover. To reach page 500, it traverses the full paper block of $25\ \text{mm}$ and then the back cover of $1\ \text{mm}$. This contributes $26\ \text{mm}$.

Volumes 2 and 3: The worm enters each at the inner side of the front cover and exits at the inner side of the back cover. Each contributes

$$ 1 + 25 + 1 = 27\ \text{mm}. $$

Volume 4: The worm enters at the inner side of the front cover and stops at page 500, which lies just before the back cover. This contributes

$$ 1 + 25 = 26\ \text{mm}. $$

Adding all contributions,

$$ 26 + 27 + 27 + 26 = 106\ \text{mm}. $$

Thus the total distance traveled by the bookworm is

$$ \boxed{106\ \text{mm}}. $$