Suppose that $Y$ is a random variable taking on one of $n$ known values:
$$
a_{1}, a_{2}, \ldots, a_{n} .
$$
Suppose we know that $Y$ either has distribution $p$ given by
$$
\mathbb{P}\left(Y=a_{j}\right)=p_{j}
$$ or it has distribution $q$ given by
$$
\mathbb{P}\left(Y=a_{j}\right)=q_{j} .
$$
Of course, the numbers $p_{j}, j=1,2, \ldots, n$ are nonnegative and sum to one. The same is true for the $q_{j}$ 's. Based on a single observation of $Y$, we wish to guess whether it has distribution $p$ or distribution $q$. That is, for each possible outcome $a_{j}$, we will assert with probability $x_{j}$ that the distribution is $p$ and with probability $1-x_{j}$ that the distribution is $q$. We wish to determine the probabilities $x_{j}, j=1,2, \ldots, n$, such that the probability of saying the distribution is $p$ when in fact it is $q$ has probability no larger than $\beta$, where $\beta$ is some small positive value (such as $0.05$ ). Furthermore, given this constraint, we wish to maximize the probability that we say the distribution is $p$ when in fact it is $p$. Formulate this maximization problem as a linear programming problem.