Skip to content

Snapping a chocolate bar into single squares

Question

A chocolate bar consists of nn squares. Each break takes one piece and snaps it along a straight line between squares into two pieces. (a) How many breaks are needed to reduce the bar to single squares? (b) Does the shape of the bar matter? (c) How does the answer change if you may stack pieces and break the whole stack at once?

Short answer

(a) n−1n-1. (b) No. (c) Far fewer, about log⁡2\log_2 many. Each break raises the number of pieces by exactly one, so going from 11 to nn pieces always takes n−1n-1 breaks, whatever the shape. With stacking each break can at most double the piece count, so at least ⌈log⁡2n⌉\lceil\log_2 n\rceil are needed; an a×ba\times b bar needs exactly ⌈log⁡2a⌉+⌈log⁡2b⌉\lceil\log_2 a\rceil+\lceil\log_2 b\rceil, since each break shortens only one direction.

Adapted from Joshi, Denson & Downes, Quant Job Interview Questions and Answers, Q8.8, p.276; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution