# Deriving of optimal decision boundary of two Gaussians

Given two Gaussians with the same variance $$\sigma$$ and means $$\mu_1$$ and $$\mu_2$$, where each Gaussian represents a class $$C_1$$ and $$C_2$$ with the same prior probabilities, i.e. $$p(C_1) = p_(C_2)$$, we should derive the decision boundary $$x^*$$ as a function of $$\mu_1$$ and $$\mu_2$$.

I know that it holds for the decision boundary $$p(x|C_1) = p(x|C_2)$$. We know further that $$p(x|C_1) = \mathcal{N}(x|\mu_1, \sigma)$$ and $$p(x|C_2) = \mathcal{N}(x|\mu_2, \sigma)$$.

So we have

\begin{align} &\frac{1}{\sqrt{2\pi\sigma^2}}\exp(-\frac{(x - \mu_1)^2}{2\sigma^2}) = \frac{1}{\sqrt{2\pi\sigma^2}}\exp(-\frac{(x - \mu_2)^2}{2\sigma^2})\\ \Longleftrightarrow & -\frac{(x - \mu_1)^2}{2\sigma^2} = -\frac{(x - \mu_2)^2}{2\sigma^2}\\ \Longleftrightarrow & x^2 - 2x\mu_1 + \mu_1^2 = x^2 - 2x\mu_2 + \mu_2^2\\ \Longleftrightarrow & x(2\mu_2 - 2\mu_1) = -(\mu_1^2 + \mu_2^2)\\ \Longleftrightarrow & x = -\frac{\mu_1^2 + \mu_2^2}{2\mu_2 - 2\mu_1} \end{align}

Is this approach and the solution for the decision boundary right?

The approach is correct and the solution is almost correct. \begin{aligned} x^2-2x\mu_1+\mu_1^2&=x^2-2x\mu_2+\mu_2^2 \\\iff 2x(\mu_2-\mu_1)&=\mu_2^2-\mu_1^2 \\\iff x^*&=\dfrac{\mu_2+\mu_1}{2}. \end{aligned}