Okay, welcome back everyone. This video is called Graphs of Functions. And what we're gonna do in this video is bring you from the more abstract land we had in the last video, where I convinced you that a function was something called F from A to B, which was a rule, which took something in an arbitrary set A, and transformed it via a crazy machine into something in an arbitrary set B. That was on our picture of a function. Here's A, comes through. Here's F of A, and it lands in here. On the other hand, you probably also have a picture of a function in mind which looks like what's over here on the big screen. Namely, this line here, with this blue curve here. What those actually are, are graphs of functions. Those are graphs of functions, which happen to be from the set, the real line, to the set, the real line. And the point of today's video is to convince you of that and to talk to you about the difference between a graph of a function and the function itself, as well to build some important vocabulary for later. Okay, let's jump right in. So suppose we have a function F, from the real line to the real line. So here is a copy of the real line. Here is a copy of the real line thought of as sets. Here's our little conveyor belt. Here's the machine that is the function, who knows what's going on in there? And here is the conveyor belt coming out. And in some sense, every single real number X, comes into the machine, moves in, some stuff happens to it, and it comes out as F of X, it lands over here. That's still the same picture. It's still valid. The problem is, as we saw before in the previous module, there is a ridiculously large infinite number of real numbers. And so unlike a function of a finite set to a finite set, we can't just specify what happens, we can't say that F of one equals apple, F of two equals Daniel Egger, because there are infinitely many inputs. So usually when we define a function for the real line to the real line, we have to give you a formula. So for example we might see a formula like F of X, equals 2X minus one. What this is, this is a formula. This is a rule that tells you how to operate the machine. Any input you give the machine, it tells you how to make the output. So for example if one comes in, we know that F of one, follow the rule and plug in 1 for x, 2 times one minus one that turns out to be equal to: 2(1) - 1 = 1. If we plug it in zero. F of zero equals two times zero, minus one is minus 1. If we plug in a real number which is not an integral like 5.1, we get 2(5.1) - 1, or 10.2 - 1, never get to do arithmetic in public, so I'm doing it like this, equals 9.2. And that's the point, that's the whole idea of the function. And you can have more complicated formulas. So for example we could have G of X equals the absolute value of x which we saw before, right? That's a form which was often given by cases. This is equal x if x is greater than or equal zero. And minus X if X is less than zero. In both cases, both F and G here, are functions. They take input values, X, and they spit out F of x or G of x in this case you just have a formula for how to do it. OK, so what? What's the point of a graph. Well what's the correspondence when we graph what we saw? So lets draw what you all know is the graph of the expression Y equals 2 x minus one. You saw before how to plot the equation in a line. So there's a Y intercept, minus one. Always good to review. Slope is 2, so it goes about like that. So, this symbol here, this is actually not the function, this is the graph of the function. This is the graph of the function F from R to R which formula is F of x equals 2 X minus one. Now what's the point about that distinction. But, this is a nice visual picture. This allows you to depict all input and output pairs at once. For example if x equals zero, I look at zero and then I sort of think about where zero goes until I meet the graph and that point there, that's the point (0, f(0), which we know is equal to (0, -1). If I say take the point, 5.1, to about there, and I look till it meets the graph, there it is. That's the point, (5.1, f(5.1)). OK, so in general, if let's say G is a function from R to R. The graph of G, an important concept here, is a set of points in the plane. So lets give it a name, lets call it graph of G, this is equal to the set of all points, x comma y, ∈ R two, such that y is equal to G of x. And that's a really important distinction, the visual way of drawing the graph. Lets see some examples. So, for example look draw up front. Suppose, G of x is the absolute value of x. Let's draw the graph. We already know that G of x is equal to x if x is greater than or equal to zero and minus x if x is less than zero. It turns out that this graph looks like this.Well. We've seen that before. Often people will write then, y equals absolute value of x here. What that is telling you is, that every single point on this graph, the y coordinate is equal to the absolute value of the x coordinate. So in other words, if this is two, the y coordinate there is two, which is the absolute value of two. This is in fact the point, two, comma the absolute value of two. On the other hand, if I take minus two, and I look at the y coordinate, that's the absolute value of minus two. So this point here, is, minus two, comma, the absolute value of of minus two. And that's the idea of a graph, two Okay, lets do one more example. Suppose H of x is equal x squared. That's one of the things that we saw at the very beginning. So lets draw our set of axis. One of things we're going to learn here is how to graph a function if you don't know what the graph looks like. The other two are sort of cheating. There's no magic bullet here, there's no tried and true answer. Really, often what you do is test out a bunch of input and output pairs, see a pattern, and try and draw a curve through it. The astute listeners among you will realize that's exactly what you do in supervised learning, you try to figure out what the function is going to look like, like querying, by asking a few inputs and seeing what the outputs are. So lets make, for example, a table. Here is H of x and lets figure out a table. So if x equals zero and H of x would be zero squared equals zero. So lets plot the point, (zero, zero) on the graph. If x equals one then H of x is one squared equals one. Lets plot the point (1,1) on the graph. If x equals two, then two squared equals four. Lets plot the point (2, 4). three, three squared equals nine. We're going way up there. So somehow it looks like a curve going up like that. Lets try some negative numbers. Negative one, we know that negative one squared equals one. And pretty soon we're going to see a pattern of symmetry like that. And that's about what the graph of y equals x squared looks like. That's really how you graph functions. You don't know what they're supposed to look like. In a later video, you're going to learn a bunch of patterns and what later functions look like, what quadratic functions like this one look like, what cubic functions look like, what exponential functions looks like, and things like that. We are just going to close the video now by telling you something important, called the vertical line test. To illustrate what that really gives you, let me give you an example. I'm going to draw three curves on the plane and only one of them is actually the graph of a function. There is one guy. There's another one, and choose another color, lets try yellow, say take a third graph like this. Okay, so those are three purported graphs. Here's an interesting fact, red could be a graph of a function. Red could be the graph of say, y equals x minus one. Blue could be the graph of a function, even if I can't think of a formula, that also could be a graph. Here's the wonderful fact, yellow cannot be the graph of a function. There is no function whose graph is yellow. If you think a little bit about it, you'll see why. It violates something called the vertical line test. Namely, if I draw a vertical line, I can find a vertical line which hits the graph at two different points. Why is that a problem? Well if this little point here is x, in essence I'm being proposed two different things for the value of the yellow function of x. There's that one and there's that one, and that's illegal, right? Remember a function is a rule which takes one of the things in a set and assigns it to an element on the other set. There can't be any ambiguity. That's not the case with any of these other graphs, right? If I draw a vertical line here, it intersects the right guy at exactly one point, and it intersect the blue guy at exactly one point. So if this is the point x, I want to know what's the red function of value of x, there it is. What's the blue function of the value of x? There it is. Any other vertical line, same exact thing, it intersects the red line at one point, so there's x, there's the red value of x and there the blue value of x. There's that ambiguity with yellow. So lets actually write down what the vertical line test says, any vertical line, intersects the graph of a function once. If it intersects it more than once, we violate things here. Okay, that concludes this video.