I've been struggling trying to see the logic on how the author of a book arrives at an expected value. For reference, the book in question is Machine Learning by Bishop, Page 443, equation (9.38) and (9.39).
A posterior distribution in the book is written as
$$ p(\mathbf{Z}| \mathbf{X}, \boldsymbol{\mu}, \boldsymbol{\pi}) \propto \prod_n{ \prod_k{ [\pi_k \mathcal{N}(\boldsymbol{x}_n | \boldsymbol{\mu}_k, \mathbf{\Sigma}_k)]^{z_{nk}} } } $$
where $\boldsymbol{z}$ has a 1-of-K binary representation in which a particular element $z_{k} \in \{0, 1\}$ and $\sum_k{z_k} = 1$, and $z_{nk}$ denotes the indicator for the $n$th point, $\{\boldsymbol{z}_n\}$ are independent, $\pi \in [0, 1]$, $\sum_k{\pi_k} = 1$, and $\mathcal{N}$ is the Gaussian distribution.
Then the author states that
The expected value of the indicator variable $z_{nk}$ under this posterior distribution is then given by $$\mathbb{E}[z_{nk}] = \frac{ \sum_{\boldsymbol{z}_n}{ z_{nk} \prod_{k'}[\pi_{k'} \mathcal{N}(\boldsymbol{x}_n | \boldsymbol{\mu}_{k'}, \mathbf{\Sigma}_{k'})]^{z_{nk'}}} }{\sum_{\boldsymbol{z}_n}{ \prod_j [\pi_j \mathcal{N}(\boldsymbol{x}_n | \boldsymbol{\mu}_j, \mathbf{\Sigma}_j)]^{z_{nj}} } } = [\cdots] $$
I understand the denominator is the normalization term. But I am having a hard time figuring out as to how this equation comes about. More specifically, I'm trying to understand why both the numerator and the denominator are missing an extra $\prod_n{}$ term.