To be added,w can be treated as a random variable, which generally follows Binomial (or Bernoulli) distribution w/ parameter pi. But we cannot observe w. In practice, w is replaced with its conditional mean, i.e., E(w|y;mu,sigma,pi) = Prob(w=1|y;mu,sigma,pi) = pi*f(y;mu1,sigma1)/[pi*f(y;mu1,sigma1)+(1-pi)*f(y;mu2,sigma2)]. In the EM algorithm, the parameters relevant to y (mu and sigma) are estimated first; then pi is estimated. This procedure is repeated until convergence condition is satisfied.