# sum of bernoulli distributed random variables

I have two random variables $X_1$ and $X_2$ with $P(X_1=x_1)=(1-p)^{1-x_1}p^{x_1}$ and for $X_2$ the same and $x_1 \in \{0,1\}$. I want to know how $Y=X_1+X_2$ is distributed. This is what i did: $P(Y=y)=P(X_1+X_2=y)=\sum_{x=0}^1 P(X_1=x, X_2=y-x)=\sum_{x=0}^1 P(X_1=x)P( X_2=y-x)=$ $\sum_{x=0}^1 (1-p)^{1-x}p^x(1-p)^{1-(y-x)}p^{y-x}=\sum_{x=0}^1 (1-p)^{2-y}p^y=2p^y(1-p)^{2-y}$

I think this is wrong because I think the answer should be ${2\choose y} p^y(1-p)^{2-y}$ So what did I do wrong? $X_1$ and $X_2$ are independent.

-
There's not enough information to find the distribution of $Y$; you need to know the joint distribution of $X_1$ and $X_2$. Perhaps you intended them to be independent? Also, what's $k$ doing there? It never occurs again after you introduce it. – joriki Feb 1 '13 at 10:42
@joriki I meant $x_1$ and yes, they are independent. – Badshah Feb 1 '13 at 10:46
Please add that missing information to the question itself; people shouldn't have to read the comments in order to make sense of the question. – joriki Feb 1 '13 at 10:48

This looks far too complicated.

You have two random variables, each of which takes - the value $1$ with probability $p$ and - the value $0$ with probability $1-p$.

If they are independent then their sum takes

• the value $2$ with probability $p^2$
• the value $1$ with probability $2p(1-p)$
• the value $0$ with probability $(1-p)^2$

The sum is a binomial random variable.

A particular problem with your expressions is that you have not restricted the values $X_2$ can take. For example when $y=0$ the expression $\sum_{x=0}^1 P(X_1 =x)P(X_2 =y−x)$ means $P(X_1 =0)P(X_2 =0−0) + P(X_1 =1)P(X_2 =0-1)$ but you should not have the second term in that sum since $P(X_2 =-1) =0$ rather than the positive value you give it

-
so which restriction should I give to $X_2$? – Badshah Feb 1 '13 at 10:58
@Badshah: It has to be $0$ or $1$ so you need $$\sum_{x=\max(0,y-1)}^{\min(1,y)} P(X_1 =x)P(X_2 =y−x)$$ – Henry Feb 1 '13 at 11:08

What you wrote is not correct (first step) because according to that $P(Y=0) = \sum_{x=0}^1 P(X_1=x,X_2=-x)$ and $X_2$ can't be negative. Moreover, if $X_1=x$ and $X_2=y-x$ they can't be independent.

Sorry guys but I don't see where I can put this as a comment :S :S

-
why cant they be independent? – Badshah Feb 1 '13 at 11:03
Because as you write them, one depends on the result of the other. – dann Feb 1 '13 at 11:08
I would use either a reasoning based on "observing", draw a Venn's diagram and you'll see easily what is the distribution of $Y$. Or mathematically, the sum of two indep. r.v. is the convolution. – dann Feb 1 '13 at 11:12
Mmm sorry you're right, I see it now. They are independent since $X_1$ and $X_2$ are ssumed to be ind. – dann Feb 1 '13 at 11:14