Suppose $\displaystyle \pi $ is a random permutation of $\displaystyle \mathbb{Z}_n $. How would you determine the probability that $\displaystyle \pi(i+1)-\pi(i) \pmod n < n/2 $? We know that $\displaystyle \pi(i+1)-\pi(i) $ is maximum at $\displaystyle n-1 $ in $\displaystyle \mathbb{Z}_n $.