# May I know how to solve it?? Thank you

## The moment generating function of X is M(t)=$\left({e}^{2} t - {e}^{6} t\right) / t \left(6 - 2\right)$. a) what is the distribution of X? b) find P(2<=X<=3). c)the p.d.f for uniform distribution is f(x)= 1/(b-a) for $a \le x \le b$. Show that the $\mu = \left(a + b\right) / 2 \mathmr{and} {\theta}^{2} = {\left(b - a\right)}^{2} / 12$.

Dec 29, 2017

Recognize that $M \left(t\right) = \frac{{e}^{6 t} - {e}^{2 t}}{4 t}$ is the moment generating function of a uniform distribution over the interval $\left[2 , 6\right]$. Find the probability by integrating the p.d.f. Calculate $\mu = E \left[X\right]$, $E \left[{X}^{2}\right]$, and ${\sigma}^{2} = E \left[{X}^{2}\right] - {\mu}^{2}$. (You could also try, with computer help, to calculate $M ' \left(0\right)$ and $M ' ' \left(0\right)$ (as limits) to help you confirm the mean and variance.)

#### Explanation:

As you stated, for a continuous random variable $X$ uniform distribution over $\left[a , b\right]$ (for $a \le x \le b$), the p.d.f. is $f \left(x\right) = \frac{1}{b - a}$.

The moment generating function is

$M \left(t\right) = E \left[{e}^{t X}\right] = {\int}_{- \infty}^{\infty} {e}^{t x} f \left(x\right) \mathrm{dx} = \frac{1}{b - a} {\int}_{a}^{b} {e}^{t x} \mathrm{dx}$

$= \frac{1}{\left(b - a\right) t} {e}^{t x} {|}_{x = a}^{x = b} = \frac{{e}^{b t} - {e}^{a t}}{\left(b - a\right) t}$.

(a) Therefore, $M \left(t\right) = \frac{{e}^{6 t} - {e}^{2 t}}{4 t}$ is the moment generating function of a uniform distribution over the interval $\left[2 , 6\right]$ (i.e., $f \left(x\right) = \frac{1}{4}$ for $2 \le x \le 6$).

(b) The probability is $P \left(2 \le X \le 3\right) = {\int}_{2}^{3} f \left(x\right) \mathrm{dx} = \frac{1}{4}$.

(c) In the general case, the mean is

$\mu = E \left[X\right] = {\int}_{- \infty}^{\infty} x f \left(x\right) \mathrm{dx} = \frac{1}{b - a} {\int}_{a}^{b} x \mathrm{dx} = \frac{1}{2 \left(b - a\right)} {x}^{2} {|}_{a}^{b} = \frac{{b}^{2} - {a}^{2}}{2 \left(b - a\right)} = \frac{a + b}{2}$

The mean is also the "first moment" $\mu = E \left[X\right] = {\lim}_{t \to 0} M ' \left(t\right)$ (see https://en.wikipedia.org/wiki/Moment-generating_function). Use a computer-algebra system to help you calculate this if you are interested.

The second moment is $E \left[{X}^{2}\right]$ (which also equals ${\lim}_{t \to 0} M ' ' \left(t\right)$). This is

$E \left[{X}^{2}\right] = {\int}_{- \infty}^{\infty} {x}^{2} f \left(x\right) \mathrm{dx} = \frac{1}{b - a} {\int}_{a}^{b} {x}^{2} \mathrm{dx} = \frac{1}{3 \left(b - a\right)} {x}^{3} {|}_{a}^{b} = \frac{{b}^{3} - {a}^{3}}{3 \left(b - a\right)} = \frac{{a}^{2} + a b + {b}^{2}}{3}$

The variance ${\sigma}^{2}$ (or ${\theta}^{2}$) is

${\sigma}^{2} = E \left[{X}^{2}\right] - {\mu}^{2} = \frac{{a}^{2} + a b + {b}^{2}}{3} - \frac{{a}^{2} + 2 a b + {b}^{2}}{4}$

$= \frac{4 {a}^{2} + 4 a b + 4 {b}^{2} - 3 {a}^{2} - 6 a b - 3 {b}^{2}}{12} = \frac{{a}^{2} - 2 a b + {b}^{2}}{12}$

$= \frac{{\left(a - b\right)}^{2}}{12} = \frac{{\left(b - a\right)}^{2}}{12}$.