# Probability - Tossing a coin, counting X heads, then tossing X more times.

1. Mar 24, 2009

### cse63146

1. The problem statement, all variables and given/known data

Suppose that tosses of a biased coin in which it comes up heads with probability 1/4 are independant. The coin is tossed 40 times and the number of heads X is counted. The coin is tossed X more times.

A) Determine the expected total number of heads generated by this process.
B) Determine the variance of the total number of heads by this process

2. Relevant equations

3. The attempt at a solution

I know that $$E[X] = \Sigma X_i P(X_i)$$

and I tried to set it up using the binomial distribution (40CX = 40 "choose" X)

$$(40CX)(1/4)^X (3/4)^{40 - X} + (XCn)(1/4)^n (3/4)^{X - n)$$

I really got no clue on what to do. Any help would be greately appreciated.

2. Mar 25, 2009

### tiny-tim

Hi cse63146!

to get expectation values, multiply the first one by X and add, and multiply the second one by … ?

3. Mar 25, 2009

### cse63146

So

$$E[X] = \Sigma X_i P(X_i) = \Sigma X P(X \ heads \ in \ first \ 40) + \Sigma n P(n \ heads \ after \ that \ | \ X \ heads \ in \ first \ 40)$$

$$= \Sigma X(40CX)(1/4)^X (3/4)^{40 - X} + \Sigma n (XCn)(1/4)^n (3/4)^{X - n}$$

4. Mar 25, 2009

### tiny-tim

almost

but you need nP(n heads after that), not nP(n heads after that | X heads in first 40)

5. Mar 25, 2009

### cse63146

since each toss is independent, P(head) = 1/4, and since this is a binomial distribution, E[X] = np

and just to make things a bit more organized (at least for me) $$E[X] = E[X_1] + E[X_2]$$ where $$E[X_1]$$ = nP(X heads in first 40 tosses) and $$E[X_2]$$ = nP(n heads after that)

$$E[X] = E[X_1] + E[X_2]$$
$$E[X] = 40(1/4) + E[X_1](1/4)$$
$$E[X] = 10 + 10(1/4) = 12.5$$

6. Mar 26, 2009

### tiny-tim

sorry … no idea what you're doing

go back and adjust your last post … that was almost correct

7. Mar 26, 2009

### cse63146

The way I thought of it was like this:

Expecation of a binomial distribution is np. Since we flip a coing 40 times with 1/4 probability of getting heads, the expected number of heads would be 10. So for the second part, we would flip the coin another 10 times (because we expect to get 10 heads in the first 40 tosses) and the probability of heads would still be 1/4 so 10(1/4) = 2.5, and we add them together to get 12.5 heads.