# Expectation Maximization: How to perform "E" step in coin flipping example? [duplicate]

I recently read this primer that does a great job of explaining the principles of the Expectation-Maximization (EM) "algorithm."

However, I'm confused about how they calculated the probability distributions of each possible "completion" (coin) that we see in this figure after the "E-step":

My attempt:

I decided to try and use a simpler example. Let's say the coin biases are $$\theta_A = 0.8$$ and $$\theta_B = 0.2$$ Also, we only flipped one coin twice and observed the following: $$HH$$

Now the probability for the $$HH$$ permutation for coin A is $$\frac{4}{5}*\frac{4}{5} = \frac{16}{25}$$

And the probability for the $$HH$$ permutation for coin B is $$\frac{1}{5}*\frac{1}{5} = \frac{1}{25}$$

So in other words, for every one observation of the $$HH$$ permutation from coin B, we would expect 16 observations of $$HH$$ permutation from coin A.

If we assume that these are the only two possible outcomes, the probability of $$HH$$ permutation from coin A is $$\frac{16}{16 + 1}$$ and the probability of $$HH$$ permutation from coin B is $$\frac{1}{16 + 1}$$

If my approach is correct, is this the general form of the "expectation" step of the EM algorithm:

• Find the probability of each observation occurring using t = 0 parameters.
• Find the "relative" (not sure if this is the right term) probabilities to get the distribution