Lecture examples for chapter 4