A rectangle over the shaded row

In a 2023×20232023 \times 2023 grid of unit squares, the entire middle row (the 10121012th) is shaded. A rectangle is chosen uniformly at random from all axis-aligned rectangles made of grid cells. The probability that it contains at least one shaded square equals 1012M\tfrac{1012}{M} for an integer MM; find MM.

Show hints (2)+
  1. The shaded row spans all columns, so only the rectangle's vertical range matters: does it include the middle row?
  2. Count line-pairs that fail to span it (both above or both below): 2(10122)/(20242)=1011/20232\binom{1012}{2}/\binom{2024}{2}=1011/2023.

Answer

Reveal answer →

2023

Want the full step-by-step worked solution? It's part of Premium - along with a worked solution for every question in the bank.

Asked at: Jane Street, Two Sigma

Related questions