Home > Riddles > The height shelf

The height shelf

Pure logicLevel 4 · Advanced · ●●●●○

Five books of different heights 1,2,3,4,5 (1 = shortest, 5 = tallest) are in a row.
Each book writes down how many books taller than it are to its left.
The notes, from left to right, are:

$$ 0,\ 1,\ 1,\ 3,\ 0. $$

What is the order of heights from left to right?

Hints

Show hints
  1. Everything fits together, and the solution is unique.
  2. Taking $a_1=4$, $a_2=2$, $a_3=3$: for $a_1=4$, there are 0 higher on the left.
  3. Taking $a_1=4$, $a_2=2$, $a_3=3$: for $a_2=2$, only 4 is higher (1).

Solution

Show full solution

Back to problem
Answer:

$$ 4,\ 2,\ 3,\ 1,\ 5. $$

Let the row be $a_1,\dots,a_5$.

  • Note 5 = 0: there is no one taller to your left $\Rightarrow a_5=5$.
  • Note 4 = 3: your 3 on the left are higher $\Rightarrow a_4=1$.

$\{2,3,4\}$ remains for $a_1,a_2,a_3$ with notes $0,1,1$.
Taking $a_1=4,\ a_2=2,\ a_3=3$:

  • for $a_1=4$, there are 0 higher ones on the left,
  • for $a_2=2$, only $4$ is higher (1),
  • for $a_3=3$, only $4$ is higher (1).

Everything fits together, and the solution is unique.


Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: Synchronized sources · Next: The binary bells →