 So welcome back to another screencast on the extended principle of mathematical induction. We learned last time that the extended principle of induction just says that if we're dealing with a statement that seems true not necessarily for all natural numbers, but for all natural numbers past a threshold value, then we could just use the smallest value for which the statement is true as our base case and do induction from there. Let's look at an example that doesn't involve calculations necessarily, but comes from the field of computational geometry. This is a heavily applied field that meets at the intersection of computer science and geometry and does things like create highly efficient algorithms for rendering 3D graphics or say you want to place the smallest number of cameras in a building so that all points in the building are visible from the cameras. So computational geometry deals a lot with a thing called a polygon. Let me briefly describe what I mean by a polygon. This isn't totally technically precise, but it will be close enough for where we're about to do. A polygon is a closed region in the plane whose sides are made up of line segments. Those line segments are called edges and those edges come together at points that we call vertices. So on the screen you see several examples of polygons and they aren't all nice looking or regular or anything. A lot of times you want to take polygons and divide them up by connecting two vertices of the line segment. That's called a diagonal of the polygon. That's a line segment that connects two non-adjacent vertices. Notice that sometimes diagonals fall inside the polygon and sometimes they don't. Now one of the things that we do with polygons which for example might represent simple 2D models of shapes on a map is to use diagonals to split up the region inside the polygon into triangles. I'm drawing right now an example of that process. When I split up the interior of a polygon into a bunch of triangles by drawing non-intersecting diagonals like this, this is called triangulating the polygon and what you see here is a triangulation of that polygon. So one of the things to notice is that a polygon can be triangulated in more than one way. And here's an example of two different triangulations of the same polygon. So I want you to try something before you move on. On a separate piece of paper, draw a polygon with ten vertices. It doesn't have to be regular. It can have a dense in it and so forth. It doesn't need to be a closed figure that's made up by line segments. And triangulate it in two or three different ways. Make sure that when you triangulate that you don't let the diagonals cross each other. That's the only rules here. So here's an example of one of those polygons and a triangulation of it. When you've done your drawings, I want you to count the number of triangles that you used, then answer this question. How many triangles did you use in a triangulation of a polygon with ten vertices? Then pause the video and come back and see some magic happen. So the answer is eight. If you drew the polygon and triangulated it according to the rule, no matter how you triangulated the polygon, you should have gotten eight triangles. It's kind of a magic trick. So what happens if I had, say, sixteen vertices? Well, here are two triangulations of a polygon with sixteen vertices. Let's count the number of triangles in this one. That's one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen in this one. And if you count it, you'll find fourteen in the other one. So I know this is just a couple of examples, but do you feel like making a conjecture at this point? So pause the video and write out what you think the conjecture ought to be. How many triangles are in a triangulation of a polygon with, say, n vertices? So it seems like this ought to be the right conjecture. Every triangulation of a polygon with n vertices contains n minus two triangles. Now, it seems true based on our examples, but how do we prove it? So an approach that works particularly well when it shows up a lot in computational geometry is induction. So this isn't set up like most of our other induction statements because it doesn't come out and say, for all natural numbers, n such and such. But notice that n is a natural number because it's the number of vertices in a polygon. So maybe induction is appropriate. Let's try it out. What's the base case in this conjecture if we're going to try induction? I'll give that to you as a concept check and just fill in the blank with the correct value of n to use for the base case. n equals what? So the right answer here is n equals three. And this comes from thinking about the statement. n is the number of vertices in the polygon that we want to triangulate. n equals one wouldn't make any sense. That would just be one vertex, and that's just a single point. So you can't triangulate that. And n equals two doesn't make sense either because if you had only two vertices, your quote unquote polygon would just be a single edge and no interior to triangulate. So n equals three is the smallest case here that makes any sort of mathematical sense. So that means if we're going to use induction, we're going to be using the extended principle of induction because the n equals one case doesn't even exist. We have to use n equals three as the base case. So let's do this. Let's start and approve the base case. I need to show that every triangulation of a polygon with three vertices has one triangle in it. But this is obvious because a polygon with three vertices is a triangle and this is its own triangulation. You can't triangulate it any further. And remember the rules for triangulation say nothing about adding new vertices. We have to merely join existing vertices with non-overlapping diagonals. And this is it. This is the only triangulation of a triangle that you can find. So that's the base case. Now let's move on to the inductive step and this is where it gets fun. For the inductive hypothesis, assume that every triangulation of a polygon with k vertices has k minus two triangles in it. And then we're going to prove that every triangulation of a polygon with k plus one vertices has k plus one minus two, which is k minus one triangles in it. So to prove this, suppose we have a polygon that has k plus one vertices in it and let's suppose we have a triangulated. The fact that it's possible to triangulate any polygon is a theorem that's true but we won't prove it here. As with all induction proofs, the proof in the inductive step needs to involve bringing the inductive hypothesis into the picture. And that means we want to reduce the current problem down to some smaller, simpler version of itself and then use the inductive hypothesis. So our inductive hypothesis here tells us something about polygons with k vertices and I'm trying to prove something about polygons with k plus one vertices. So how can I reduce the problem down? Well, here's how. Let's pick one of these vertices on the edge here and let's delete it along with the edges on the boundary that connect to it. What you have here left over is another polygon and we're going to choose that vertex in such a way that only two edges are coming into it and it can be proven that's always possible. So we delete that vertex and the edges that connect to it and guess how many vertices it has? I guess how many vertices the resulting polygon has. So I started with k plus one vertices and I deleted one of them. So the leftover stuff here has k vertices. Well, now I can use the inductive hypothesis. What I have here is a polygon with k vertices and it's been triangulated. So the inductive hypothesis tells me that there must be k minus two triangles in this polygon. So now I'm going to use that fact to build up to the main polygon. The lower polygon here has k minus two triangles in it by the inductive hypothesis. If I throw that deleted vertex back in, what happens? Well, what it does is it introduces one vertex but also one triangle into the picture. So how many triangles are there in all? There were k minus two down here and now once I add in that k plus first vertex I pick up another one so now I have a total of k minus one triangles and that's what I wanted to prove that an arbitrary triangulation of this polygon with k plus one vertices has k minus one triangles in it. I've done that and that's the end of the proof. So that's an example of mathematical induction again where it might not make sense to use n equals one as the base case and we have to think a little bit about whether we should even use induction at all and it's not a proof based on algebra or arithmetic. So induction is powerful. Thank you for watching.