I am designing a function $A(x)$ that map $x\to \{0,1\}$. The function $A$ can be expressed as $$A(x)=\begin{cases} 1 \text{ if $p_1(x) \ge p_2(x)$}\\ 0 \text{ otherwises} \end{cases} $$ where $p_1$ and $p_2$ are Gaussian distribution:
$p_1(x)=\frac{1}{\sqrt{2\pi}\sigma_1}\exp\left( {-\frac{(x-\mu_1)^2}{2\sigma_1^2}} \right)$;
$p_2(x)=\frac{1}{\sqrt{2\pi}\sigma_2}\exp\left( {-\frac{(x-\mu_2)^2}{2\sigma_2^2}} \right)$.
Could you help me to derive a short form of $A(x)$ ?
This is my solution. However, it maybe wrong
I derived the bellow eq. $$A(x)=\begin{cases} 1 \text{ if $\log \frac{p_1(x)}{p_2(x)}>0$}\\ 0 \text{ otherwises} \end{cases} $$ where $\log(e)=1$
We have $$\log \frac{p_1(x)}{p_2(x)}=\log \frac{\sigma_2}{\sigma_1}+\left( {\frac{x-\mu_2}{\sqrt{2}\sigma_2}} \right)^2-\left( {\frac{x-\mu_1}{\sqrt{2}\sigma_1}} \right)^2$$
Hence, my final solution is $$A(x)=\begin{cases} 1 \text{ if $\left (\log \frac{\sigma_2}{\sigma_1}+\left( {\frac{x-\mu_2}{\sqrt{2}\sigma_2}} \right)^2-\left( {\frac{x-\mu_1}{\sqrt{2}\sigma_1}} \right)^2 \right) \ge 0$}\\ 0 \text{ otherwises} \end{cases} $$
Thanks in advance