In the last video we saw how a Neural Network can be used to

compute the functions x1 AND x2, and the function x1 OR

x2 when x1 and x2 are binary, that is when they take on values 0,1.

We can also have a network to compute negation,

that is to compute the function not x1.

Let me just write down the ways associated with this network.

We have only one input feature x1 in this case and the bias unit +1.

And if I associate this with the weights plus 10 and -20,

then my hypothesis is computing this h(x) equals sigmoid (10- 20 x1).

So when x1 is equal to 0, my hypothesis would

be computing g(10- 20 x 0) is just 10.

And so that's approximately 1, and when x is equal to 1,

this will be g(-10) which is approximately equal to 0.

And if you look at what these values are, that's essentially the not x1 function.

Cells include negations, the general idea is to put

that large negative weight in front of the variable you want to negate.

Minus 20 multiplied by x1 and

that's the general idea of how you end up negating x1.

And so in an example that I hope that you can figure out yourself.

If you want to compute a function like this NOT x1 AND NOT x2,

part of that will probably be putting large negative weights in front of x1 and

x2, but it should be feasible.

So you get a neural network with just one output unit to compute this as well.

All right, so this logical function, NOT x1 AND

NOT x2, is going to be equal to 1 if and only if