# Sum of Bernoulli random variables

• Feb 4th 2009, 03:15 AM
cryptic26
Sum of Bernoulli random variables
Question: Let Xi , i = 1, 2, 3... denote random variables which are independent and Bernoulli distributed with P(Xi=1) = pi and P(Xi=0) = (1-pi). It is obvious that 0<= pi<=1. Choose pi to maxmize the mean of

Sn = summation (Xi) , i = 1,2...n.

Approach: Here is my approach.
S2 has probability distribution given as
P(S2=0) = (1-p1)*(1-p2)
P(S2=1) = (1-p1)*p2 + p1*(1-p2)
P(S2=2) = p1*p2.

Hence, the mean of S2 shall be = 0 *P(S2=0)+ 1*P(S2=1) + 2*P(S2=2)
= 1*(1-p1)*p2+p1*(1-p2)+ 2p1p2 .

(which is maximum if p1 = p2 =1).
The same can be generalized for any Sn. I am skipping the steps but the answer is the same. The maximum possible value of mean of Sn = n. and is achieved at pi =1 , i=1,2, 3....

Is there a better proof or is my proof correct?

I also tried partial differnential w.r.t each of the pi and then have n equations, but even for n=2, I get absurd values of pi's (essentially less than zero). Any help shall be appreciated.
• Feb 4th 2009, 03:32 AM
mr fantastic
Quote:

Originally Posted by cryptic26
Question: Let Xi , i = 1, 2, 3... denote random variables which are independent and Bernoulli distributed with P(Xi=1) = pi and P(Xi=0) = (1-pi). It is obvious that 0<= pi<=1. Choose pi to maxmize the mean of

Sn = summation (Xi) , i = 1,2...n.

Approach: Here is my approach.
S2 has probability distribution given as
P(S2=0) = (1-p1)*(1-p2)
P(S2=1) = (1-p1)*p2 + p1*(1-p2)
P(S2=2) = p1*p2.

Hence, the mean of S2 shall be = 0 *P(S2=0)+ 1*P(S2=1) + 2*P(S2=2)
= 1*(1-p1)*p2+p1*(1-p2)+ 2p1p2 .

(which is maximum if p1 = p2 =1).
The same can be generalized for any Sn. I am skipping the steps but the answer is the same. The maximum possible value of mean of Sn = n. and is achieved at pi =1 , i=1,2, 3....

Is there a better proof or is my proof correct?

I also tried partial differnential w.r.t each of the pi and then have n equations, but even for n=2, I get absurd values of pi's (essentially less than zero). Any help shall be appreciated.

You could always just say that $S_n$ ~ Binomial(n, p) whose mean is well known to be np ....
• Feb 4th 2009, 04:08 AM
cryptic26
Quote:

Originally Posted by mr fantastic
You could always just say that $S_n$ ~ Binomial(n, p) whose mean is well known to be np ....

Thanks. In this case, however the Sn is sum of r.v s that have different "p" for each variable.
• Feb 4th 2009, 10:32 AM
mr fantastic
Quote:

Originally Posted by cryptic26
Thanks. In this case, however the Sn is sum of r.v s that have different "p" for each variable.

OK, I thought pi meant $\pi$ (which is also a common notation in geometric and binomial problems). I will review the question more closely when I have time.
• Feb 4th 2009, 01:42 PM
cryptic26
Quote:

Originally Posted by mr fantastic
OK, I thought pi meant $\pi$ (which is also a common notation in geometric and binomial problems). I will review the question more closely when I have time.

Ah, well in that case pi can't be probability as it is 3.14 roughly and probability has to less than 1. But, anyways, I think sum of two Bernoulli r.vs with different probabilities is not a Bernoulli r.v, which would mean I will have to stick with my trial approach unless you know if there is a better way. Thanks.
• Feb 4th 2009, 09:47 PM
Isomorphism
Quote:

Originally Posted by cryptic26
Question: Let Xi , i = 1, 2, 3... denote random variables which are independent and Bernoulli distributed with P(Xi=1) = pi and P(Xi=0) = (1-pi). It is obvious that 0<= pi<=1. Choose pi to maxmize the mean of

Sn = summation (Xi) , i = 1,2...n.

Is there a better proof or is my proof correct?

I also tried partial differnential w.r.t each of the pi and then have n equations, but even for n=2, I get absurd values of pi's (essentially less than zero). Any help shall be appreciated.

Here's an idea:
Since each $X_i$ can take value of 0 or 1, $\sum_{i=1}^{i=n} X_i \leq n$ $\implies \sum_{i=1}^{i=n} \mathbb{E}(X_i) \leq n$ for any assignment $\pi$. Now you have found the equality achieving assignment. Just make sure the assignment indeed makes $X_i$'s independent and you are done :D
• Feb 5th 2009, 02:29 AM
mr fantastic
Quote:

Originally Posted by cryptic26
Ah, well in that case pi can't be probability as it is 3.14 roughly and probability has to less than 1.
[snip]

I am actually aware of that fact. I said the notation ie. the symbol, not the value.
• Feb 5th 2009, 06:45 AM
cryptic26
Quote:

Originally Posted by mr fantastic
I am actually aware of that fact. I said the notation ie. the symbol, not the value.

I know what you meant and it would be an honest mistake. I only mentioned that in the context of my problem, pi can't be that greek notation. I was not trying to be condescending.
• Mar 8th 2009, 08:44 PM
mr fantastic
Quote:

Originally Posted by cryptic26
Question: Let Xi , i = 1, 2, 3... denote random variables which are independent and Bernoulli distributed with P(Xi=1) = pi and P(Xi=0) = (1-pi). It is obvious that 0<= pi<=1. Choose pi to maxmize the mean of

Sn = summation (Xi) , i = 1,2...n.

Approach: Here is my approach.
S2 has probability distribution given as
P(S2=0) = (1-p1)*(1-p2)
P(S2=1) = (1-p1)*p2 + p1*(1-p2)
P(S2=2) = p1*p2.

Hence, the mean of S2 shall be = 0 *P(S2=0)+ 1*P(S2=1) + 2*P(S2=2)
= 1*(1-p1)*p2+p1*(1-p2)+ 2p1p2 .

(which is maximum if p1 = p2 =1).
The same can be generalized for any Sn. I am skipping the steps but the answer is the same. The maximum possible value of mean of Sn = n. and is achieved at pi =1 , i=1,2, 3....

Is there a better proof or is my proof correct?

I also tried partial differnential w.r.t each of the pi and then have n equations, but even for n=2, I get absurd values of pi's (essentially less than zero). Any help shall be appreciated.

Anyone wishing to contribute to this thread can pm me. In light of another thread being completely vandalised by edit-deletes, I'm closing this thread.