Homework 2 of Artificial Intelligence 2013 on KTH