Brainteasers · Geometry and counting · Hard
Twenty-five dots
Twenty-five dots are arranged in a square grid of 5 rows and 5 columns, each dot one unit from its neighbours in its row and column. A square counts if all four of its corners are on dots, whatever its size and whether it is upright or tilted, with sides not parallel to the rows. How many different squares are there?
Answer and solution
Answer
50
Solution
Sort the squares by the upright square that just contains them: an upright square of side s frames exactly s squares, itself and s − 1 tilted ones.
There are (5 − s)² upright squares of side s: 16, 9, 4 and 1 for s = 1 to 4. Each frames s squares whose corners lie on its sides, one for each offset 0 to s − 1 of a corner along a side. Total: 16 × 1 + 9 × 2 + 4 × 3 + 1 × 4 = 16 + 18 + 12 + 4 = 50.
Geometry and counting comes up in 1 firm's roundsMillennium
This round asks this kind of problem live, with follow-ups. Every round on every track is in Premium.