Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Let W(n=0) = N and H(n=0) = 0

If you know W(n), you can find: H(n) = 2*(N - W(n)) - n

So W(n) + H(n) = 2*N - W(n) - n

You can write a difference equation for the expected value of W(n+1) in terms of W(n)

W(n+1) = W(n) - (Prob of pulling a whole pill on trial n)

W(n+1) = W(n) - W(n)/( 2*N - W(n) - n)

You can integrate this eqaution from W(0)=N to solve the problem

==========================

Here is my latest Monte Carlo Model: http://www.geocities.com/d_glitch/Pills3.xls

For W(0) = 1000, it finds W(1999) = -0.01 and H(1999) = 1.01 <== Excelent precision

The probability of pulling a half pill after 1999 trials PH(1999) approaches 1 as it should.

The top chart is W(n) and H(n) observed and calculated

The second chart is PH(n) observed and calculated. <== This fit is much better than before.