Problem 2.5 Easy Free 2 variations

Rectangles on a Chessboard

How many rectangles of any size, with sides along the grid lines, can be drawn on an 8×88 \times 8 chessboard? (Squares count as rectangles.)

Work it out, then compare with the answer.

SolutionShow the worked solution

A rectangle with sides on the grid lines is fixed by its two vertical sides and its two horizontal sides. Its vertical sides are two distinct vertical lines out of the 99, and its horizontal sides are two distinct horizontal lines out of the 99. Conversely, any two vertical lines and any two horizontal lines bound exactly one such rectangle. This is a bijection, so the number of rectangles is

(92)2=362=1296.\binom{9}{2}^2 = 36^2 = 1296 .
1296\boxed{1296}

Generalisation. An m×nm\times n board contains (m+12)(n+12)\binom{m+1}{2}\binom{n+1}{2} rectangles.

Variations

The same idea with a twist. Each solution gives only the changed step.

Variation 2.5a

Inside a transparent 5×5×55 \times 5 \times 5 cube made of unit cubes, how many distinct rectangular boxes (of any dimensions, not necessarily cubes) can be formed from the grid lines, counting two boxes as the same if one is a rotation of the other?

Work it out, then compare with the answer.

Solution

A box is a region of the cube bounded by grid planes. The same region counts once, whichever of its edges we call length, width or height. In each of the three directions there are 66 grid planes. A box is fixed by choosing 22 of them in each direction, and every such choice gives exactly one box. The number of boxes is therefore

(62)3=153=3375.\binom{6}{2}^3 = 15^3 = 3375 .
3375\boxed{3375}

If the question instead asked only for the number of different box shapes up to rotation, we would count multisets {a,b,c}\{a,b,c\} with 1≤a,b,c≤51\le a,b,c\le 5. There are (73)=35\binom{7}{3}=35 of these.

Variation 2.5b

On a 2023×20232023 \times 2023 grid, every square in the middle row is shaded. A rectangle with sides along the grid lines is chosen uniformly at random from all such rectangles. Find the probability that it contains at least one shaded square.

Work it out, then compare with the answer.

Solution

Number the horizontal grid lines 0,1,…,20230,1,\dots,2023. The shaded middle row lies between lines 10111011 and 10121012.

A rectangle misses the shaded row exactly when both of its horizontal sides lie among lines 0,…,10110,\dots,1011, or both lie among lines 1012,…,20231012,\dots,2023. Each of these sets contains 10121012 lines. The choice of vertical sides is independent of this and cancels from the ratio. Hence

P(miss)=2(10122)(20242)=1012⋅10111012⋅2023=10112023,\mathbb{P}(\text{miss}) = \frac{2\binom{1012}{2}}{\binom{2024}{2}} = \frac{1012\cdot 1011}{1012\cdot 2023} = \frac{1011}{2023},

and

P(at least one shaded square)=1−10112023=10122023≈0.5002.\mathbb{P}(\text{at least one shaded square}) = 1-\frac{1011}{2023} = \frac{1012}{2023} \approx 0.5002 .
10122023\boxed{\dfrac{1012}{2023}}