# question 3 N0=1 N1=N0*2 print({N1}) N0=1 g=3 Ng=N0*2**3 print({Ng}) # question 4 def N_vect(N0, r, ng): suite = [N0 * (r ** i) for i in range(ng)] return suite N0 = 1 r = 2 ng = 5 resN = N_vect(N0, r, ng) print(resN) # question 5 # pip install numpy import numpy as np def time_vect(t0, ng, T): return np.arange(t0, t0+ng * T, T) # fonction qui permet de créer un vecteur avec début, fin et increment ng = 5 t0 = 0 T = 20 resT = time_vect(t0,ng,T) print(resT) # question 6 import matplotlib.pyplot as plt resT resN plt.scatter(res,resN) plt.step(res, resN,where="post") plt.xlabel('temps') plt.ylabel('nombre de cellules') plt.title('Evolution du nombre de cellules') plt.legend() plt.show() # question 8 def N_vect(N0, r, ng): suite = [N0 * (r ** i) for i in range(ng)] return suite N0 = 1 r = 2 ng = 12 resN = N_vect(N0, r, ng) print(resN) # question 10 t_interest = 105 T = 20 import math n_before = math.floor(t_interest / T) print({n_before}) max(N_vect(N0,r,n_before))