# Chinese restaurant process vs Dirichlet Process

On Wikipedia Dirichlet Process page, regarding the connection between the Chinese restaurant process and the Dirichlet process it's state the following

If one associates draws from the base measure H with every table, the resulting distribution over the sample space S is a random sample of a Dirichlet process.

What does it mean to:

Associate draws from the base measure H with every table?

It doesn't make any sense to me.

A sample from a Dirichlet Process, or DP, is a distribution over a sample space $$S$$. Here the DP is defined based on a base distribution $$H$$ over $$S$$. For instance, in the Wikipedia example from your page, the sample space is all real numbers $$\mathbb{R}$$ and the base distribution is the standard Normal.
The Chinese restaurant process, or CRP, defines a partition over integers $$1,2,...,n$$ at each time $$n$$, and $$n$$ can go to $$\infty$$. In this metaphor each block in the partition is called a table. Notice that the CRP itself has nothing to do with the original sample space $$S$$ or the base distribution $$H$$.
To associate draws from the base measure H with every table, it means for each table $$i$$, you independently draw one sample $$s_i$$ from $$S$$ according to the base distribution $$H$$. You repeat the sample $$s_i$$ for $$b_i$$ times, where $$b_i$$ is the number of "customers" seated in the $$i$$'th table in that Chinese restaurant. The distribution of all those repeated samples for all tables, is your sample distribution from the DP.
• For you question 1, two samples from the DP are two different distributions over $S$. It's not so proper to say that they have two different probability distribution. For your question 2, the number of tables in the CRP is infinite; but for the DP we don't have "tables". If you are reading the "Formal definition" section in the wikipedia page, note that there the "partition" means an arbitrary partition over $S$, not the same partition over integers in the CRP metaphor. – user12075 Jan 9 '19 at 21:49
• Regarding Question two, I'm trying to figure out what does the formal definition actually states particularly. What does it mean $\text{then }(X(B_1),\dots,X(B_n)) \sim \operatorname{Dir}(\alpha H(B_1),\dots, \alpha H(B_n))$. What does the, excuse me for the term, Dirichlet Function return? A vector with N probability measure? Where does N come from? – Tommaso Bendinelli Jan 9 '19 at 22:00
• In the "formal definition" for DP, the "Dir" means Dirichlet distribution (not a "Dirichlet function"). A Dirichlet distribution is a $n$-dimensional probability distribution, which is parameterized by $n$ parameters. So you can say that $Dir()$ returns a $n$-dimensional random variable. Here $n$ is the number of (finite) partitions you arbitrarily chosen. (and again, this is not the "partition" in the CRP). – user12075 Jan 9 '19 at 22:23
• You might still be a little confused about the definition of the DP. The DP has two parameters: a base distribution $H$ over the sample space $S$, and the concentration constant $\alpha$. $n$ is not one of them. (The "formal definition" does mean that for any $n$ and any partition ($B_1$, ..., $B_n$) of $S$, blablabla..., but you don't need a $n$ to define a DP.) And as I mentioned above, the number of tables in a CRP is infinite. – user12075 Jan 9 '19 at 22:51