# Multiple Weighted Hyerplanes to Classify XOR

I learned in class that perceptrons cannot simulate the XOR operation. My professor told me that one fix was to left the points onto a higher dimensional space. That is pretty obvious, you just use the feature $x_1x_2$. He also said that you can use multiple weighted hyperplanes and nonlinear functions to do so. I'm not sure how to do that. Here is all the formal definitions and whatnot:

Suppose you have the following four points (with labels) $(1,1): +1; (-1, -1): +1; (-1, 1): -1;$ and $(1, -1): -1$ (i.e. the XOR function).

Find a weighted combination of hyperplanes $\mathrm{Sign}(w_1h_1(x) + · · · + w_kh_k(x))$ that classifies all 4 points correctly. A hyperplane is a function of the form $h_i(x) = \mathrm{Sign}(v_i · x + b_i)$. In other words, $h_i(x) = 1$ when $x$ is on one side, and $h_i(x) = −1$ when $x$ is on the other side.

Now, let’s generalize to $d$ dimensions. There are $2^d$ input points of the form $(±1, ±1, . . . , ±1)$. The label of a point is $+1$ if an even number of coordinates were $−1$, and the label is −1 if an odd number of coordinates were −1. Find a weighted combination of hyperplanes that correctly classifies these inputs.

• What did you try? Where did you get stuck? We're happy to help you understand the concepts but just solving exercises for you is unlikely to achieve that. You might find this page helpful in improving your question. – D.W. May 7 '17 at 2:46
• Sure. For the 2D case, I found that a valid solution is $h_1 = [1, 1]^T - 0.5, w_1 = 0.8$ and $h_2 = [1, 1]^T + 1.5, w_2 = 0.2$. I'm not really sure how to begin generalizing this result, since I just tried random stuff for the 2D case. – oriorio9 May 7 '17 at 3:42