 So, in previous videos, we've talked about how to draw regression curves. We started with linear regression, we talked about quadratic, polynomial regression, aka power functions. We've also talked recently about how we can do exponential regression, but what important question to ask is, what is the right regression to use when you have a data set? So, for example, look at the following data set on the screen. When you look at this data set, it does kind of look like it has some type of exponential decay. If you connect the dots, you might get something like this. So, it seems like exponential would be a good model, but maybe there's really not much curvature to it all. Maybe it's more of like a polynomial type thing. I mean, there could be curvature, but I mean, what if the polynomial behavior is something like this, right? Or maybe there's no curvature, like I said by mistake a moment ago. What if it's more like a line of best fit, you know, I mean, that doesn't seem to fit exactly too well. Again, exponential looks really, really close, but we'll see in a second whether that's a good fit or not. Another option is look at this data set right here. Again, you see this data, which actually there's some clustering that seems to be happening near the origin, right? So, if you try to draw that data, it kind of looks like there's some curvature to it. It's not exponential, but when you zoom out to the larger scale, again, all those things kind of bunched together, and again, it seems very natural that, I mean, you could try the exponential growth, right? That seems acceptable, but maybe it's like a linear growth, right? It can be sometimes difficult to tell which data are given a data set, what is the correct function family to model using. And so, let me further complicate the issue with the following picture, right? So what you see on the screen right now is an exponential function. This would be an exponential function, which is growing with a 1% growth rate over time, okay? And so, you look at that scale, it looks very much like an exponential function. If I zoom in to a scale like the following, let me turn this off, let me turn on a different function. This right here is a linear function, so this is y equals 0.01x plus 1, so this would be a linear function, which y is intercept is 1, it has a 1% growth over time, all right? And so then when you, of course, you zoom out, it looks just like a line, right? So the point, of course, is what happens when you look at these graphs together? When you look at them, you're like, well, did the colors changing, right? Because they look almost identical, right? Kind of like the Weasley twins were identical. You look at the two, you look at the two functions, you can hardly see a difference on them whatsoever. What happens is you have to kind of come out from a very far scale to start to see a difference, right? It wasn't until he came to like x equals 200 that it would start to be significant that these are not the same function. And then it's not really until you hit like x equals 400 that you really start to see that the upper function, clearly they're different, but it's not a linear function with a constant slope, it's an exponential function with this constant ratio of growth. And so, again, it can be very difficult to see on the small scale what is the difference between these functions. And after all, when you zoom back in, like I said, you can't really tell much of a difference between these functions. And as a mathematician who lived through the year 2020, that is when the COVID-19 pandemic was at its height, right? I think I have to say I was horrified to see so many online comments about people talking about the spread of the disease and not knowing the difference between a linear and exponential growth. I saw many people say like, oh, well, we don't have to worry about the coronavirus right now because it's only linear growth. But once it becomes exponential, then we have to worry about it. It's like, well, it doesn't just switch from linear growth to exponential growth. The spread of the virus was always exponential, which itself is not the correct model. I mean, a logistic model would be better in that regard. But that's a topic for another video, right? What they're really trying to say is when it switches to be exponential, we have to worry. What they're really saying is that exponential growth, if it has a small enough growth rate, looks a lot like linear growth, right? And so it's hard to tell the difference. But of course, if you allow the experiment to continue long enough, then you do see a stark difference between the exponential growth and the linear growth. And so when it becomes exponential, that's what people are talking about, although erroneously speaking. So let's go back to those data sets we saw before. So we had this data set which has some curvature to it, at least it looks like it's curvature. Maybe there's just some error there. So how do we tell the difference, whether it should be exponential growth or whether it should be some type of polynomial growth or power function growth? Well, if your function looks like y equals ca to the x, that would be like exponential growth. But if it looks like y equals c times x to the a, that'd be some type of monomial growth. Which one is the right answer? Well, hit both sides of the log. It doesn't matter which log you use. You use the common log, you use the natural log. It doesn't matter. If you do that with the exponential function, you'll get the log of the data should look like log of ca to the x, which if you pull it apart by logarithmic rules, you're going to end up with log a to the x plus some log of c, right? C is just a constant. Then you can pull the exponent out. So this becomes x times log of a plus log of c here, which I should mention that log of c, that c is a constant. So log of c is just a number. And then log of a, again, it's just a number. We can kind of be like, oh, we're going to call this m. We're going to call this b. And so we get that log of y should look like mx plus b. In other words, if you take an exponential function and you hit it with a log, it's going to look like a log, OK? Now, on the other hand, if you take the log of both sides of your power function over here, log, log like so, well, then the left hand side is going to become log of y. We're not going to really worry about that. The right hand side, you're going to get log of c x to the a, right? Which you break that apart, you're going to get log of x to the a plus log of c. We're going to call that part b again, right? It didn't seem to make much of a difference. But as for the exponent here, you're going to get a times log of x plus b. And so in this situation, your function is going to look like a logarithmic function, a log versus a line. And so that's going to give us something that we can distinguish between these two. So let's come back to this data set right here, right? If I take this data set right here, this looks like the data set x comma y. So what we want to do is we want to switch it so that we then get x comma log of y. What happens if we hit all of the y-coordinates with the common log? So that's what we're going to do right here. Oops, we don't want to see that thing. Notice what happens is if you take the logarithm of each of the y-coordinates, you get something that now looks like a line, right? And so that then agrees with our assumption earlier that, hey, it looked like an exponential function, right? If I get rid of it, it did look like an exponential function. But the point is when you send it back to take the log of all the data, you get a line. So that tells me, oh, I guess it was an exponential growth, right? Let's look at the other data set right here. So this one, again, the data was really spread apart, right? There was this big jump here. It kind of seems exponential, right? Especially when you zoom in here. It looks like there's curvature to it. But when we take the log of both sides, excuse me, take the log of the y-coordinates, you then get a data set, which it's like, it looks fairly flat in this region right here. But again, zoom in, right? Those data points are all bunched together. You can see there's curvature to it. And so really, if we were to put all of this data together, this would actually suggest some type of logarithmic growth right here, which means the original data set actually was, since it looks like a polynomial, the original data set actually looks like it was some type of power function growth. And so use logarithms to help you decide whether a data set should be exponential or whether it should be a power function.