A 1-D Gaussian mixture has two components with equal weights π1=π2=0.5, means μ1=0 and μ2=4, and both variances equal to 1. For the data {0,1,5}, what are the E-step responsibilities and the updated weights and means after one EM iteration?

Unsupervised learning, Gaussian mixtures
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can carry out an E-step with Bayes' rule and an M-step with responsibility-weighted averages, with correct numbers.

Key idea

The responsibility is rik=πkN(xi∣μk,σk2)∑jπjN(xi∣μj,σj2). The M-step sets Nk=∑irik, πk=Nk/n and μk=1Nk∑irikxi.

Steps

  1. With equal weights and variances, the ratio is ri2ri1=exp⁡ ⁣(−(xi−4)2−xi22)=exp⁡(4xi−8).
  2. For x=0: ratio e−8=3.4×10−4, so r11=0.99966, r12=0.00034. For x=1: ratio e−4=0.0183, so r21=0.98201, r22=0.01799. For x=5: ratio e12, so r31≈6×10−6, r32≈0.999994.
  3. Effective counts: N1=0.99966+0.98201+0.000006≈1.9817 and N2=3−N1≈1.0183.
  4. New weights: π1=1.9817/3=0.6606 and π2=0.3394.
  5. New means: μ1=0.99966⋅0+0.98201⋅1+0.000006⋅51.9817=0.4956, and μ2=0.00034⋅0+0.01799⋅1+0.999994⋅51.0183=4.9277.
  6. If the variances were also updated, with the new means, σ12≈0.250 and σ22≈0.286. The component 1 mean moves from 0 to about 0.5 because it now owns the two points at 0 and 1.

Common mistakes

How long your answer should be

One page; 6–8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Unsupervised learning: How do you show that Ward's linkage, which merges the pair of clusters that least increases the total within-cluster sum of squares, has merge cost Δ(A,B)=nAnBnA+nB∥μA−μB∥2? How do you check it on A={0,2} and B={6}?
Next in Unsupervised learning: In EM for a Gaussian mixture with weights πk, means μk and covariances Σk, how do you derive the M-step updates for πk, μk and Σk from the expected complete-data log-likelihood?