bpet, thank you so much. That's it. Your formula in post #16 solves the issue of 'loss of significance' (what you called catastrophic cancellation). I've tried it with 40 probabilities, all of them random, and there was no issue of that sort. Then I reversed the order of the probabilities...
DECIMAL seems to have a lower limit than DOUBLE. It couldn't even finish doing the k=0 calculation:
[PLAIN]http://img811.imageshack.us/img811/1838/calculatingkwithdecimal.gif
bpet, thanks for that advice, I'll look into it. In the image you posted, what's in $B$3 and $B$4?
This post is related to my original issue, but it's about something else. It's about the math limitations of Visual Basic. In the following image, you can see the results I generated for the recursive probabilities formula posted by winterfors (post #5). At k=0, the probability is just 2.079 x...
winterfors' recursive formula, in post #5, is the final word on the matter. Thanks. I've now tested this formula for its intended purpose, with the value of p being different in the N events, and it matches the real results generated with random numbers perfectly. There's only a slight technical...
So far, I've tested winterfors' iteration formula using a simple model with 10 events and P always equal to 0.5. The iteration formula works perfectly, the results are almost identical to real results generated from thousands of randomized runs.
The correction winterfor made to CRGreathouse's...
Thanks so much, winterfors. And of course, CMGreathouse. And yeah, you're right, I'm not going to write out a monster formula for P25, P26, etc. I was trying to understand the mechanics of the formula, that's why I wanted to see what it looked like for P3. But now that you've confirmed there was...
I'm using your formulas on a scaled down version with only 10 events (n=10). The formula for P2 would match the actual real results if the final part were equal to 1, instead of P²:
P_2=\frac12P_1\sum_{n=1}^{100}\frac{p_n}{1-p_n}-\frac12P_0\sum_{n=1}^{100}1
Could there be an error in that...
I did a poor job of explaining myself. Suppose 100 events/trials, each with a different (and known) frequency of success (p). I want to calculate the probabilities of the 100 trials resulting in 0 total successful trials, 1 total successful trial, 2, 3, ... 99, and 100 total successful trials.
Here's the actual problem I'm faced with. Suppose a segment of dna with 100 mutations (SNPs) which occur at different frequencies from each other and between 2 different populations for the same mutation. The expected number of mutations occurring in the segment of dna is different in either...