2025-plovdiv-testing-debugging/testing_project/logistic.py
2025-09-23 18:44:31 +03:00

14 lines
301 B
Python

# 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