rabindranath72 said:
P(X=x|r,p)=OVER(x+r-1, r-1)*p^r*(1-p)^x
You mean,
P(X=x|r,p)=OVER(x+r-1, x)*p^r*(1-p)^x ?
r= successes =4, p = probably of success = .55, x= number of failures = 2?
That's what I see on wikipedia. Never used this thing, myself.
Take a look at the cumulative distribution function for your guy. According to wiki,
http://en.wikipedia.org/wiki/Negative_binomial_distribution#Properties
Oh here we go. I think I've found what you're using. You did it wrong, tho.
The negative binomial random variable, denoted by X ~ nb(r, p) is a generalization of the geometric random variable. Suppose you have probability p of of succeeding on any one try. If you make independent attempts over and over, then X counts the number of attempts needed to obtain the rth success, for some designated r >=1. When r = 1, then X ~ geo(p).
We often let q = 1 - p be the probability of failure on any one attempt. Then the probability of having the rth success on the kth attempt, for k >= r, is given by
P(X = k) = C(k - 1, r - 1) * q^(k - r) * p^r .
See, you found the probability of getting the 4th success on the 6th attempt. This isn't even possible in the experiment at hand. Here k= x+r
What you want to calculate, using your method, is
P(X = 4) = C(4 - 1, 4 - 1) * (.45)^(4 - 4) * (.55)^4 = 0.09150625
plus
P(X = 5) = C(5 - 1, 4 - 1) * (.45)^(5 - 4) * (.55)^4 = 0.16471125
That is, the sum of the chance of getting the 4th success on 4th trial, and 4th success on 5th trial.
add those together and you get
0.2562175
Easily accounts for the OPs slight round off errors.
Source:
http://www.wku.edu/~david.neal/statistics/discrete/negbinom.html