## Exercise 2.5
In this exercise, we prove that the beta distribution, given by 

$$
\mathrm{Beta}(\mu|a, b) = \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}\mu^{a-1}(1-\mu)^{b-1},
$$


is correctly normalized, so that $\int_0^1\mathrm{Beta}(\mu|a, b)d\mu = 1$. 

### Solution
This is equivalent to showing that

$$
\int_0^1\mu^{a-1}(1-\mu)^{b-1}d\mu = \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}
$$

From the definition of the gamma function, we have

$$
\Gamma(a)\Gamma(b) = \int_0^\infty\exp(-x)x^{a-1}dx\int_0^\infty\exp(-y)y^{b-1}dy
$$

Let $t = y + x$, we obtain

\begin{align}
\Gamma(a)\Gamma(b) & = \int_0^\infty x^{a-1}\left\{\int_x^\infty \exp(-t)(t-x)^{b-1}\mathrm{d}t\right\}\mathrm{d}x \\
& = \int_0^\infty\int_0^t x^{a-1}\exp(-t)(t-x)^{b-1}\mathrm{d}x\mathrm{d}t
\end{align}

Change the variables in the $x$ integral using $x=t\mu$ to give

\begin{aligned}
\Gamma(a)\Gamma(b) & = \int_0^\infty\exp(-t)t^{a-1}t^{b-1}t\mathrm{d}t\int_0^1\mu^{a-1}(1-\mu)^{b-1}\mathrm{d}\mu \\
& = \Gamma(a+b)\int_0^1\mu^{a-1}(1-\mu)^{b-1}\mathrm{d}\mu
\end{aligned}

7f2bfe28700671d4b67e45f39438c72a68338eef
ipynb
Jupyter Notebook
bishop/chapter02/q05-Beta-Distributions.ipynb
yusueliu/murphy-book
71d62cc083a683fb861be1e5acb8eeb948b00c54
Apache-2.0
2019-03-25T22:22:23.000Z
2019-09-29T20:46:58.000Z
bishop/chapter02/q05-Beta-Distributions.ipynb
yusueliu/murphy-book
71d62cc083a683fb861be1e5acb8eeb948b00c54
Apache-2.0
bishop/chapter02/q05-Beta-Distributions.ipynb
yusueliu/murphy-book
71d62cc083a683fb861be1e5acb8eeb948b00c54
Apache-2.0
2021-12-24T01:14:12.000Z
2021-12-24T01:14:12.000Z
Qwen/Qwen-72B
1. YES
2. YES