population.py

Created by enzo-ginhoux-07

Created on March 27, 2022

434 Bytes


def population_mat(n):
    U = [200,600]
    A = [[0.2,0.5],[0.6,0.6]]
    C = [350,550]
    i = 1
    while i < n:
        A = [[A[0][0]*0.2+A[0][1]*0.6,A[0][0]*0.5+A[0][1]*0.6],[A[1][0]*0.2+A[1][1]*0.6,A[1][0]*0.5+A[1][1]*0.6]]
        i += 1
    P = [U[0]-C[0],U[1]-C[1]]
    AfoisP = [A[0][0]*P[0]+A[0][1]*P[1],A[1][0]*P[0]+A[1][1]*P[1]]
    AfoisPplusC = [AfoisP[0]+C[0],AfoisP[1]+C[1]]
    print(AfoisPplusC)