The proof of the Neyman-Pearson lemma relies on finding some threshold such that where is the likelihood ratio. If is continuous, then this is possible. But what if the distribution is discrete? In that case, we use randomization.

We still use a variant of the likelihood-ratio test, but it has the following form:

for some threshold and where is chosen such that has type-I error exactly . Therefore, solves . This might be considered a form of external randomization.

The fact that we use randomization is not without controversy. There are people who don’t like this, and it’s not that hard to understand why. If you give the same people the same data and run the same test, it’s possible you get different outcomes—one person rejects while the other accepts.