Let $X$ be the sum of two independent exponential random variables: $X_{1}$ with parameter $\lambda_{1} = \frac{1}{5}$ and $X_{2}$ with parameter $\lambda_{2} = 2 $. These random variables have values in the interval $[0,60]$
I want to prove the variance of $X$ is $401$. I found by looking into some references that the p.d.f of $X$ is: $$ f_{X}(t) = \sum_{i=1}^{2} {\frac{\lambda_{1} \lambda_{2} }{\prod_{j=1,j \ne i}^{2}(\lambda_{j} -\lambda_{i})} exp(-\lambda_{i} t)} $$
I wanted to know if the above density is correct or not since I did find a value different than what I'm supposed to get for the variance computation.
Thanks.
I'm adding this as a separate answer as it is somewhat unrelated to my original post, and is quite lengthy in itself.
My previous post addresses the question originally asked, though it became clear in the comments that the question of interest is actually the following (taken from the comments):
The independent visitors of a certain Web site may be divided into two groups: those who arrived on this site voluntarily (type 1) and those who arrived there by chance or by error (type 2). Let N(t) be the total number of visitors in the interval [0,t]. We suppose that {N{t),t > 0} is a Poisson process with rate a=10 per hour, and that 80 of the visitors are of type 1 (and 20 of type 2).The question was: "Calculate the variance of the total time spent on this site by the visitors arrived in the interval [0,1] if the time (in minutes) X1 (respectively, X2) that a type 1 (resp., type 2) visitor spends on the site in question is an exponential random variable with parameter 15 (resp., 2). Moreover, we assume that both varibales are independent random variables.
I will highlight two approaches to the problem: one working with knowledge of independent variables only and Wald's equation, and the second using properties of the Poisson and Exponential distributions. Before we get to these we make the following note:
If the arrivals of a rate $\lambda$ Poisson process can be split into two types (types 1 and 2) with the proportion of type 1 arrivals being $p_1$, and type 2 occurring with $p_2 = 1 -p_1$, then the process can be `thinned' into two sub-processes with rates $\lambda_1 = \lambda p_1$, and $\lambda_2 = \lambda p_2$ respectively. These two processes are independent of each other by properties of Poisson processes. In your question, you have $\lambda = 10$ (which I interpret as an average of 10 visitors to the site per hour), and $\lambda_1 = 0.8 \times 10 = 8$, and $\lambda_2 = 0.2 \times 10 = 2$.
The question asks you to compute the variance of the total time spent by all visitors in 1 hour, where the arrivals are modeled by a Poisson process. Let $T_i$ denote the time spent by the $i$-th arrival, and $N$ the total number of arrivals in an hour, so we consider \begin{align*} T = \sum_{i=1}^N T_i. \end{align*} There are currently two problems to face: the first is that the $T_i$ are all exponential (as stated in the question), but with different parameters. The second is the fact that $N$ is itself a random variable. The solution to the first of these problems is to use our thinning relation described above: viewing the process with rate $\lambda$ as the union of the $\lambda_1$ and $\lambda_2$ processes then: $N = N_1 + N_2$, and then \begin{align*} T = \sum_{i=1}^{N_1} T_i^{(1)} + \sum_{i=1}^{N_2} T_i^{(2)}, \end{align*} where as given in the question $T_i^{(1)}$ are exponential of parameter $\tau_1$, and $T_i^{(2)}$ are exponential of parameter $\tau_2$ (as given: $\tau_1 = 2$, $\tau_2 = 1/5$). According to the formula for the variance which was given in my previous post \begin{align*} \text{Var}[T] = \text{Var}\Big[ \sum_{i=1}^{N_1} T_i^{(1)} \Big]+ \text{Var}\Big[ \sum_{i=1}^{N_2} T_i^{(2)} \Big]. \end{align*} So our problem is now about taking variances of a sum of randomly many random variables.
In the following I drop the sub-script $N_1,N_2$ since the above formula tells you how to apply this for your problem. So $N$ is now a Poisson variable of rate $\lambda$, and each $T_i$ is exponential with rate $\tau$.
The first approach is to find the variance of such a sum is to use a result called Wald's Equation, which says that under the assumption of independence of $N$ from the $T_i$, and if the $T_i$ are i.i.d. then \begin{align*} \mathbf E [ \sum_{i=1}^N T_i] = \mathbf E[N] \mathbf E[T_1] \end{align*} One can quickly extend this to a theorem about the variance instead: \begin{align*} \text{Var} [ \sum_{i=1}^N T_i] = \text{Var}[N]\mathbf E[T_1]^2 + \mathbf E[N] \text{Var}[T_1]\end{align*} You can now apply this to the case we have with $N$ a Poisson variable, independent of the $T_i$ which are i.i.d. exponential variables.
Of course, this method relies on you knowing Wald's equation, and you would probably want to be able to derive this too. So, how can we solve the problem without using that? The alternative is to use conditional expectations, and the fact that we know the distributions of the relevant variables. I'll do the calculation for the expectation of $\sum_{i=1}^N T_i$, and leave you to calculate the second moment (which will be needed to find the variance).
So if $N \sim \text{Poisson}(\lambda)$, and $T_i \sim \text{Exp}(\tau)$, then conditioning on the value $N$ takes \begin{align*} \mathbf E \Big[ \sum_{i=1}^N T_i ] & = \sum_{n=0}^N \mathbf E \Big[ \sum_{i=1}^N T_i | N = n ] \mathbf P[ N = n] \\ & = \sum_{n=0}^\infty \mathbf E \Big[ \sum_{i=1}^n T_i ] \mathbf P[ N = n] \\ & = \sum_{n = 0}^\infty n \mathbf E[\tau] \mathbf P[ N = n] \\ & = \mathbf E[\tau] e^{-\lambda} \sum_{n = 0}^\infty n \lambda^n \frac{1}{n!} \\ & = \frac{\lambda}{\tau}. \end{align*} Note that this agrees with the answer we would get from Wald's equation.
That should now be enough to let you answer the question.