Binomial Distribution

Implementation

I made the following function for the pdf based on the equation given
above. Used the lisp code for the binomial coefficient.

(defun binomial-pdf (n k p)
   (* (choose n k)
      (expt p k)
      (expt (- 1 p) (- n k))))

References

Papolis, Athanasios, and S. Unnikrishna Pillai. 2014. Probability, Random Variables, and Stochastic Processes. 4th ed. McGraw Hill Education.