Given two normal populations,, classifying a given data point I have two normal populations S1 and S2, where S1 ~ N (μ1, σ1) and S2 ~ N (μ2, σ2) respectively. The populations are independent of each other and a data point X has to be either from S1 or from S2. Suppose that I have been given the estimates of μ1, μ2, σ1, σ2 and I’ve been given the priori probability of S1 and S2, say P(S1) = π1 and P(S2) = π2.
My question is, given a data point X1, how do I classify the data X1 into S1 or S2 with the given information. The data I have in not labelled so I cannot go for supervised learning.
I have tried to solve using simple Bayesian probability, but since, X1=x is a real values number not an interval, my numerator will logically be zero.
How should I solve this? I'm stuck.
Can anyone show me some direction?
 A: Consider the two possible normal populations as models, $p(\mathcal{M_1}),  p(\mathcal{M_2})$, that is, two hypothesis that compete to explain your datum $X$.
The prior information tells which is the prior odds,
$$\frac{p(\mathcal{M_1})}{p(\mathcal{M_2})} = \frac{\pi_1}{\pi_2}$$
You can apply the standard formula
$$\underbrace{ \frac{P({\cal M}_1\mid X)}{P({\cal M}_2\mid X)} }_{\text{posterior odds}} = \underbrace{ \frac{P(X \mid {\cal M}_1)}{P(X\mid{\cal M}_2)} }_{\text{Bayes Factor}} \times\underbrace{\frac{P({\cal M}_1)}{P({\cal M}_2)}}_{\text{prior odds}}$$
To compute the likelihoods $P({X \mid \cal M}_i)$ use the density of the Normal, which is another initial assumption.
An example in R:
likelihood <- function(mu, sigma) {
  function(x) dnorm(x, mu, sigma)
}

lik.M1 <- likelihood(0.0,0.5)
lik.M2 <- likelihood(2.0,0.5)

pi1 <- 0.2
pi2 <- 1-pi1

x <- 0.5

prior.odds <- pi1/pi2
bayes.factor <- lik.M1(x) / lik.M2(x)
posterior.odds <- bayes.factor * prior.odds

posterior.odds

With these values, it returns odds 13.7:1
