I interpreted this as a question about the expectation of a discrete random variable. And I used octave to solve this weeks riddler express.
Suppose a new pill bottle has whole tablets. Each day you pull a tablet, if it's whole, divide it and return the unused half. What's the average number of days until you pull a half tablet?
The outcomes are going to be 1 whole 1 half, 2 wholes 1 half, 3 wholes 1 half. And so on and on until all whole tablets are pulled.
So call each outcome wi h: meaning pull i whole tablets then a half tablet.
For a new bottle w0 and h0 are 100 and 0 respectively.
Assume some present state of the bottle w,h. When a whole tablet is pulled, half is consumed and half is returned, so the state becomes w-1, h+1. Which means the bottle always has 100 tablets.
So odds of pulling 1 whole tablet are 100/100, for 2 whole tablets we have 99/100, and so on, note we must take the product of pulling 1 and 2 because the odds of pulling 2 are conditioned on pulling 1 first. This is the falling factorial.
Then we ask, what are the odds of pulling a half tablet after pulling i whole tablets, this is h0 + i, because pulling i whole tablets means i divided half were placed into the bottle.
We then just solve for the expected value of n.
I got 13.2099606302160.
Suppose a new pill bottle has whole tablets. Each day you pull a tablet, if it's whole, divide it and return the unused half. What's the average number of days until you pull a half tablet?
The outcomes are going to be 1 whole 1 half, 2 wholes 1 half, 3 wholes 1 half. And so on and on until all whole tablets are pulled.
So call each outcome wi h: meaning pull i whole tablets then a half tablet.
For a new bottle w0 and h0 are 100 and 0 respectively.
Assume some present state of the bottle w,h. When a whole tablet is pulled, half is consumed and half is returned, so the state becomes w-1, h+1. Which means the bottle always has 100 tablets.
So odds of pulling 1 whole tablet are 100/100, for 2 whole tablets we have 99/100, and so on, note we must take the product of pulling 1 and 2 because the odds of pulling 2 are conditioned on pulling 1 first. This is the falling factorial.
Then we ask, what are the odds of pulling a half tablet after pulling i whole tablets, this is h0 + i, because pulling i whole tablets means i divided half were placed into the bottle.
We then just solve for the expected value of n.
I got 13.2099606302160.
Comments
Post a Comment