Note that the "changeslow" algorithm had to be run for a smaller range of $A$ due to extremely long running times.
Greedy Fit Curve Equation:
Dynamic Programming Fit Curve Equation:
Slow Fit Curve Equation:
Note that the "changeslow" algorithm had to be run for a smaller range of $A$ due to extremely long running times.
Greedy Fit Curve Equation:
Dynamic Programming Fit Curve Equation:
Slow Fit Curve Equation:
Note that the "changeslow" algorithm had to be run for a smaller range of $A$ due to extremely long running times.
Greedy Fit Curve Equation:
Dynamic Programming Fit Curve Equation:
Slow Fit Curve Equation:
Greedy Fit Curve Equation:
Dynamic Programming Fit Curve Equation:
Slow Fit Curve Equation:
As we can see in the plots above the best fitting curves are linear for the greedy and dynamic programming cases and exponential for the slow case. The trends observed by the fit lines match what we would expect from our runtime analysis whereby the greedy has a theoretical runtime of $O(n + k)$, the dp has a theoretical runtime of $O(n * k)$ and the slow has a theoretical runtime of $O(3^{n})$. The greedy and dynamic programming runtimes are observed to be linear because $k$ (length of the coin denominations array) is held constant while $n$ (the change amount) is varying, therefore the experimental curves are still consistent the theoretical runtimes. In Question 5, the curve fit of the slow algorithm is slightly degraded by the fact that all even values of $A$ bypass the exponential behavior due to the change being made in a single coin. This is evident by the run time for even values of $A$ being approximately 0. If a curve fit was drawn through the odd values of $A$, it would match the behavior from Q3/Q4a/Q4b.