emadsadeghi / STAT679Notes

Course Notes
0 stars 0 forks source link

Mark binomial exercise of Emad-Sadeghi #4

Open emadsadeghi opened 6 years ago

emadsadeghi commented 6 years ago

Hi @cecileane @coraallencoleman! https://github.com/emadsadeghi/STAT679Notes/commit/bcf6f883b0d9f2f2c5dc524242de0d7f78ff199e

In the directory /STAT679Notes, please run the python file "binomial.py" with additional arguments to calculate C(n,k) (n choose k) for some non-negative value of n and k.

./binomial.py [-h] [-n N] [-k K] [-l] [--test]

with the following optional arguments:
-h, --help show this help message and exit -n N total number of items to choose from -k K number of items to choose -l, --log returns the log binomial coefficient --test tests the module and quits

For example, to compute C(150,40) you can do the following:

./binomial.py -n 150 -k 40

For testing the script: please run ./binomial.py --test in the same directory.

Thanks, Emad

cecileane commented 6 years ago

fantastic. I like that the docstring for the module is extensive with examples. It makes it very clear to the user what this script is supposed to be doing :+1: