I am reading a tutorial on the Dirichlet distribution: http://mayagupta.org/publications/FrigyikKapilaGuptaIntroToDirichlet.pdf
and I think there is a typo in Step 2 of the stick-breaking model of the Dirichlet distribution:
Specifically, I think some of the $u_i$ should be $q_i$. If pieces with lengths $u_1,u_2,...,u_{j-1}$ have been broken off, how can the length of the remaining stick be $\prod_{i=1}^{j-1}(1-u_i)$, shouldn't it be $1-\sum_{i=1}^{j-1}u_i$? It would make sense if the it the length of the remaining stick were $\prod_{i=1}^{j-1}(1-q_i)$. I believe the last line of Step 2 should also be $q_i$ instead of $u_i$. Please tell me if I am wrong, I find this quite confusing.