What is the probability that $\lfloor X/Y \rfloor$ is odd, where $X,Y \sim U(0,1)$?
I was asked this question many years ago in a Putnam training class and I've shared my own solution (open to feedback!), but I'm also curious about any other solutions others may have.
Let $Z = \lfloor X/Y \rfloor$. We can think of $X$ and $Y$ as points in the unit square $[0,1]\times [0,1]$. We first compute
In general, $\mathbb{P}(Z = n)$ is equivalent to $P(nY\le X < (n+1)Y)$, which is $\frac{1}{2} \left(\frac{1}{n} - \frac{1}{n+1}\right)$. Therefore $$\mathbb{P}(Z \text{ is odd}) = \sum_{\text{odd }n} \mathbb{P}(Z = n) = \frac{1}{2} \sum_{\text{odd }n} \frac{1}{n} - \frac{1}{n+1} = \frac{1}{2} \left(1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} +\frac{1}{5} - \frac{1}{6}+ \dots \right).$$ We can use the Taylor series for $\log(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \dots$ to see that the answer is $\log{2}/2$.