# Derivation of the posterior over topics in LDA

When studying the latent Dirichlet allocation, I am not very clear about some procedures in their deriving equations. Please refer to the attached figure, how to understand those two steps, marked as 1 and 2 in the figure.

1: denoting $z_{d,n} = A$, $w_{d,n} = B$ , $\theta_{d} = C$, $\beta_k = D$, and using the Bayes rule:
$\displaystyle p(A|B,C,D) = \frac{p(A|C,D) \ p(B|A,C,D)}{p(B|C,D)} \propto p(A|C,D)\ p(B|A,C,D)$,
where $\propto$ means it is proportional, which is the case because $p(B|C,D)$ does not depend on $A$ i.e. is a constant.
2: we can get knowing that both $p(z|\theta)$ and $p(w|z,\beta)$ are (presumably) discrete distributions, thus assigning fixed values $\theta_{d,k}$ and $\beta_{k, w_{d,n}}$.