Homework 8

Write a program for Casino Night 2006. We have a bowl with "w" white and "b" black balls. What is the probability to get "bet" or less whites if "d" drawings are made?

The mathematical formula for w=6, b=4, d=7 and bet=1 would be

( 7 )       1       6     ( 7 )       0       7
( 1 ) * (.6)  * (.4)   +  ( 0 ) * (.6)  * (.4)
You can check your results by comparing them with what the executable ~jmache/cs1/Bino.class gets.

In order to achieve modularity and simplicity, I urge you to use several methods (program and test them one by one), probably in the following way:

		  main
                   |*
		binomial
               	 / | \
  	  choose  pow  pow
          / | \
 factorial fa. factorial