Calculating the mean of a sum of independent variables, with the same distribution, when the number of terms varies?

MathNugget

Junior Member
Joined
Feb 1, 2024
Messages
195
Suppose you have a set of max 2 independent variables, A1andA2A_1 \: and \: A_2~Exp(λi)Exp(\lambda_i), and the probability to go from A1A_1 to A2A_2 is b[0,1]b\in[0, 1].
Say A is the sum of A1andA2A_1 \: and \: A_2 (A2A_2 can be considered 0 in the situation we don't go from A1A_1 to A2A_2).
How would I calculate the mean of A? E(A)

It looks to me like it's a discrete function, so E(A) would be outcome\sum outcome x P(outcome) , for all possible outcomes.
So, it would be
E(A)=(1-b)A1A_1+b(A1A_1 + A2A_2).
How am I supposed to get an actual value out of it?
 
Does this mean that you pick A2A_2 with probability bb or A1A_1 with probability 1b1-b ?
I was trying to say A1A_1 happens certainly, but A2A_2 might happen (with probability b). I think it would be simpler to say it's a Bernoulli (coin flip) whether A2A_2 happens, while A1A_1 is a given to occur.
I guess I should have quoted the problem more clearly (for context):
A1A_1 is the time it takes event 1 to happen (it certainly happens).
A2A_2 is the time it takes event 2 to happen (if the coinflip of probability b gives it a go).

So the 2 possible outcomes are: just first event happens (and A = A1A_1) or both happen (and A is the sum of A1A_1 and A2A_2 )
 
If I understand the problem statement correctly...

E(A)=E(A1)+E(A2)=A1+12λE(A) = E(A_1) + E(A_2) = A_1+\dfrac{1}{2\lambda}

Details below:
E(A1)=A1 as this happens certainlyE(A_1) = A_1 \text{ as this happens certainly}

Let XX the r.v represents the outcome of the coin flip. Assume XX is uniformly distributed over [0,1][0,1], the pdf f(x)=1;0x1f(x) = 1; 0 \le x \le 1

By conditional expectation, E(A2)=E[E(A2X=x)]\text{By conditional expectation, } E(A_2) = E[E(A_2|X=x)] and E(A2X=x)=x1λE(A_2|X=x) = x\cdot \dfrac{1}{\lambda}


Thus,
E(A2)=01E(A2X=x)×f(x)dx=01x1λdx=12λE(A_2) = \int_0^1 E(A_2|X=x) \times f(x) \, dx =\int_0^1 x\cdot \dfrac{1}{\lambda}\, dx = \dfrac{1}{2\lambda}
 
I was trying to say A1A_1 happens certainly, but A2A_2 might happen (with probability b). I think it would be simpler to say it's a Bernoulli (coin flip) whether A2A_2 happens, while A1A_1 is a given to occur.
I guess I should have quoted the problem more clearly (for context):
A1A_1 is the time it takes event 1 to happen (it certainly happens).
A2A_2 is the time it takes event 2 to happen (if the coinflip of probability b gives it a go).

So the 2 possible outcomes are: just first event happens (and A = A1A_1) or both happen (and A is the sum of A1A_1 and A2A_2 )
So you pick A1A_1 with probability 1b1-b and A1+A2A_1+A_2 with probability bb.

Let's simplify slightly: two variables, not necessarily independent, B1B_1 and B2B_2 with CDFs F1,F2F_1, F_2 are picked with probabilities 1b1-b and bb, where the picking happens independently of B1B_1 and B2B_2. Let's call the resulting variable BB. To compute CDF of B we ask what is the probability that BaB \leq a ?

We can consider 4 events:
  • v1v_1 : B1B_1 is picked with probability 1b1-b,
  • v2v_2 : B2B_2 is picked with probability bb,
  • v3v_3 : B1aB_1 \leq a with probability F1(a)F_1(a)
  • v4v_4 : B2aB_2 \leq a with probability F2(a)F_2(a)
We are interested in probability of (v1v3)(v2v4)(v_1 \cap v_3) \cup (v_2 \cap v_4). But since v1v_1 and v2v_2 do not intersect we can claim that:
P((v1v3)(v2v4))=P(v1v3)+P(v2v4)P((v_1 \cap v_3) \cup (v_2 \cap v_4)) = P(v_1 \cap v_3) + P(v_2 \cap v_4)and since v1,v2v_1,v_2 are independent of v3,v4v_3,v_4 :
P((v1v3)=P(v1)P(v3)=(1b)F1(a)P((v_1 \cap v_3) = P(v_1)P(v_3) = (1-b) F_1(a)P(v2v4)=P(v2)P(v3)=bF2(a)P(v_2 \cap v_4) = P(v_2)P(v_3) = b F_2(a)which means that the CDF of BB is (1b)F1+bF2(1-b)F_1 + bF_2.

Is this helpful?
 
sort of. I think I understand it (and I also think the initial problem was much simpler than I initially understood, maybe).
Seems like E(A)= (1b)E(A1)+bE(A2)(1-b) E(A_1) + b E(A_2) .
And then, since AiA_i are Exp(λi)Exp(\lambda_i), I have take the mean from there, put it in, and seems that's it...
The exercise was asking me to compare the theoretical result to the empirical one, and I am confused as to how that's possible. The empirical result is a number, the theoretical one is some formula.
Or maybe noting the empirical one with σ\sigma, I have to compute P(E(A)<σE(A)<\sigma) and P(E(A)>σE(A)>\sigma), and show they're close to 0?
 
Last edited:
The exercise was asking me to compare the theoretical result to the empirical one, and I am confused as to how that's possible. The empirical result is a number, the theoretical one is some formula.
Pick some values of b,λ1,λ2b,\lambda_1, \lambda_2, get an empirical number (usually by using random number generator) for them, then plug them into your formula and compare the results. The larger your random samples used for empirical values the small is the difference between empirical and theoretical results.
 
Top