Given two gassuian distributions, $g_1(\mu_1,\sigma_1)$ and $g_2(\mu_2,\sigma_2)$ and a point $x$ now we need to find the probability of $x$ being sampled from $g_1$ versus $g_2$. I thought of simply comparing their pdfs at that point $x$ but my friend said that it would give wrong result and we need to find conditional probabilities to estimate it.
I don't understand how can we do that.
Let $X$ be the observation, and let $E$ be the event that $X$ was chosen from $g_1$. Using Bayes' theorem: $$ P(E|X=x)=\frac{P(X=x|E)\cdot P(E)}{P(X=x|E)\cdot P(E)+P(X=x|E^c)\cdot P(E^c)} $$ If we interpret the above fraction literally, it would be $\frac00$, since $X$ is a continuous random variable. However, if we let $P(X=x|E)$ denote the conditional density of $X$ given $E$ has occurred, then the above is correct. I will let you fill in the details.