Perceptron learning algorithm for Homework 1