'''Instructions for Exercise 2.3
Plotting the absolute value function x --> |x|
Plotting the shifted absolute value function x --> |x-1| - 2
plotting the function n --> n**2 - n + 3
'''

import numpy as np
import matplotlib.pyplot as plt

''' absolute value function '''
plt.figure(1)
x = np.arange(-2,2,0.01)
y = abs(x) 
plt.plot(x,y)

''' translated absolute value function '''
plt.figure(2)
x = np.arange(-2,2,0.01)
y = abs(x-1) - 2
plt.plot(x,y)

''' plot of a sequence '''
plt.figure(3)
n = np.arange(1,10)
a = n**2 - n + 3 
plt.plot(n,a,'*')

plt.show()