Solution to exercise 1

Solution to exercise 2

Solution to exercise 3

Solution to exercise 4A

Solution to exercise 4B

Solution to exercise 5