# Sequence of Random Variables

I am confused about how to approach sequence of random variables that are not identically distributed. For example, consider a sequence $X_1, X_2, \dots, X_n$ with the pdf:

$$f(X_n)= \begin{cases} (n-1)/2& \text{if }-1/n < x < 1/n\\ 1/n&\text{if }n < x < n+1 \\ 0 &\text{ otherwise} \end{cases}$$

How should i go about finding the mean of $X_n$?

• This is routine bookwork and should carry the self-study tag. Did you try drawing the pdf? In fact this one is so simple you can do it by inspection: there are two uniform components, one with mean 0 and one with mean $n+\frac{1}{2}$. Since the one with mean 0 contributes 0 for its proportion, and the second one has probability $1/n$, the mean is just the product of the mean for that component and its probability. – Glen_b Oct 18 '14 at 22:59
• The guidelines are in the self-study tag wiki here, and also briefly mentioned in the first page of the help, which links here. – Glen_b Oct 18 '14 at 23:07

$$E(X_n) = \int_{-\infty}^{\infty}f_X(x) x dx = \int_{-1/n}^{1/n}\frac{n-1}2 x dx+\int_{n}^{n+1}\frac{1}n x dx$$
$$=...= 1+\frac 1{2n}$$