Math 1302 Math Assignment Unit 4
Math 1302 Math Assignment Unit 4
Math 1302
def factorial(n):
if n == 0: # Base case
return 1
else:
return n * factorial(n - 1) # Recursive call
# Example usage:
result = factorial(5)
print("Factorial of 5 is:", result)
where M(n) is the quantity of machines manufactured during the nth month.
1. Assume that a and r are constants that need to be found, and the explicit formula
has the form M(n) = ar^n.
2. Simplify the recurrence relation M(n) = M(n-1) + M(n-2) by substituting this form.
3. To determine the values of a and r, solve the resulting equation.
4. Get the precise values of a and r using the initial assumptions M(1)=1 and M(2) =
2.
5. In terms of n, write the final explicit formula for M(n).
By following these procedures, you may determine the precise formula for how many
washing machines the company manufactured in the first n months.
References:
Doerr, A., & Levasseur, K. (2022). Applied discrete structures (3rd ed.)