# Given the p.d.f. of X, find the mean and variance of $X$.

Suppose that $X$ has probability density function,

$$f(x)=\begin{cases} \dfrac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1} & \text{for }0\leq x\leq1 \\[8pt] 0 & \text{otherwise}. \end{cases}$$

where $\alpha,\beta>0$ and $\Gamma$ is the gamma function which is defined by

$$\Gamma(r)=\int^\infty_0 u^{r-1}e^{-u} \, du$$

This function has the property that $\Gamma(r+1)=r\Gamma(r)$ for $r>0$. Using this fact, find the mean and variance of $X$.

Hint: remember that p.d.f.'s integrate to 1; there's no need to actually do any integration in this question

Not sure. My attempt seems completely botched.

Consider

$$E[X]=\int^\infty_{-\infty} xf(x) dx=\int^{1}_{0}x\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1} \, dx$$

Note: $\dfrac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}=\dfrac{\alpha^{\beta}\Gamma(\alpha)}{\Gamma(\alpha)\Gamma(\beta)}=\dfrac{\alpha^{\beta}}{\Gamma(\beta)}$

Since $\frac{\alpha^{\beta}}{\Gamma(\beta)}$ is a constant,

$$\int^1_0 x\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} x^{\alpha-1}(1-x)^{\beta-1} \, dx = \frac{\alpha^\beta}{\Gamma(\beta)} \int^1_0 x x^{\alpha-1} (1-x)^{\beta-1} \, dx=\frac{\alpha^\beta}{\Gamma(\beta)} \int^1_0 x^{\alpha}(1-x)^{\beta-1} \, dx$$

How should I proceed or am approaching this completely incorrectly?

• It is not correct that $\Gamma(\alpha+\beta) = \alpha^\beta \Gamma(\alpha)$. ${}\qquad{}$ – Michael Hardy Jun 11 '15 at 0:18
• BTW you might profit from looking at my edits to your MathJax code. You had this: $f(x)=\Bigg\{^{\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1} for 0\leq x\leq1}_{0, otherwise}$ I changed that to this: $$f(x)=\begin{cases} \dfrac{\Gamma(\alpha+\beta)}{\Gamma(\alpha) \Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1} & \text{for }0\leq x\leq1 \\[8pt] 0 & \text{otherwise}. \end{cases}$$ ${}\qquad{}$ – Michael Hardy Jun 11 '15 at 0:28

You have $$\int_0^1 x^{\alpha-1} (1-x)^{\beta-1}\,dx = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}. \tag 1$$

You want \begin{align} \operatorname{E}(X) & = \int_0^1 x f(x)\,dx = \int_0^1 x \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} x^{\alpha-1} (1-x)^{\beta-1}\,dx \\[10pt] & = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} \int_0^1 x^\alpha (1-x)^{\beta-1}\,dx = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} \overbrace{\int_0^1 x^{(\alpha+1)-1} (1-x)^{\beta-1}\,dx} \end{align} The expression under the $\overbrace{\text{overbrace}}$ is the same thing you see in $(1)$ except that it has $\alpha+1$ instead of $\alpha$. The equality in $(1)$ holds if $\alpha$ is any positive number at all. And $\alpha+1$ is a positive number. Therefore $$\int_0^1 x^{(\alpha+1)-1} (1-x)^{\beta-1}\,dx = \frac{\Gamma(\alpha+1)\Gamma(\beta)}{\Gamma((\alpha+1)+\beta)}.$$ So you get a product: $$\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\cdot\frac{\Gamma(\alpha+1)\Gamma(\beta)}{\Gamma((\alpha+1)+\beta)}.$$ Then $\Gamma(\beta)$ cancels, $\Gamma(\alpha+1)$ is replaced by $\alpha\Gamma(\alpha)$, and $\Gamma(\alpha+\beta+1)$ is replaced by $(\alpha+\beta)\Gamma(\alpha+\beta)$, and we do further cancellations, getting $$\frac \alpha {\alpha+\beta}.$$ That is the expected value.

You can find $\operatorname{E}(X^2)$ similarly and then use the fact that $\operatorname{var}(X) = \operatorname{E}(X^2) - (\operatorname{E}(X))^2$.

Since the pdf is normalized

$$\int^1_0x^{\alpha-1}(1-x)^{\beta-1} \, dx = \frac{\Gamma(\alpha)\Gamma(\beta)} {\Gamma(\alpha+\beta)}$$

So that

$$\int^1_0x^{\alpha}(1-x)^{\beta-1} \, dx = \frac{\Gamma(\alpha +1 )\Gamma(\beta)} {\Gamma(\alpha+\beta+1)}$$

$$E(x) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} \int^1_0x^{\alpha}(1-x)^{\beta-1} \, dx = \frac{\Gamma(\alpha+1)}{\Gamma(\alpha)} \times \frac{\Gamma(\beta)}{\Gamma(\beta)} \times \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha + \beta+1)} = \frac{\alpha}{\alpha + \beta}$$