Suppose $X \sim Bin(n,p)$ and $Y \sim Bin(n,1-p)$, how is $X+Y$ distributed?

1.9k Views Asked by At

Suppose $X \sim Bin(n,p)$ and $Y \sim Bin(n,1-p)$, How is $X+Y$ distributed? I know that for independent variables one can do the same as:

Sum of two independent binomial variables

Furthermore i have seen this post:

Addition of two Binomial Distribution

However $X$ and $Y$ do not necessarily need to be independent of each other.

Backstory: I am trying to calculate the entropy of some $Z = X_1 + X_2 + \dots + X_n$ where each $X_i$ is either $Bin(n,p)$ or $Bin(n,1-p)$ depending on its parent node.

For example lets take a graph that has only outgoing edges of degree 2 beginning from some source $X_0 \sim (\frac{1}{2},\frac{1}{2})$. If we compare layer $2$ and layer $3$, we sent $2^3$ nodes to $2^4$ nodes. The probability for a set of child nodes to get certain states is $Bin(n,p)$ when the parent has state $1$ and $Bin(n,1-p)$ if the parent has state $-1$. We proceed this until we reached some threshold layer $d$.

What is the probability distribution of $Z = \sum X_i^{(d)}$

2

There are 2 best solutions below

5
On BEST ANSWER

Assume a tree with binary offspring. Assume the root is generation 0. Take last generation $X_{n,1},\ldots,X_{n,2^n}$ be the bernoulli variables for generation, let $N_n = \sum X_{n,i}$, let $\phi_p$ be the characteristic function for $Bin(2,p)$, and $\phi_q$ the moment generation function for $Bin(2,q)$. Then we have (as can be seen by conditioning on the last generation) $$ E(\exp(sN_n)) = E\phi_p(s)^{X_{n-1,1}}\phi_q(s)^{1-X_{n-1,1}}\cdots = E\left(\phi_q(s)^{2^{n-1}}\left ( \frac{\phi_p(s)}{\phi_q(s)} \right ) ^{\sum_i X_{n-1,i}}\right) $$ Now this can be rewriten as $$ CE\exp(s_{n-1}N_{n-1}) $$ with $$ C = \phi_q(s)^{2^{n-1}} $$ and $$ s_{n-1} = \ln \left (\frac{\phi_p(s)}{\phi_q(s)} \right ) $$ Now use induction. If one is after probabilities consider using https://en.wikipedia.org/wiki/Probability-generating_function and note $$ Ez^N = E(\exp(ln(z) N)) $$

0
On

Assume a tree with binary offspring. Assume the root is generation 0. Take the last generation $X_{n,1},…,X_{n,2^n}$ and let $N_n=\sum X_{n,i}$. Then we see that:

$E[Z^{\sum X_{n,i}}] = E[Z^{X_{n,1}} \dots Z^{X_{n,2^n}}]$

if we condition on the $n-1$-th generation we with the law of total expectation https://en.wikipedia.org/wiki/Law_of_total_expectation, where G(Z)_q is the probability generating function of Bin(2,q):

$E[Z^{X_{n,1}} \dots Z^{X_{n,2^n}}] = E[E[Z^{X_{n,1}} \dots Z^{X_{n,2^n}}|X_{n-1}]] = E[G(z)_{q_1}^{X_{n-1,1}}G(z)_{q_{-1}}^{1-X_{n-1,1}} \dots G(z)_{q_1}^{X_{n-1,2^{n-1}}}G_{q_{-1}}^{1-X_{n-1,2^{n-1}}}] = \left(G(z)_{q_{-1}}\right)^{2^{n-1}}E[\left(\frac{G(z)_{q_1}}{G(z)_{q_-1}}\right)^{\sum X_{n-1,i}}] = \left((1-q_{-1}) + q_{-1} z\right)^{2^{n-1}}E[\left(\frac{G(z)_{q_1}}{G(z)_{q_-1}}\right)^{\sum X_{n-1,i}}]$

I don't know for sure if one can use the law of total expectation there and how one should write out the second expectation term.