Compute $E[\sin(X)] -\sin(E[X])$

375 Views Asked by At

Say $X$ is uniformly distributed on the interval $[\pi,2\pi]$

Compute $E[\sin(X)] - \sin(E[X])$

So first, apparently $E[X] = \frac{3\pi}{2}$ which I don't really understand, second, for some reason, $E[\sin(x)] = \int_\pi^{2\pi} \frac{\sin(x)}{\pi}$.

I don't understand how $E[X] = \frac{3\pi}{2}$ and I also don't really understand how to go from $E[\sin(x)]$ to $ \int_\pi^{2\pi} \frac{\sin(x)}{\pi}$. Would appreciate some help, thanks in advance!

2

There are 2 best solutions below

0
On BEST ANSWER

The expectation of a continuous distribution over an interval is pretty much the continuous analogue of the expectation of a discrete distribution.

Discrete: $E[x] = \sum_{i=1}^{k} x_{i}P(X = x)$

Continuous analogue of a sum is an integral, which converts the discrete version into:

$\int_{a}^{b} xf(x) dx$ where $f(x)$ is the probability density function (PDF).

The integral of the PDF over the interval $[a,b]$ should be equal to 1.

In our case, the interval is $[\pi,2\pi]$, so the integral, $\int_{\pi}^{2\pi} f(x) = 1$. The PDF of a uniform distribution over an interval $[a,b]$ is $f(x) = \dfrac{1}{b-a}$. You can see that no other constant function satisfies the condition. (The function should be constant because that the distribution is uniform.)

In our case, $f(x) = \dfrac{1}{\pi}$.

You can see that it satisifies $\int_{\pi}^{2\pi} f(x) = 1$.

So the expectation is $E[x] = \int_{\pi}^{2\pi} \dfrac{x}{\pi} dx = \dfrac{3\pi}{2}$.

Knowing this, figuring out $E[sin x]$ is easy.

$E[sin x] = \int_{\pi}^{2\pi} sinxf(x) dx = \int_{\pi}^{2\pi} \dfrac{sin{x}}{\pi} dx$

0
On

$f(x)$ is the frequency distribution associated with the random variable $X.$

By definition:

$\int_{-\infty}^{\infty} f(x)\ dx = 1$

In this case we have a uniform distribution. $f(x)$ is constant (lets call it $c$) when $x\in[\pi, 2\pi]$ and $0$ outside this interval.

$\int_{-\infty}^{\infty} f(x)\ dx = \int_{\pi}^{2\pi} c\ dx = \pi c = 1$

$c = \frac {1}{\pi}$ when $x$ is in the interval

$E[X]$ we will define to be $E[X] = \int_{-\infty}^{\infty} f(x)x\ dx$

$E[X] = \int_{\pi}^{2\pi} \frac {x}{\pi} \ dx = \frac 12\frac {(2\pi)^2 - \pi^2}{\pi} = \frac 32\pi$

As noted in the comments, if $X$ is uniformly distributed $E[X]$ will always be the average of the endpoints.

If we have a function inside that expectations bracket, we use the same $f(x)$ for the distrbution, and apply the function to the $x$ in the previous integral.

$E[\sin (X)] = \int_{-\infty}^{\infty} f(x) \sin x \ dx= \int_{\pi}^{2\pi} \frac {\sin x}{\pi} \ dx = \frac {-\cos 2\pi + \cos \pi}{\pi} = -\frac 2\pi$