# Your code goes here import numpy as np def f(x, r): return r * x * (1 - x) def iterate_f(x, r, n_iterations): trajectory = np.zeros(n_iterations+1) trajectory[0] = x for i in range(n_iterations): trajectory[i+1] = f(x, r) x = trajectory[i+1] return trajectory