I want to take a decision on two gaussian distributions, what approach can I take? I observe a one dimensional random source, which could be any of two Gaussian distributions with a different set of parameters that do not change over time. They have a the same variance and a slightly different median (plus or minus 5%).
I can ask for as many points of data as I want, however I want to be able to recognize the distribution as fast as possible (that is, with as little observations as possible). A simple threshold on one observation is not good enough, since both distributions overlap significantly.


*

*This problem is probably very common, what is the name for it?

*What is a standard approach to solve this?
 A: Let's call the two Gaussians $G_0$ and $G_1$, their known means $\mu_0$ and $\mu_1$, and their common variance $\sigma^2$.  We may as well assume that $\mu_0 < \mu_1$ and that the data is coming from $G_0$, because the situation is totally symmetric.
Here's the decision precoedure:


*

*Calculate the mean of the sample $\hat{\mu}$.

*Calculate the distance from $\hat{\mu}$ to $\mu_0$ and $\mu_1$.

*If the sample mean is closer to $\mu_0$, choose $G_0$, otherwise choose $G_1$.


To estimate how often we choose incorrectly, let's say we have $N$ data points.  Then the sampling distribution of $\mu_0$ is:
$$ \hat{\mu_0} \sim N \left( \mu_0, \frac{\sigma}{N} \right) $$
We make the wrong choice when:
$$ \hat{\mu_0} > \frac{1}{2} \left( \mu_0 + \mu_1 \right) $$
We can calculate the probability (taken with respect to the sampling distribution) of this event as:
$$ Pr \left( \hat{\mu_0} > \frac{1}{2} (\mu_0 + \mu_1) \right)
   = Pr \left( x \sim N \left( 0, \frac{\sigma}{N} \right) > \frac{1}{2} (\mu_1 - \mu_0) \right) $$
Everything in this final equation is known, so given a pre-specified error rate, you can back into how much data you need.
