Calculate the distribution of the sum of mass arriving in random intervals over some period Say we have a pipe spitting out potatoes.
The potato masses are distributed with exponential distribution
$$ P(\textrm{potato mass}= x)=\lambda_1e^{-\lambda_1x}$$
Each potato arrives with intervals following the exponential distribution
$$ P(\textrm{arrival time}= x)=\lambda_2e^{-\lambda_2t}$$
Say we have buckets that collect the potatoes and ship every T seconds.
What is the expression for the distribution of shipped bucket masses for any T, $\lambda_1$ and $\lambda_2$?

I was trying to estimate the probability of number of potatoes using poisson and multiply by probability of each mass... I got confused. I think it's a convolution of the two distributions but that's probably wrong.
I'm really not sure how to correctly derive this. If the potatoes were uniform mass it'd be much simpler. Sorry if this has been asked before somewhere, I tried looking around.

Edit: Maybe part 2, how would this work if the distributions were arbitrary? I mean, what is the reasoning one could use to numerically compute the final distribution using discrete distributions?
It appears one could use the characteristic function of the input distributions as referenced on the wiki?

Since the inter-potato waiting times are exponential with parameter $\lambda_2$, the total number of potatoes arriving per unit time is Poisson with parameter $\frac{1}{\lambda_2}$. Therefore, the total number of potatoes arriving in time buckets of length $T$ is Poisson with parameter $\frac{T}{\lambda_2}$.
The total shipped mass is thus a compound Poisson distribution, specifically the sum of $N\sim\text{Pois}\left(\frac{T}{\lambda_2}\right)$ iid exponentially distributed variables $X\sim\text{Exp}(\lambda_1)$. Since the exponential distribution is a special case of the gamma distribution with $k=1$, the total $Y$ is a Poisson-gamma compound.
This is a Tweedie distribution.
In the case of arbitrary distributions, one would first figure out the distribution of the number of arrivals (the arrivals process, see our interarrival-time tag) given a distribution of the waiting times, then analyze the compound distribution resulting from this specific arrival process and the distribution of the potato weights. See our compound-distribution tag. A number of compounds have closed forms as here, others could be numerically evaluated or simulated. The italicized terms make for good search terms here or elsewhere, ideally enriched by any knowledge of the distributions involved.
