yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Contour plots | Multivariable calculus | Khan Academy


4m read
·Nov 11, 2024

So I have here a three-dimensional graph, um, and that means that it's representing some kind of function that has a two-dimensional input and a one-dimensional output. So that might look something like f(x, y) = and then just some expression that has a bunch of x's and y's in it. Graphs are great, but they're kind of clunky to draw. I mean, certainly you can't just scribble it down; it typically requires some kind of graphing software. And when you take a static image of it, it's not always clear what's going on.

So here, I'm going to describe a way that you can represent these functions in these graphs two-dimensionally just by scribbling down on a two-dimensional piece of paper. Um, and this is a very common way that you'll see if you're reading a textbook or if someone is drawing on a blackboard. It's known as a contour plot. The idea of a contour plot is that we're going to take this graph and slice it a bunch of times.

Okay, so I'm going to slice it with various planes that are all parallel to the XY plane, and let's think for a moment about what these guys represent. So the bottom one here, um, represents the value Z is equal to -2. Okay, so this is the z-axis over here, and when we fix that to be -2 and let X and Y run freely, we get this whole plane. And if you let Z increase, keep it constant but let it increase by one to -1, we get a new plane still parallel to the XY plane. It's got a, uh, but its distance from the XY plane is now 1, and the rest of these guys, they're all still constant values of Z.

Now, in terms of our graph, what that means is that these represent constant values of the graph itself. These represent constant values for the function itself. So, because we always represent the output of the function as the height off of the XY plane, these represent constant values for the output. So what that's going to look like, so what we do is we say where do these slices cut into the graph? So I'm going to draw on all of the points where those slices cut into the graph, and these are called contour lines.

We're still in three dimensions, so we're not done yet. So what I'm going to do is take all these contour lines and I'm going to squish them down onto the XY plane. Uh, so what that means, each of them has some kind of Z component at the moment, and we're just going to chop it down and squish them all nice and flat onto the XY plane. Now we have something two-dimensional, and it still represents some of the outputs of our function. Not all of them; it's not perfect, but it does give a very good idea.

So let's, I'm going to switch over to a two-dimensional graph here. Um, and this is that same, same function that we were just looking at. Let actually move it a little bit more central here. So this is the same function that we were just looking at, but, um, each of these lines represents a constant output of the function. So it's important to realize we're still representing a function that has a two-dimensional input and a one-dimensional output. It's just that we're looking in the input space of that function as a whole.

So this is still, you know, f(x, y) and then some expression of those guys. But, you know, this line might represent the constant value of f when all of the values where it outputs three. Um, over here, this also, like both of these circles together give you all the values where f outputs three. Um, this one over here would tell you where it outputs two, and you can't know this just looking at the contour plot.

So typically, if someone's drawing it, if it matters that you know the specific values, they'll mark it somehow; they'll let you know what value each line corresponds to. But as soon as you know that, you know this line corresponds to zero. It tells you that every possible input point that sits somewhere on this line will evaluate to zero when you pump it through the function, and this actually gives a very good feel for the shape of things.

You know, if you like thinking in terms of graphs, you can kind of imagine how these circles and everything would pop out of the page. Um, you can also look, you know, notice how the lines are really close together over here, very, very close together, but they're a little more spaced over here. How do you interpret that? Well, over here, this means it takes a very, very small step to increase the value of the function by one. Very small step, and it increases by one, but over here, it takes a much larger step to increase the function by the same value.

So over here, this kind of means steepness. If you see a very short distance between contour lines, um, it's going to be very steep, but over here, it's much more shallow. Uh, and you can do things like this to kind of get a better feel for the function as a whole. The idea of a whole bunch of concentric circles usually corresponds to a maximum or a minimum, um, and you end up seeing these a lot.

Another common thing people will do with contour plots is represent them as color them. So what that might look like is here, where, you know, warmer colors like orange correspond to high values and cooler colors like blue correspond to low values. And the contour lines end up going along, you know, the division between red and green here, between light green and green, and that's another way where colors tell you the output.

And then the contour lines themselves can be thought of as the borders between different colors. Um, and again, a good way to get a feel for a multi-dimensional function just by looking at the input space.

More Articles

View All
Formulas and units: Volume of a pool | Working with units | Algebra I | Khan Academy
We’re told that Marvin has an inflatable wading pool in his backyard. The pool is cylindrical, with a base area of four square meters and a height of 60 centimeters. What is the volume of the pool in cubic meters? Pause this video and see if you can figur…
The Story of the Sacred Pipe | Story of God
INTERVIEWER: I’m on my way to meet a man who has been chosen to lead his people in an epic struggle, one that also requires super human endurance. He’s asked me to come to Devils Tower in Wyoming. This is Chief Arvol Looking Horse, the Chosen One of the N…
Mathilde Collin on Feature Prioritization and Employee Retention at Front
I think the most pressing and important question is this first one from Tomas Grannis about Lego. Yes, what’s your favorite Lego theme? Yeah, my favourite Lego theme is something that not a lot of people know. It’s called Ideas. Okay, and so basically yo…
The Best Video Essays of 2022 | Aperture
The useless information, the things that we think about when we want to escape. Time flies like an arrow, but fruit flies like a banana. I mean, fruit flies don’t fly like a banana; even bananas probably don’t fly like bananas. Not like I’ve seen a banana…
From CHAOS to CALM | STOIC STRATEGIES for OVERTHINKING RELIEF | STOICISM INSIGHTS
Hello everyone and welcome back to Stoicism Insights! If you’re new here, make sure to subscribe and hit that notification bell so you won’t miss any of our insightful content. Today’s video is a game-changer; we’re tackling a common struggle that many o…
Relative clauses | Syntax | Khan Academy
Hello grammarians! Hello Rosie! Hi David! So today we’re going to talk about a special kind of dependent clause, which again is a kind of clause that can’t be a sentence on its own, called a relative clause. A relative clause is a dependent clause that s…