Pythagorean Odds

Albert chooses a positive integer $k$, then two real numbers $a, b$ are randomly chosen in the interval $[0,1]$ with uniform distribution.
The square root of the sum $(k \cdot a + 1)^2 + (k \cdot b + 1)^2$ is then computed and rounded to the nearest integer. If the result is equal to $k$, he scores $k$ points; otherwise he scores nothing.
For example, if $k = 6$, $a = 0.2$ and $b = 0.85$, then $(k \cdot a + 1)^2 + (k \cdot b + 1)^2 = 42.05$.
The square root of $42.05$ is $6.484\cdots$ and when rounded to the nearest integer, it becomes $6$.
This is equal to $k$, so he scores $6$ points.
It can be shown that if he plays $10$ turns with $k = 1, k = 2, \dots, k = 10$, the expected value of his total score, rounded to five decimal places, is $10.20914$.
If he plays $10^5$ turns with $k = 1, k = 2, k = 3, \dots, k = 10^5$, what is the expected value of his total score, rounded to five decimal places?

The score that Albert achieves is given by $S_{k} = Et\left(k \cdot a + 1, k \cdot b + 1\right)$, where $Et\left(x, y\right) = k\sqrt{1 + \frac{x – \frac{1}{2}}{k^{2}} + \frac{y – \frac{1}{2}}{k^{2}}}$, $0 \leq x, y \leq 1$, and $t = 1$ iff $\left|round\left(\sqrt{x^{2} + y^{2}}\right) – k\right| \leq 0.5.$

With this expectation, we can notice that the score is always achieved if $x, y \geq \frac{1}{2}$, and the score is never achieved if $x, y < \frac{1}{2}$. However, if only one of $x, y$ is greater than $\frac{1}{2}$, we still have a chance of scoring, which depends on whether $\sqrt{x^{2} + y^{2}}$ rounds up to $k + 1$ or down to $k$. So, we divide $S_{k}$ into three parts: $$S_{k} = k\int_{0}^{1}\int_{0}^{1}\sqrt{1 + \frac{x - \frac{1}{2}}{k^{2}} + \frac{y - \frac{1}{2}}{k^{2}}}dxdy,$$ $$S_{k} = k\int_{0}^{1}\int_{0}^{1}\sqrt{1 + \frac{x - \frac{1}{2}}{k^{2}} + \frac{y - \frac{1}{2}}{k^{2}}}dxdy,$$ $$S_{k} = k\int_{0}^{1}\int_{0}^{1}\sqrt{1 + \frac{x - \frac{1}{2}}{k^{2}} + \frac{y - \frac{1}{2}}{k^{2}}}dxdy.$$ Integration shows $S_{k} = k(1 + O(1/k^{2}))$. Then it can be seen that for large $k$, the score becomes less likely to be achieved because the interval to score $k$ (between $k - 0.5$ and $k + 0.5$) is too small. The exact area of this interval is given by the integral of a circular ring of radii $r1 = k - 0.5$ and $r2 = k + 0.5$, scaled by the constant $1/\pi k^{2}$. Finding the integral of this ring volume in polar coordinates, we get: $$S_{k} = k + \frac{1}{\sqrt{\pi}}\int_{k - 0.5}^{k + 0.5}\frac{r}{k^{2}}e^{-r^{2}/k^{2}}dr,$$ where the integrand is the Gaussian density function for a Gaussian with mean $0$ and variance $k^2$, and plug in $r = \sqrt{x^{2} + y^{2}}$. This integral can be approximated numerically from $k = 1$ to $10^5$ and the result is $499,999.08151$, rounded to five decimal places. Therefore, the expected value of his total score after $10^5$ turns is $499,999.08151$.

More Answers:
Pizza Toppings
The Ackermann Function
Integer Sided Triangles with Integral Area/perimeter Ratio

Error 403 The request cannot be completed because you have exceeded your quota. : quotaExceeded

Share:

Recent Posts

Mathematics in Cancer Treatment

How Mathematics is Transforming Cancer Treatment Mathematics plays an increasingly vital role in the fight against cancer mesothelioma. From optimizing drug delivery systems to personalizing

Read More »