It's a lot of time that I don't do probability stuff, so probably this is a very naive question for most of you. Anyway..
For the linear (fisher) discriminant we have an inpu $X$ and an output $Y$ and, in particular, we assume that
$$ Y\sim Bernoulli(\pi)$$ $$ X|Y=k \sim N(x|\mu_k,\Sigma)$$
Then, when I want to obtain the likelihood function, I do
$$log~p(x,y) = \sum_{i=1}^N logp(x_i,y_i)\\= \sum_{i=1}^N log\{[\pi N(x_i|\mu_1,\Sigma)]^{y_i} [(1-\pi) N(x_i|\mu_1,\Sigma)]^{1-y_i} \}$$
but I don't undesrtand why also $N(x_i|\mu,\Sigma)$ is to the power of $y_i$ and $ (1-y_i)$ or, in other words, why it's not like this:
$$log ~p(x,y) = \sum_{i=1}^N logp(x_i,y_i)\\= \sum_{i=1}^N log\{[\pi^{y_i} N(x_i|\mu_1,\Sigma)] [(1-\pi)^{1-y_i} N(x_i|\mu_1,\Sigma)] \}$$
Since all I'm doing is multiplying (for the chain rule) $p(y) = \pi^{y}(1-\pi)^{1-y}$ and $p(x|y=k) = N(x|\mu_k,\Sigma) = \frac{1}{(2\pi|\Sigma|)^{\frac{1}{2}}} \exp\{-\frac{1}{2}(x - \mu_k)^T\Sigma^{-1}(x-\mu_k)\}$