The expected value Ex∼p[x] of a continuous distribution with probability density function given by p is the "average" value of a random variable with this distribution, and can be computed using the following formula:
Ex∼p[x]=∫∞−∞xp(x)dx .
Compute the expectation of the exponential distribution, whose density function is:
p(x;λ)=λ(1x≥0)exp(−λx) ,
for a given parameter λ>0, where the indicator function 1x≥0 is 1 if x is non-negative and 0 if x is negative.
A.:
We have:
Ex∼p[x]=∫∞−∞xλ(1x≥0)exp(−λx)dx=∫∞0xλexp(−λx)dx.
Using integration by parts,
∫∞0xλexp(−λx)dx=−xexp(−λx)|∞0−∫∞0λexp(−λx)dx.
The first term vanishes, because both extremes evaluate to zero. For the second term, we have:
−∫∞0λexp(−λx)dx=−1λexp(−λx)|∞0=1λ.
The expected value is therefore 1/λ.
A.:
The density function is positive for x≥0 only. In this domain, the density is strictly decreasing. It follows that the maximum value is found for x=0, and the value is λexp(−0)=λ.