# Question about convolution of iid random variables with an emphasis on the iid concept

Let's say I want to find the $n$-fold convolution of $n$ iid binomial random variables. My question is regarding the probability of success $p$. Would $p$ be the same for each random variable in the sample or is the correct way to allow $p$ to vary, that is, probability of success for each $X_i$ is $p_i$ for all $i = 1,\dotsc,n$. If it's the latter, then I don't understand the concept of iid. If these random variables are iid, then the expected value (at least) will be the same for each $X_i$; but if $p_i$'s are not necessarily equal, how can it be claimed that the expected values are equal?

• If they're identically distributed, they have the same distribution, just like it sounds, so yes, the $p_i$ are all the same. – saulspatz Feb 10 '18 at 2:53
• The second two letters of iid stand for 'identically distributed so $p$ must be the same for all and $E(X_i)$ are all the same. – BruceET Feb 10 '18 at 7:52

Let's do it for $n=2.$ If, independently, $X_1, X_2 \sim \mathsf{Binom}(5, 1/3),$ then $Y = X_1 + X_2 \sim \mathsf{Binom}(10, 1/3).$ Intuitively, you can think of $X_1$ as the sum of the first five Bernoulli trials and $X_2$ as the sum of the second five. Perhaps the easiest formal proof is via moment generating functions. (The discussion extends to general $n$ without difficulty.)

The figure below was made by generating 100,000 realizations of $X_1, X_2,$ and $Y = X_1 + X_2,$ then making a histogram of the 100,000 sums $Y.$ Centers of open circles show the exact distribution of $\mathsf{Binom}(10, 1/3).$

R code for the sampling and the figure is shown below.

x1 = rbinom(10^5, 5, 1/3)
x2 = rbinom(10^5, 5, 1/3)
y = x1 + x2
hist(y, prob=T,br=(-1:10)+.5, col="skyblue2", main="Y ~ BINOM(10,1/3)")
yy = 0:10; pdf=dbinom(yy, 10, 1/3)
points(yy,pdf,col="red")
`
• Quick question before I accept the answer: When discussing convolutions, which is what $Y$ is, it’s implied that the random variables in our sample are iid, right? If so, then I’m confused by author of “Statistical Computing with R” when she writes “To simulate a convolution: Generate $x_1 ~ N(0,1)$ and $x_2 \sim N(3,1)$. Deliver $s=x_1+x_2$.” Clearly, $x_1$ and $x_2$ are not iid, so I don’t see how $s$ satisfies the definition of convolution. However, I do see $s$ as a more generalized form of a convolution where the distributions are permitted to be different. – Alana Feb 10 '18 at 16:11
• Convolution is a general term. The most common case is for sums of iid RVs, but iid is not part of the definition. – BruceET Feb 10 '18 at 17:10
• So at the very least the definition of convolution assumes independence amongst the rv’s? – Alana Feb 10 '18 at 17:25
• I have only seen convolution used for independent random variables. Unfortunately, it is a term that gets used in more contexts than it gets rigorously defined. Without casting aspersions on the specific text you are using, I would not be surprised if the term has essentially 'colloquial' status in a book more concerned with computation than probability theory. And some 'data mining' books feel free to use terminology that is never defined. – BruceET Feb 10 '18 at 17:31
• I see what you’re saying. It’s just frustrating reading the definition of a convolution in terms of iid rvs, and then providing an example of a convolution where the rvs are not identically distributed. Thank you for answering my questions. – Alana Feb 10 '18 at 17:34

There's no such thing as the convolution of two random variables. Two distributions (ie probability measures on $\Bbb R$) have a convolution, but a distribution is not a random variable.

The notion of the convolution of two probability distributions has a lot to do with independence, nothing necessarily to do with "identically distributed": If $X$ and $Y$ are independent random variables then the distribution of $X+Y$ is the convolution of the distribution of $X$ with the distribution of $Y$. That holds regardless of whether $X$ and $Y$ are identically distributed (and it doesn't say anything about the non-existent "convolution" of $X$ and $Y$.)