Consider a one-dimensional classification problem with $X = \mathbb R$ and $Y = \{-1, +1\}$: $$p(y=-1)=\frac{3}{5} \qquad p(x \mid y=-1)=\frac{1}{2\sqrt{2\pi}}e^{-\frac{(x+2)^2}{8}} \qquad N(-2, 2)$$ $$p(y=+1)=\frac{2}{5} \qquad p(x \mid y=+1)=\frac{1}{\sqrt{2\pi}}e^{-\frac{(x-1)^2}{2}} \qquad N(1, 1)$$
- Find the marginal distribution $p(x)$ and the conditional distributions $p(y = -1 \mid x)$ and $p(y = +1 \mid x)$.
- Guess from $p(y = -1 \mid x)$ and $p(y = +1 \mid x)$ what the Bayes-optimal classifier is like.
Could you please direct me on how to start with solving the first order or point me to a good easy explained document with examples about marginal distributions for continuous and discrete variables, and how could $N(-2,2), N(1,1)$ be used in solving this question?
I started using the formula: $p(x) = p(x \mid y=-1) * p(y=-1) + p(x \mid y=+1) * p(y=+1)$ then replaced each term with its value from the question, then tried to simplify the formula but with no luck as it got more complex.