import numpy as np
from matplotlib import pyplot as pp
fJo = 0.09 # flat jonin mortality
deathRate = [ .3, .15, .09, .08, .28, # 13 14 15 16 17
.25, .22, .21, .20, .25, # 18 19 20 21 22
.3, .25, .22, .21, .15, # 23 24 25 26 27
.15, .15, .14, .12, .12, # 28 29 30 31 32
.12, .11, .1, .1 , .1 , # 33 34 35 36 37
fJo, fJo, fJo, fJo, fJo, # 38 39 40 41 42
fJo, fJo, fJo, fJo, fJo, # 43 44 45 46 47
fJo, fJo, fJo, fJo, fJo, # 48 49 50 51 52
fJo, fJo, fJo, fJo, fJo, # 53 54 55 56 57
fJo, fJo, fJo, fJo, fJo, # 58 59 60 61 62
.10, .10, .10, .11, .11, # 63 64 65 66 67
.12, .12, .13, .14, .16, # 68 69 70 71 72
.19, .23, .28, .34, .41] # 73 74 75 76 77
cohort = [300]
#cohort = [3000]
age = [12]
for r in deathRate:
age.append(age[-1]+1)
cohort.append(cohort[-1]*(1-r))
pp.figure()
pp.plot(age, cohort)
print('Total Ninja: ', sum(cohort))
print('Genin: ', sum(cohort[0:5]))
print('Chunin: ',sum(cohort[5:11]))
print('Jonin: ', sum(cohort[11:]))
print('Jonin less than 30: ', sum(cohort[11:18]))
print('Jonin 30-40: ', sum(cohort[18:28]))
print('Jonin 40-50: ', sum(cohort[28:38]))
print('Jonin 50-60: ', sum(cohort[38:48]))
print('Jonin 60-70: ', sum(cohort[48:58]))
print('Jonin over 70: ', sum(cohort[58:]))
pp.figure()
pp.plot(age[1:], deathRate)