Australia has a progressive income taxes with several brackets. The tax function has the form
$$ \begin{cases} 0,& \text{ if income} \le \text{th}_1 \\ (\text{income} - \text{th}_1)*\text{rate}_1,& \text{ if income} \in [\text{th}_1, \text{th}_2] \\ (\text{th}_2 - \text{th}_1)*\text{rate}_1 + (\text{income} - \text{th}_2)*\text{rate}_2,& \text{ if income} \in [\text{th}_2, \text{th}_3] \\ (\text{th}_2 - \text{th}_1)*\text{rate}_1 + (\text{th}_3-\text{th}_2)*\text{rate}_2 + (\text{income} - \text{th}_3)*\text{rate}_3,& \text{ if income} \in [\text{th}_3, \text{th}_4] \\ (\text{th}_2 - \text{th}_1)*\text{rate}_1 + (\text{th}_3-\text{th}_2)*\text{rate}_2 + (\text{th}_4-\text{th}_3)*\text{rate}_3 + (\text{income} - \text{th}_4)*\text{rate}_4,& \text{ if income} > \text{th}_4 \end{cases} $$The values for the thresholds and the rates in the 15 year in the period between 2000 and 2015 are given in the table below.
Year | $ th_1 $ | $ th_2 $ | $ th_3 $ | $ th_4 $ | $ rate_1 $ | $ rate_2 $ | $ rate_3 $ | $ rate_4 $ |
---|---|---|---|---|---|---|---|---|
2000 | 6,000 | 20,000 | 50,000 | 60,000 | 0.17 | 0.30 | 0.42 | 0.47 |
2001 | 6,000 | 20,000 | 50,000 | 60,000 | 0.17 | 0.30 | 0.42 | 0.47 |
2002 | 6,000 | 20,000 | 50,000 | 60,000 | 0.17 | 0.30 | 0.42 | 0.47 |
2003 | 6,000 | 21,600 | 52,000 | 62,500 | 0.17 | 0.30 | 0.42 | 0.47 |
2004 | 6,000 | 21,600 | 58,000 | 70,000 | 0.17 | 0.30 | 0.42 | 0.47 |
2005 | 6,000 | 21,600 | 63,000 | 95,000 | 0.15 | 0.30 | 0.42 | 0.47 |
2006 | 6,000 | 25,000 | 75,000 | 150,000 | 0.15 | 0.30 | 0.40 | 0.45 |
2007 | 6,000 | 30,000 | 75,000 | 150,000 | 0.15 | 0.30 | 0.40 | 0.45 |
2008 | 6,000 | 34,000 | 80,000 | 180,000 | 0.15 | 0.30 | 0.40 | 0.45 |
2009 | 6,000 | 35,000 | 80,000 | 180,000 | 0.15 | 0.30 | 0.38 | 0.45 |
2010 | 6,000 | 37,000 | 80,000 | 180,000 | 0.15 | 0.30 | 0.37 | 0.45 |
2011 | 6,000 | 37,000 | 80,000 | 180,000 | 0.15 | 0.30 | 0.37 | 0.45 |
2012 | 18,200 | 37,000 | 80,000 | 180,000 | 0.19 | 0.325 | 0.37 | 0.45 |
2013 | 18,200 | 37,000 | 80,000 | 180,000 | 0.19 | 0.325 | 0.37 | 0.45 |
2014 | 18,200 | 37,000 | 80,000 | 180,000 | 0.19 | 0.325 | 0.37 | 0.45 |
2015 | 18,200 | 37,000 | 80,000 | 180,000 | 0.19 | 0.325 | 0.37 | 0.45 |
# draft implementation for year 2000 to get you started
income=54780.0
if income <= 6000:
tax = 0.0
elif income > 6000 and income <= 20000:
tax = (income-6000)*0.17
elif income > 20000 and income <= 50000:
tax = (income-20000)*0.30
elif income > 50000 and income <= 60000:
tax = (income-50000)*0.42
elif income > 60000:
tax = (income-60000)*0.47
print('tax(%1.2f) = %1.2f AUD' % (income,tax))
# run your function on the following data
year = 2000
income = 42400
year = 2010
income = 58300
year = 2015
income = 82710
year = 2012
income = 120340
year = 2001
income = 431400
year = 2003
income = 41870
year = 2090
income = 1407790
#let's make a plot as well
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = [12, 8]
K = 250 #number of points in the income grid
max_inc = 250000 #maximum income
inc = [k * @@ / (K-1) for k in range(@@)] # grid over income
tax = [0,]*K
for year in [@@@ for i in range(@@)]:
for j in range(@@):
income = inc[j]
tax[j] = @@@
plt.plot(inc,tax,label="year %d" % year)
plt.xlabel(@@@)
plt.ylabel(@@@)
plt.show()
#Your code here