initial commit with 2024 materials

This commit is contained in:
Pamela Hathway 2025-09-19 10:46:45 +02:00
commit 6fdfdbb8b7
66 changed files with 102457 additions and 0 deletions

View file

@ -0,0 +1,25 @@
import numpy as np
def f(x, r):
"""
takes r and x as input and returns r*x*(1-x)
"""
return r * x * (1 - x)
def iterate_f(it, xi, r):
"""
takes a number of iterations `it`, a starting value,
and a parameter value for r. It should execute f repeatedly (it times),
each time using the last result of f as the new input to f. Append each
iteration's result to a list l. Finally, convert the list into a numpy
array and return it.
"""
x = xi
xs = []
for _ in range(it):
x = f(x, r)
xs.append(x)
return np.array(xs)