See binomial.py in the python_homework/ for the script that includes the functions logfactorial and choose. The latter utilizes the former to calculate 'n choose k' for any positive integer n and non-negative integer k. The choose function has a third argument log -- this is boolean (True/False) and specifies if the result of choose should be returned as log(choose) or not. Default is False (i.e. not).
@cecileane @coraallencoleman
See
binomial.py
in thepython_homework/
for the script that includes the functionslogfactorial
andchoose
. The latter utilizes the former to calculate 'n choose k' for any positive integer n and non-negative integer k. Thechoose
function has a third argumentlog
-- this is boolean (True
/False
) and specifies if the result ofchoose
should be returned aslog(choose)
or not. Default isFalse
(i.e. not).