Correct or not? Mixed Bayes' Rule - Noisy Communication In this problem, we study a simple noisy communication channel. Suppose that  $X$  is a binary signal that takes value  $−1$  and  $1$  with equal probability. This signal  $X$  is sent through a noisy communication channel, and the medium of transmission adds an independent noise term. More precisely, the received signal is  $Y=X+N$ , where  $N$  is standard normal, indpendendent of  $X$ .
The decoder receives the value  $y$  of  $Y$, and decides whether  $X$  was  $1$  or  $−1$,  using the following decoding rule: it decides in favor of  $1$  if and only if
$$P(X=1|Y=y)>2P(X=-1|Y=y)$$
It turns out that the decoding rule can be expressed in the form: decide in favor of  $1$  if and only if  $Y>t$, for some threshold t. Find the threshhold t .
As an intermediate step, find  $p_1≜P(X=1|Y=y).$
I get the answer of $p_1 = {e^{-2*(y-1)/2}\over e^{-2*(y-1)/2}+e^{-2*(y+1)/2}}$
or is the answer, $p_1 = \frac{1}{1 + e^{-2*y}}$
 A: Both answers are correct. 
The likelihood is defined as
$$
p \left(Y \mid X=1 \right) = \frac{1}{\sqrt{2\pi}}\, e^{\frac{-\left(y-1 \right)^2}{2}}
$$
Assuming both $X=1$ and $X=-1$ have the same probability, $p(X=1)=\frac{1}{2}$, the posterior is found with Bayes rule as following.
$$
\begin{align}
p \left(X=1 \mid Y \right) &= \frac{p \left(Y \mid X=1 \right)\cdot p \left(X=1 \right)}{p\left(Y \right)}\\
&=\frac{p \left(Y \mid X=1 \right)\cdot \frac{1}{2}}{\frac{1}{2} \cdot p\left(Y\mid X=1 \right) + \frac{1}{2} \cdot p\left(Y\mid X=-1 \right)}\\
&= \frac{\frac{1}{\sqrt{2\pi}}\, e^{\frac{-\left(y-1 \right)^2}{2}} \cdot \frac{1}{2}}{ \frac{1}{2} \cdot \frac{1}{\sqrt{2\pi}}\, e^{\frac{-\left(y-1 \right)^2}{2}} + \frac{1}{2} \cdot \frac{1}{\sqrt{2\pi}}\, e^{\frac{-\left(y+1 \right)^2}{2}} } \\
&= \frac{e^{\frac{-\left(y-1 \right)^2}{2}} }{ e^{\frac{-\left(y-1 \right)^2}{2}} + e^{\frac{-\left(y+1 \right)^2}{2}} }
\end{align} 
$$
This can be manipulated further to obtain your second answer
$$
\begin{align}
p \left(X=1 \mid Y \right) &= \frac{e^{\frac{-\left(y-1 \right)^2}{2}} }{ e^{\frac{-\left(y-1 \right)^2}{2}} + e^{\frac{-\left(y+1 \right)^2}{2}} }\\
&= \frac{1}{ 1+ e^{\frac{-\left(y+1 \right)^2}{2} - \frac{-\left(y-1 \right)^2}{2}} }\\
&= \frac{1}{ 1+ e^{-2y} }
\end{align} 
$$
Couldn't resist but finish also the rest of the exercise. The threshold $t$ is the value of $y$ that satisfies the following
$$
p \left(X=1 \mid Y =t\right) = 2 \cdot p \left(X=-1 \mid Y=t \right)
$$
Plugging in the formula of the posterior distribution found above, and solving for $t$ results in 
$$
t = \frac{\log_e 2}{2}
$$
