Find $\mathbb{E}(X)$ and Var$(X)$ from the c.d.f. Suppose a child plays outside in the yard. On their own, they come back inside at a random time uniformly distributed on the interval [0,1] (Take the units to be hours.) However, if the child is not back in 50 minutes, their mother brings them in. Let X be the time when they come back in.

*

*What is the cumulative distribution function F of X?


*Find E[X].


*Find Var[X].
My Attempt

*

*The c.d.f.  is pretty straight forward from the problem.
\begin{equation}
F(s)=
\begin{cases}
0, & s<0\\
s, & 0\leq s<5/6\\
1, & s\geq 5/6
\end{cases}
\end{equation}


*Differentiating the c.d.f. gives us the p.d.f. $f(s)=1$ for $0\leq s <5/6$.
Thus, our expectation is
$$\mathbb{E}(X)=\int^{5/6}_0xdx=0.3472$$


*To find the variance, we also need $\mathbb{E}(X^2)$
$$\mathbb{E}[X^2]=\int^{5/6}_0x^2dx=0.1929$$
So the variance is
$$\text{Var}(X)=\mathbb{E}[X^2]-\mathbb{E}[X]^2=0.1929-0.3472^2=0.0723$$
Can I get verification on my answers? I am a little skeptical on the expectation because I was told that the expectation for a uniform distribution, Unif[a, b], can be calculated as $\mathbb{E}(X)=\frac{a+b}{2}=\frac{5/6+0}{2}=0.4167$, which is different from what I got using the integral method.
 A: your distribution is not absolutely continuous thus your expectation is wrong. Your random variable has a positive probability mass in $x=5/6$
An easy way to calculate its expectation is the following purple area $=35/72$

...you calculated only the area of the triangle...$=25/72$
Try yourself to reason about my hint and calculate the variance...
A: Another way to solve this is by ysing the heaviside step function $H(x)$ and the dirac delta function $\delta(x)$:
\begin{align*}
F(s)=
\begin{cases}
0, & s<0\\
s, & 0\leq s<5/6\\
\frac{5}{6} + \frac{1}{6}\cdot H(x-\frac{5}{6}), & s\geq 5/6
\end{cases}
\end{align*}
We can then write the pdf in terms of the dirac delta function, which is\begin{align*}f(s)=
\begin{cases}
0, & s<0\\
1, & 0< s<5/6\\
\frac{1}{6}\delta(x-\frac{5}{6}), & s\geq 5/6\\
\end{cases}\end{align*}
The expectation is better computed as an integral over
\begin{align*}
\mathbb E [X] &= \int\limits_{x=-\infty}^{0} x\cdot \mathbb P[X=x] + \int\limits_{x=0}^{\frac{5}{6}} x\cdot \mathbb P[X=x]+ \int\limits_{x=\frac{5}{6}}^{\infty} x\cdot \mathbb P[X=x]\\
&= \int\limits_{x=-\infty}^{0} x\cdot f[X=x]dx + \int\limits_{x=0}^{\frac{5}{6}} x\cdot f[X=x]dx+ [X=\frac{5}{6}]\cdot\frac{1}{6} \int\limits_{x=\frac{5}{6}}^{\infty}\delta(x-\frac{5}{6})\\
&= \int\limits_{x=-\infty}^{0} x\cdot 0dx + \int\limits_{x=0}^{\frac{5}{6}} x\cdot 1 dx+ \frac{5}{6}\cdot \frac{1}{6}\int\limits_{x=-\infty}^{\infty}\delta(x-\frac{5}{6})\\
&= 0 + \frac{25}{36\cdot 2}+ \frac{5}{6}\cdot \frac{1}{6}\cdot 1\\
&= \frac{35}{72}
\end{align*}
Similarly, one can solve $\mathbb E [X^2]$
\begin{align*}
\mathbb E [X^2] &= \int\limits_{x=-\infty}^{0} x^2\cdot \mathbb P[X=x] + \int\limits_{x=0}^{\frac{5}{6}} x^2\cdot \mathbb P[X=x]+ \int\limits_{x=\frac{5}{6}}^{\infty} x^2\cdot \mathbb P[X=x]\\
&= 0 + \int\limits_{x=0}^{\frac{5}{6}} x^2\cdot f[X=x]dx+ [X=\frac{5}{6}]^2\cdot\frac{1}{6} \int\limits_{x=\frac{5}{6}}^{\infty}\delta(x-\frac{5}{6})\\
&= \int\limits_{x=0}^{\frac{5}{6}} x^2dx+ \frac{5^2}{6^2}\cdot \frac{1}{6}\int\limits_{x=-\infty}^{\infty}\delta(x-\frac{5}{6})\\
&= 0 + \frac{125}{216\cdot 3}+ \frac{25}{36}\cdot \frac{1}{6}\cdot 1\\
&= \frac{200}{648}=\frac{25}{81}
\end{align*}
