HarvardX Interactive Learning Challenge – Binomial Distribution

HarvardX Interactive Learning Challenge – Binomial Distribution

HarvardX Interactive Learning Challenge – Binomial Distribution

Comments Off on HarvardX Interactive Learning Challenge – Binomial Distribution

Here is an interactive visualization of the binomial distribution for students who are learning the topic of probability, as per the HarvardX Interactive Learning Challenge: http://harvardx.harvard.edu/news/harvardx-interactive-learning-challenge-now-open

If you’re curious, here is the binomial distribution formula in Processing:

from:  http://sphweb.bumc.bu.edu/otlt/mph-modules/bs/bs704_probability/BS704_Probability7.html

 

float calculateBinomialValue(int x) {
   return ( factorial(nSlider.value) / (factorial(x)*factorial(nSlider.value-x)) ) * pow(pSlider.value, x) * (pow(1-pSlider.value, nSlider.value-x)); 
}
int factorial(int i) {
   int sum = 1;
   for (int k=1; k<=i; k++) {
       sum = sum * k; 
   }
   return sum;
}

 

Back to Top