We can now proceed to determine what value of n will minimize the loss L(n) by taking the derivative of L with respect to n.
where
and
n*,the optimal value of n,satisfies , whence we obtain a bound on n* as follows:
or
Noting that and that (1 - 2q) rapidly approaches 1 because q decreases exponentially with n, we see that where the error rapidly approaches zero as N increases. Thus the observation of the preceding paragraph is verified, the ratio of trials of the observed best to trials of second-best growing exponentially.
Finally, to obtain n* as an explicit function of N, q must be written in terms of n*:
Introducing b = s1/(µ1 - µ2) and N1 = N - n* for simplification, we obtain