What is an example of XOR?

216 Views Asked by At

I have a doubt regarding the below lines in "deep learning" book.

I don't have a very good math background, I grasp most of the concepts with examples. First they describe this:

enter image description here

Which I understand it as ie $x_1=$ house_size , $x_2=$year_built and $f(x,w)$ shall be the house price.

But I can't think of an example for the below: enter image description here I see in wikipedia that XOR is exclusive 'or', so I understand that it means strictly either 'a' or 'b'. But what is an example of this?

4

There are 4 best solutions below

3
On BEST ANSWER

I don't like going to the movies alone. This week, there are 2 tickets for a movie I'd like to see, so I ask 2 friends A and B if they'd like to see it.

If neither A nor B wants to see it, then I wont go.

If A wants to go but B doesn't, or visa versa, then I will go with whoever wants to join me.

If both A and B want to go, I'll let them buy the tickets and stay home. I wont go.

Hence the "Do I go to the movies" function is A xor B.

0
On

Can you draw a straight lien such that the points (1,0) and (0,1) lie on one side, and the points (0,0) and (1, 1) on the other side?

enter image description here

0
On

You can actually use your example of:

$x_1=$ house_size , $x_2=$year_built

Suppose that you are looking for a house, and you want a good house size (not too small!), and are also looking for a relatively new house (not too old!). However, your budget is limited, and so probably you can;t afford houses that are both new and big. So, if you had a list of houses with $x_1$ and $x_2$ given, then the houses you are interested in and that you decide you may want to check out, are likely between the two lines in the graph below:

enter image description here

So, you'd like a neural network to identify that 'area of interest', but unfortunately, a single perceptron can only 'draw' one line in 'feature space'. Thus, a single perceptron cannot provide us with a good function that determines, given $x_1$ and $x_2$, whether or not the house is of interest to you or not. With multiple perceptrons you can, but for a while people did not know how to come up with a training method for multi-layered networks. That is why this is known as the XOR problem: it's when you want one, but not both, of two things to be the case.

0
On

Below, an electric circuit modelling the X-OR operator

enter image description here