0

Suppose we have two random variables $A$ and $B$ both uniformly distributed on $[0, 1]$. Define $Z=A+B$.

The moment generating function of $A$ and $B$ is $M_A(\theta)=M_B(\theta)=\frac{e^{\theta}-1}{\theta}$, so $M_Z(\theta)=M_A(\theta) M_B(\theta)=(\frac{e^{\theta}-1}{\theta})^2 = \frac{e^{2\theta}-2e^{\theta}+1}{\theta^2} $.

On the other hand the probability density function of $Z$ is $f_Z(z)=z$ for $z<1$ so we should have $M_Z(\theta)=E[e^{Z\theta}]=\int_0^1e^{z\theta}f_Z(z) \space dz= \int_0^1e^{z\theta}z \space dz = \frac{e^{\theta} \theta - e^{\theta} + 1}{\theta^2}$.

Can someone please explain me where does the difference of answers come from?

harlem
  • 547

1 Answers1

2

"On the other hand the probability density function of $Z$ is $f_Z(z) = z$ for $z<1$, so [...]

Why would that be the case? $Z$ is not uniform, it has a triangular distribution with parameters $a=0$, $b=2$ and $c=1$. You can check the MGF matches.

To get back the result with your computations: $f_Z$ is actually $$ f_Z(z) = z\mathbb{1}_{[0,1]}(z) - (2-z)\mathbb{1}_{[1,2]}(z) $$ (note that your proposed expression would integrate to $1/2$, not to $1$!). You can check that $$ \int_{0}^1 e^{z\theta}z \, dz + \int_{1}^2 e^{z\theta}(2-z) \, dz = \frac{(e^\theta-1)^2}{\theta^2} $$ as it should.

Clement C.
  • 67,323
  • https://math.stackexchange.com/questions/357672/density-of-sum-of-two-uniform-random-variables-0-1 what about this, then? – harlem May 04 '18 at 20:54
  • 2
    @harlem The link is correct (see also my edited answer), your expression is not. The support of the PDF is $[0,2]$, with one expression for $[0,1]$ and another for $[1,2]$. You only kept the first part... – Clement C. May 04 '18 at 20:56