Artificial Intelligence, Numerical Analysis, Optimization, Python Programming, Statistics.
plt.pause(1) a_vals = [a] b_vals = [b] i = 0 while i < iterations: c = (a + b) / 2 c_original = fun(c) if c_original < 0: a = c else: b = c i += 1 a_vals.append(a) b_vals.append(b) # Plot all the values of a and b in different colors plt.plot([fun(a_val) for a_val in a_vals], 'mo',