I am trying to understand the Chinese Restaurant process (CRP) and Weighted Chinese Restaurant process (WCRP) described in a research paper "Automatic Discovery of Cognitive Skills"- Robert V. Lindsey, Mohammad Khajah, Michael C. Mozer to Improve the Prediction of Student Learning. In CRP all the implementations (cf., [Infinite mixture models with nonparametric Bayes and the Dirichlet process](http://blog.echen.me/2012/03/20/infinite-mixture-models-with-nonparametric-bayes-and-the-dirichlet-process/)) have a comparison made with the random number to decide if the customer chooses to sit on a new or existing table. Why this check is made and also how will this check condition differ in WCRP?