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)If you use the "pow" function, compile with "gcc -lm".
In order to achieve modularity and simplicity, I urge you to use several functions (program and test them one by one), probably in the following way:
main
|
binomialsum
|
binomial
/ | \
chose pow pow
/ | \
factorial fa. factorial
Remember:
It is due Mo 3/8, late homeworks will be penalized !
You will be graded on: