# Implement multiple input XOR with d-d-1 feed-forward neural network

If there are $D$ inputs from $x_1$ to $x_D$, how can I use a D-D-1 feed forward neural network to implement $\text{XOR}\left(x_1,x_2,\ldots,x_D\right)$ with signum as transformation function?

Here D-D-1 means $D$ inputs (not including $x_0$), one hidden layer with $D$ neurons (not including the constant neuron) and one output layer.

• What are your thoughts? Probably you should start with considering $D = 2$. – Random Jack Jan 3 '16 at 15:03

I can't prove it, but I'd bet that's impossible for $D>2$. It works for $D=2$ as one of the hidden neurons computes $x_1 \land \bar x_2$ and the other computes $\bar x_1 \land x_2$. It works by computing the points where the output should become true (due to symmetries, there are multiple solutions, but all work according to the same principle).
For $D=2$ it only works, as there are $2^{D-1}$ such points. You'd need networks like 3-4-1, 4-8-1, 5-16-1. etc., which sounds pretty unusable.