add first three chapter examples

Complete examples in chapter 3, add chapter 1 and 2 examples.