Student has ${1\over{h+1}}$ chance of being wrong and teacher has ${1\over{k+1}}$ chance of grading wrong sum as actually wrong

combinatoricsprobability

Here's a question from my probability textbook:

A boy has done $n$ sums; the odds are $h : 1$ against any given sum being wrong; and the odds are $k: 1$ against the examiner seeing that any given wrong sum is wrong. If the examiner discovers that $r$ sums are wrong, show that the most likely number to be wrong is the greatest integer in $(rh + nk + rhk) \div (h + k + hk)$.

Here's what I did. Starting from $n$ sums, the probability the boy gets $x$ wrong is $\binom{n}{x} {{h^{n-x}}\over{(h + 1)^n}}$. And assuming the boy gets $x$ wrong, the probability of the examiner discovering $r$ wrong is $\binom{x}{r} {{k^{x – r}}\over{(k+1)^x}}$. So we want to find $x$ such that$$\binom{n}{x} {{h^{n-x}}\over{(h + 1)^n}} \times \binom{x}{r} {{k^{x – r}}\over{(k+1)^x}} = {{h!h^{r – x}k^{x – r}}\over{(n – x)!(x – r)! r! (h + 1)^n (k + 1)^x}}$$is maximized. But I'm not sure on how to go about doing that. Any help would be appreciated.

Best Answer

Hint

Call that last expression you wrote $f(x)$. You want to find the $x$ maximizing $f(x)$.

To do this, consider this ratio $f(x)/f(x-1)$. The optimal $x$ is the largest value of $x$ for which $f(x)/f(x-1)>1$. Indeed, if $x^*$ is that largest value, then you have $f(x^*)/f(x^*-1)>1$, while $f(x^*+1)/f(x^*)<1$. This implies $$f(x^*-1)<f(x^*)>f(x^*+1),$$ meaning $x^*$ is a local maximum. It turns out there are no other local maxima, so $x^*$ is the global maximum.

Fortunately, the ratio $f(x)/f(x-1)$ greatly simplifies, so it is easy to determine $x^*$. Try it out!

This same technique tends to be very useful whenever you are optimizing functions $f:\mathbb N\to \mathbb R$ that are products of exponentials and factorials.


One minor nitpick; the expression you computed is the unconditional probability that the student makes $x$ mistakes and that the examiner notices $r$ of them. The problem is implicitly asking you maximize the conditional probability of $x$ mistakes given that the teacher notices $r$ of them. To correct your expression, you would have to divide by the (unconditional) probability that the teacher notices $r$ mistakes. However, this does not affect the computation above, since you would by dividing the expression you had by a constant independent of $x$.

To find the unconditional probability of $r$ noticed mistakes, you choose the $r$ problems that will be noticed mistakes in $\binom{n}r$ ways, and then you multiply by $p^r(1-p)^{n-r}$, where $p$ is the probability that a particular problem is a noticed mistake. You can express $p$ in terms of $h$ and $k$.