solutions to chapter 4 exercises