Chapter 7: Solutions for exercises 1 to 4