Fix "isERP is not defined" error.

I noticed that trying to run the code in the first code box in the "With random sampling" section of chapter 2 causes an "isERP is not defined" error. This pull request fixes that along with a typo I noticed on the same line.