Probability that number is greater than $x$ Problem: Given an integer $x\in\left[\text{min},\text{max}\right]$
A user comes and choose a  number $\left\{ n \in \mathbb{R} : \text{min}\leq\ n \leq \text{max}\right\}$. Calculate the probability that $n > x$. 
I tried using following 
$$\frac{\text{max}-x}{\text{max}-\text{min}}$$
But I am not getting correct answer. My book tells me that when $\text{min}=8156$, $\text{max}=15225$ and $x=12910$, then $P(n\gt x)=0.22474$, but this is not the answer I am getting.
 A: Just to add a bit to what has already been said in the comments above.
First I don't know if you have heard about a probability density function (pdf)? If not, you can read a bit about it on this Wikipedia page. A pdf is a non-negative function defined on the real numbers (lets just go with the real numbers here) satisfying that if we take the area under the graph of $f$ from $-\infty$ to $\infty$ we get $1$. We use $f$ to calculate the probabilities that an outcome is in a certain interval. So for example the probability that a outcome is any real number is $1$ because of the area condition from above. If I want to find the probability that an outcome is in an interval $[a,b]$ I would find the area under the graph from $x=a$ to $x = b$.
The the pdf $f$ tells us something about the likelihood of finding an outcome in a certain interval. If the function is constant on an interval and zero out side, like:
$$
f(x) =\begin{cases} 0 & \text{if } x < a \\
\frac{1}{b-a} & \text{if } x \in [a,b] \\
0 & \text{if } x > b
\end{cases}
$$
then we say that the pdf is a uniform density function. This just means/assumes that the only possible outcomes are in the interval $[a,b]$. (So for example $b$ would be the maximum of the possible outcomes, i.e. $b = max$ in your case). 
So in your case with $a = min$ and $b = max$ our expression:
$$
\frac{max - x}{b - a}
$$
is exactly the area under the graph of the pdf from x to max. Hence it gives you the probability that an outcome (the number chosen) is in the interval $[x,max]$.
But this of course assumes that the outcomes are uniformly distributed. In that case you, in you specific example, indeed get (as mentioned in the comments):
$$
\frac{15255 - 12910}{15255 - 8156} \simeq 0.3303 = 33.03 \%
$$
A: Actually the denominator should be max-min+1 as that is the total number of integer n such that min<=n<=max.
