First two exercises of chapter 3
Solution to exercise 3-3