Norvig's PAIP code & my translations to Python.