# 2011 AIME II Problems/Problem 15

## Problem

Let $P(x) = x^2 - 3x - 9$. A real number $x$ is chosen at random from the interval $5 \le x \le 15$. The probability that $\lfloor\sqrt{P(x)}\rfloor = \sqrt{P(\lfloor x \rfloor)}$ is equal to $\frac{\sqrt{a} + \sqrt{b} + \sqrt{c} - d}{e}$ , where $a$, $b$, $c$, $d$, and $e$ are positive integers. Find $a + b + c + d + e$.

## Solution

Table of values of $P(x)$:

\begin{align*} P(5) &= 1 \\ P(6) &= 9 \\ P(7) &= 19 \\ P(8) &= 31 \\ P(9) &= 45 \\ P(10) &= 61 \\ P(11) &= 79 \\ P(12) &= 99 \\ P(13) &= 121 \\ P(14) &= 145 \\ P(15) &= 171 \\ \end{align*}

In order for $\lfloor \sqrt{P(x)} \rfloor = \sqrt{P(\lfloor x \rfloor)}$ to hold, $\sqrt{P(\lfloor x \rfloor)}$ must be an integer and hence $P(\lfloor x \rfloor)$ must be a perfect square. This limits $x$ to $5 \le x < 6$ or $6 \le x < 7$ or $13 \le x < 14$ since, from the table above, those are the only values of $x$ for which $P(\lfloor x \rfloor)$ is an perfect square. However, in order for $\sqrt{P(x)}$ to be rounded down to $P(\lfloor x \rfloor)$, $P(x)$ must be less than the next perfect square after $P(\lfloor x \rfloor)$ (for the said intervals). Now, we consider the three cases:

Case $5 \le x < 6$:

$P(x)$ must be less than the first perfect square after $1$, which is $4$, i.e.:

$1 \le P(x) < 4$ (because $\lfloor \sqrt{P(x)} \rfloor = 1$ implies $1 \le \sqrt{P(x)} < 2$)

Since $P(x)$ is increasing for $x \ge 5$, we just need to find the value $v \ge 5$ where $P(v) = 4$, which will give us the working range $5 \le x < v$.

\begin{align*} v^2 - 3v - 9 &= 4 \\ v &= \frac{3 + \sqrt{61}}{2} \end{align*}

So in this case, the only values that will work are $5 \le x < \frac{3 + \sqrt{61}}{2}$.

Case $6 \le x < 7$:

$P(x)$ must be less than the first perfect square after $9$, which is $16$.

\begin{align*} v^2 - 3v - 9 &= 16 \\ v &= \frac{3 + \sqrt{109}}{2} \end{align*}

So in this case, the only values that will work are $6 \le x < \frac{3 + \sqrt{109}}{2}$.

Case $13 \le x < 14$:

$P(x)$ must be less than the first perfect square after $121$, which is $144$.

\begin{align*} v^2 - 3v - 9 &= 144 \\ v &= \frac{3 + \sqrt{621}}{2} \end{align*}

So in this case, the only values that will work are $13 \le x < \frac{3 + \sqrt{621}}{2}$.

Now, we find the length of the working intervals and divide it by the length of the total interval, $15 - 5 = 10$:

\begin{align*} \frac{\left( \frac{3 + \sqrt{61}}{2} - 5 \right) + \left( \frac{3 + \sqrt{109}}{2} - 6 \right) + \left( \frac{3 + \sqrt{621}}{2} - 13 \right)}{10} \\ &= \frac{\sqrt{61} + \sqrt{109} + \sqrt{621} - 39}{20} \end{align*}

Thus, the answer is $61 + 109 + 621 + 39 + 20 = \fbox{850}$.