6.5. Exercises for Lecture 6#

6.5.1. Exercise 6.1#

Determine the zero of the function g(x) = cos(x) using the bisection method in the interval (0, 4).

  • Which checks have been omitted in the implementation of the algorithm described in the lesson text that could speed up the result?

6.5.2. Exercise 6.2#

Perform the previous exercise using a recursive function.

  • Which of the two implementations is faster?

6.5.3. Exercise 6.3#

Implement a function that calculates the factorial of a number using a recursive function.

6.5.4. Exercise 6.4#

Determine the minimum of the function g(x) = x2 + 7.3x + 4 using the golden ratio search method in the interval (-10, 10).

6.5.5. Exercise 6.5#

Perform the previous exercise using a recursive function.

  • Which of the two implementations is faster?

6.5.6. Exercise 6.6#

Complete the two previous exercises by finding the maximum of a chosen function.

6.5.7. Exercise 6.7#

Modifying the previously developed programs, use matplotlib to plot the studied functions and the points found using the bisection and golden section search methods.