# E[X] and Var[X] of a Binomial with twist

Discussion in 'Probability' started by Rueful Rabbit, Oct 23, 2011.

1. ### Rueful RabbitGuest

Hi All,

x~Binomial
p is 0.2
N is 12
E[X] = np = 2.4
Var[X] = np(1-p) = 1.92

Now suppose you add a charge of 75 for the first occurrence and 50 for
subsequent occurrences
what is a the E[X] and Var[X] of the cost?

Rueful Rabbit, Oct 23, 2011

2. ### Ray KoopmanGuest

Restate the "twist" as a charge of 50 for each occurrence,
plus a "processing fee" of 25 if there are any occurrences.
Then the expected cost is 50 np + 25 (1-(1-p)^n).

The variance is a little sneakier. Use the alternate expression
for variance: mean square minus squared mean. The expected square
of the cost is 50^2 np + (75^2 - 50^2)(1-(1-p)^n). The variance is
50^2 np + (75^2 - 50^2)(1-(1-p)^n) - (50 np + 25 (1-(1-p)^n))^2.

Ray Koopman, Oct 23, 2011

3. ### Rueful RabbitGuest

Thanks again Ray, much appreciated.
James

Rueful Rabbit, Oct 23, 2011
4. ### Ray KoopmanGuest

Here's a simpler problem, that leads to a solution to the original
problem:

Suppose X is Binomial[n,p], except that its support is {z,1,2,...,n},
where the arbitrary real value z occurs instead of 0, with the same
probability as 0 would have. What are the mean and variance of X?

Ray Koopman, Oct 24, 2011
5. ### Ray KoopmanGuest

Nice plan, but bad execution. The expected square of the cost is
not as given above, but is much messier. So let me expand on the
"simpler problem" that I mentioned in my second post yesterday.

The costs are 0, 25+50, 25+100, 25+150, ... . The sequence is
equally spaced, except the first space is 50% bigger than the others.
That's a linear transformation of z, 1, 2, 3, ... , with z = -1/2.
Then cost = 50(X + 1/2), which makes E[cost] = 50(E[X] + 1/2)
and Var[cost] = 50^2 Var[X]; the mean and variance of X come from:
E[X] = np + z(1-p)^n,
E[X^2] = np(1-p) + (np)^2 + z^2 (1-p)^n,
Var[X] = E[X^2] - (E[X])^2.

Ray Koopman, Oct 24, 2011
6. ### Rueful RabbitGuest

Thanks for the follow-up Ray

James.

Rueful Rabbit, Oct 26, 2011