Note: I am now (December 9) finished adding sample problems to this review. Good luck on the exam!
Topics with Details:
C(n, k) = 1, if k = 0 or if n = k
C(n, k) = C(n-1, k) + C(n-1, k-1), otherwise.
C(1, 8): 1 Elapsed time: 0.0030 seconds
C(16, 8): 12870 Elapsed time: 0.019 seconds
C(24, 8): 735471 Elapsed time: 0.152 seconds
C(32, 8): 10518300 Elapsed time: 1.314 seconds
C(40, 8): 76904685 Elapsed time: 9.216 seconds
C(48, 8): 377348994 Elapsed time: 48.292 seconds
C(56, 8): 1420494075 Elapsed time: 198.57 seconds
C(64, 8): (overflow) Elapsed time: 662.561 seconds
Do you have an explanation for the data above?
A non-recursive implementation would do all the calculations
in a small fraction of a second.
Why is the recursive implementation not a reasonable one for
the function?
Projects:
Recitations: See the List of Recitations. (New recitations after the mid-term exam are those below (we didn't do 12, although Project 3 has an applet).