CMIMC 2017 Power Problem 19

Prove that \operatorname{Pr}\left[A_{i j}\right]=\frac{2}{j-i+1}.