binomial distribution

Dec 5, 2010 at 1:08pm
hello again,

i want to receive the binomial result for n times and probability p

how can i do that in cpp??
Dec 5, 2010 at 2:01pm
you mean Ckn * pk * (1-p)n-k ?
well, if you can write a function to calculate factorials (I wonder if using pscal's triangle could be faster) and can use pow from cmath (or write one yourself. you are only going to calculate integer powers), then it shouldn't be a problem..
Topic archived. No new replies allowed.