We can generate a Dirichlet random variate by relying on a stick-breaking algorithm [1]} (alg:orddir). Stick-breaking [2]} iteratively partitions (breaks) a line (stick) into parts. The size (length) of the broken part is determined by sampling from a Beta distribution.
