# Implicit Differentiation

Normally, I don’t have trouble teaching implicit differentiation. However, I’m never satisfied with what I do. I’m fairly certain that I have taught it four different ways in the past four years. But what’s common is that we do a lot of algebra. By the end, they can find $\frac{dy}{dx}$ for a relation like $\sin(xy)+y^3=2x+y$. Or something like that. But we lose the meaning of what we’re doing.

I realized we can do all this algebra, but it’s all procedure. And so there’s no real depth.

So today, after introducing implicit differentiation (including some visual motivation), I assigned 5 basic problems from the textbook. Each of the problems has an equation like $3y^3+x^2=5$ and students are asked to find $\frac{dy}{dx}$. My kids are going to go home today and struggle with it. We’ll spend about 20 or 25 minutes in our next class going over their solutions, talking about things, whatever.

And then… then… I’m going to hand out this sheet I wrote today.

[.doc, .pdf]
[if you're wondering, the graphs were made by the fabulous winplot which I adore... it can do implicit plotting!]

My kids found $\frac{dy}{dx}$ for homework. Now in class, my kids are going to interrogate what that means.

I am not sure yet how I’m going to structure the class. I think I might have us all work together on the first problem (#9), and then assign pairs to work on two of the remaining problems. And then I’ll pick one problem for each pair to present to the class. But what I’m truly happy about is that each problem gets kids to relate implicit differentiation to a graphical understanding of the derivative. It forces my kids to look at the derivative equation, and make connections to the original graph.

Although I’m proud of it, I’m honestly just not sure if this investigation is beyond the scope of my kids’s abilities. It pulls together a lot of concepts. I think it’ll work for them. This year I have a really really strong crew so I have faith. However, it’s an activity I’m going to have to give my kids time to do, and room to struggle. I know me, and I’m going to want to rush it, and I’m going to want to help them in ways that aren’t good for them. The struggle is where they’re going to learn in this, so I have to give it time and stay out.

I am in the middle of a hellish week, but if I have time, I’ll try to report back how it goes after we do it in class.

# Taking a Moment… in Calculus

In calculus, I’ve historically asked kids to take the derivative of:

$f(x)=\frac{2x^2+\sqrt{x}}{\sqrt{x}}$

and students will immediately go to the quotient rule. OBVIOUSLY! There’s a numerator and denominator. Duh. So go at it!

Unfortunately, this is VERY UNWISE because it leads to a lot more work. And I was sick of my kids not taking a moment to think: what are my options, and what might be the best option available? Also, kids generally found it hard to deal when we started mixing the derivative rules up!

So I came up with a sheet to address this and paired kids to work on it.

(I’ve also had kids think they can do some crazy algebra with $g(x)=\frac{x^2+1}{x+1}$. This sheet also helped me talk with kids individually about that.)

For a little context, my kids have only learned the power rule, the product rule, the quotient rule, and that the derivative of $e^x$ is $e^x$. They have not yet been formally exposed to the chain rule.

[.pdf, .doc]

# Believe it or not… a log question which was briefly stumping us

Hi all,

A teacher approached me with the following question.

The function $\ln(x^{-2})$ has a graph that looks like:

It makes sense that the function exists for all negative x values, because when you raise a negative number to the -2 power, you’re going to get a positive number. And you can take the natural log of a positive number.

Then the teacher said to consider the following function: $-2 \ln(x)$, and the graph looks like:

Notice that you can’t input negative x values, because the domain of natural log doesn’t allow for it.

Here’s the question.

According to the log rules/properties, we know that:

$\ln(a^b)=b\ln(a)$ (obviously).

So $\ln(x^{-2})=-2\ln(x)$. But the graphs are different.

We went a little crazy trying to figure out what’s going on… For about 3 minutes, we were having a great conversation. But we quickly converged on the little text that accompanies the log rules in any textbook… and this text says that these rules work but are only valid for $a>0$.

I kinda love this as an in-class exercise (I’ll probably forget this when I get to logarithms, but maybe posting it here will prevent me from forgetting it). Because it will force kids to (a) be confuzzled, (b) talk through ideas, (c) go back to the definition and qualifications for the log rules, and (d) see that these rules are indeed valid (we didn’t break math), but they are a bit more restrictive that we might have thought.

What I love is that $\ln(x^{-2})=-2\ln(x)$ isn’t actually an identity. But we are so used to using the rules blindly, robotically, that we never think about it. But for it to be a good mathematical statement, you need to qualify it! You need to say this is only an equivalence for $x>0$. This was a good reminder for us.

# My Favorite Test Question of All Time

In Calculus, we just finished our limits unit. I gave a test. It had a great question on it, inspired by Bowman and his limit activity.

Which reads: “Scratch off the missing data. With the new information, now answer the question: What do you think the limit as x approaches 2 of the function is (and say “d.n.e.” if it does not exist)? Explain why (talk about what a limit is!).

So then they get this…

This is what I predicted. (And this was conjecture.) Almost all my kids are going to get part (a) right. I’ve done them well by that. However, with part (b), there are going to be two types of thinkers…

one kind of thinker, where they think “Mr. Shah wouldn’t give us this scratch off and this new data if the answer doesn’t change. So it has to change. What can it be? Clearly it has to be 2.5, because that’s the new information given to us. So I’m going to put 2.5 for the answer and then come up with some way to explain it, like saying since the function has a height of 2.5 when $x$ is 2, clearly it means the limit is 2.5.” (WRONG.)

the other kind of thinker, who will get the problem right and for the right reasons.

What’s the difference between the two kinds of thinkers? My guess: confidence. More than anything, this is a question that really gets at how confident kids are with the knowledge they have. You have to be pretty sure of yourself to come up with the right response, methinks.

My conjecture was pretty spot on. Let me tell you the responses are fascinating. So far my conjecture seems to be holding water. And it’s just the most intriguing thing to read the responses from students who got it wrong. The phrase that springs to mind is cognitive dissonance. There are a number of kids who are saying two totally contradictory things in their explanation, even from sentence to sentence, but they don’t recognize the contradiction. They’ll say “a limit is what y is approaching as x is approaching a number, and doesn’t have anything to do with the value of the function at the point” and then in the next sentence say “since the value of the function at x=2 is 2.5, we know the limit of the function as x approaches 2 must be 2.5.”

It’s a great question… my favorite test question of all time I think… but I wonder if that’s because of the scratch off.

I know we don’t tend to share student work often on blogs, but I asked and my kids were okay with me anonymously sharing their responses.

I don’t know exactly why I wanted to post student work. I don’t have anything specific I wanted to get out of it right now. But I know I was fascinated by it, and I figured y’all would be too.

But for me, it’d be interesting at the most basic level to just see the different ways our kids respond to questions in other classes… Even regular, basic non-writing problems! Just to see if anyone has ways to get kids to organize their work? Or if we could find a way to examine one student response to a question and throw around ideas about how to best proceed with the kid? Or talk about how we actually write feedback and what kind of feedback we give (and why)? Just a thought… Not for now, but something to mull over…

# When you get too lost in the algebra…

I was hunting for a book on my bookshelves when I got distracted and started browsing. In one book, I came across this great idea that I didn’t want to lose. So I thought I’d type it here in an attempt to remember.

One of the hard things about working with derivatives, for me, is that I can easily get caught up in the wonderful (to me, annoying to my kids) algebra. We have the chain rule, the product rule, the quotient rule, and strange and funky derivatives like the derivatives of the inverse trig functions. And I admit it. I love going overboard with these sorts of questions. There’s something really cool about being able to have an answer to a problem take up the length of a page. It looks cool, darnit! And when we get to this point in the curriculum, I often lose sight of the meaning of the derivative. The process takes precedence. And for weeks, we’re swimming (drowning?) in a sea of equations.

When I get to that point, I hope to remember to give my kids this problem:

Find the derivative of $\log(\log(\sin(x)))$. I’m confident that by the time I’m done with them, my kids will get $\frac{\cos(x)}{\sin(x)\log(\sin(x))}$.

But then I have to ask them to sketch a graph of $\log(\log(\sin(x)))$.

This great setup is on pages 64 and 65 of Ian Stewart’s Concepts of Modern Mathematics. He continues, describing what happened when he gave this problem to his class:

This caused great consternation, because it revealed that the formula didn’t make any sense. For any value of $x$, $\sin(x)$ is at most equal to 1, so $\log(\sin(x)) \leq 0$. Since logarithms of negative numbers cannot be defined, the value $\log(\log(\sin(x)))$ does not exist; the formula is a fraud.

On the other hand, the ‘derivative’ … does make sense for certain values of $x$

Some people might enjoy living in a world where one can take a function which does not exist, differentiate it, and end up with one that does exist. I am not one of them.

There’s a great moral here, about remembering that taking the derivative of a function means something. Yes, you can talk about composition of functions and domains and ranges and all that stuff, but that’s not the enduring understanding I would pull from this. It is: divorcing calculus from meaning and focusing on routine procedures is a dangerous road to travel — so one must always be vigilant.

It actually reminds me of one of my most favorite calculus problems, which to solve it needs one to stop focusing on procedure and start thinking. I would never give this to my calculus kids, but for the very high achieving AP Calculus BC kid, this might throw them for a loop (in a good way):

$\int_{0}^{\pi/2} \frac{dx}{1+(\tan x)^{\sqrt{2}}}$

I first saw this problem in Loren C. Larson’s Problem-Solving Through Problems (pages 32-33). I don’t quite want to share the solution in case you want to try it yourself. After the jump, I’ll throw down the answer (but not solution) so you can see if you got it right.

# The Problem That Never Fails

Hi.   I’m Anand Thakker, a teacher at the Park School of Baltimore.  Sam has been generous enough to invite me to make a guest post here, in honor of the new math teaching blog my colleagues and I are starting.   We’re psyched to be joining the conversation.

So, having dispensed with that bit of shameless self-promotion, I thought I’d share with you the problem that never fails.  This is the problem I used for my sample lesson when interviewing for jobs four years ago.  It’s the one I almost always use on the first day of class, and it’s also what I give to parents on back to school night.  Because… well… it. never. fails.  Seriously.

The perfect, ineffable jewel of a problem to which I refer is the classic Bridges of Konigsberg problem.   Here’s the story, in case you don’t know it:

(image from wikipedia)

As shown in the image above, the town of Konigsberg once had seven bridges.  Back before some of these bridges were bombed during WWII, the residents of the town had a long-standing challenge: to walk through the town in such a way that you crossed each bridge exactly once—i.e., without missing any bridges, and without crossing any of them twice.

So, why is this problem so great for a high school classroom?  Well, first of all, whenever I tell this rather contrived tale to my students (or their parents, for that matter), they are inevitably scribbling on their scrap paper before I can even finish.  It’s a compelling puzzle, simple as that.

Before long, students have redrawn the thing enough times that they’re annoyed with all the extra time it takes to draw all the landmasses and bridges, and so they simplify it:

(image from wikipedia)

Voila: in a completely natural fashion, they have reduced the problem just like Euler did.  At this point, I usually bring them together for a moment to appreciate what’s going on here: reducing a problem to its essential components, finding the simplest way to represent the underlying structure of the situation.  (And I also mention to them that this is precisely the move that Euler made when he invented graph theory based on this initial problem.)  Even if they never went any further, this is already a nice lesson in problem solving.

[SPOILER ALERT: notes on the solution below the fold]

# Reports from the Front

So I’ve comfortably slid into the new year. I can’t say the transition has been all laughter and involves me skipping and trololo-ing. There’s an energy drain that comes when you have to be “on” all the time — and it’s no truer than at the start of the year. If you’re me, you’re on hyperdrive, being very purposeful in what you do and say, because you know that this is when you’re building your reputation with your class. (Just as kids are building their reputation with me, by what they do and say.) And that is the most important thing for me at the start of the year. I want them to see what I value, but enacting it.

Yesterday I had one of my favorite teaching moments. One of my students, who I happened to have taught in a previous year also, said when she arrived to class: “When I realized I had to leave for class I started singing I’m off to see the wizard, the wonderful wizard of Shah.” I heart my kids so much, because… well, I just do. They’re awesome. I promise if they come to me saying they don’t have a brain (“I am just not a math person”) that I will give them a brain (because isn’t that what wizards do?). I will also give them courage (pronounced coo-raj like the french) and confidence. At least I will try.

Our school mascot is the Pelican (ferocious! fierce! or not…) and I want to feel like this at the end of the year:

Honestly, I feel like I’ve been doing a pretty good job in some areas and a crusty job in others.

Rational Functions in Calculus

Example of a crusty job: In calculus I am teaching rational functions to prepare us for limits. I am really focusing on getting kids to understand why. In particular, I’ve been working on getting ‘em to understand what a hole truly means, and what a horizontal asymptote means (and no, it is NOT a line a function gets closer and closer to but never touches) and why they might arise. The problem is that this sort of work is hard and takes time and my approach just wasn’t super effective. It was too me-centered, and I didn’t design a way for them to grapple and discover… instead I just kinda gave and explained, in the guise of student questioning.

Still I did get one amazing question which I have to type here so I can use this to provoke discussion and investigation in a class next year…

Why is it that holes appear at the x-value that makes the numerator and denominator of a rational function equal 0, but vertical asymptotes appear at the x-value that makes the numerator non-zero but the denominator 0?

And then to muck them up, after we come to some sort of understanding, I will ask a follow up question:

Graph $f(x)=\frac{x}{x^2}$. At $x=0$, you have $f(0)=\frac{0}{0}$. You’d expect that to be a hole, but … SHOCK! GASP! EGADS! … ’tis not. Explain.

(This came up in one of my classes, and it was precisely at that moment I realized how deep and complicated rational functions are, and how they are just blind algorithms to my kids. I hate that students use procedures and rules to memorize how to find x-intercepts, holes, horizontal asymptotes, etc… but that’s how we teach ‘em so I shouldn’t expect any differently.)

I wonder if I asked students in AP Calculus BC to explain why $f(x)=\frac{x^2-1}{x-1}$ has a hole at $x=1$, could they give a comprehensive answer that doesn’t rely on the fact that “a factor cancels from the top and bottom”? I’d bet not. That makes me sad. I don’t want to be sad.

This is good stuff. I could have introduced it and had my kids muck around with it in a more meaningful way.

The other hard thing that I’m finding, as I really really highlight why, is how much longer things take. I’m okay with it, because I’m not teaching to an AP exam. But it’s a change I have to get used to and honor, but that’s not going to be easy for me.

I have a couple great concept questions on tomorrow’s calculus assessment, so we’ll see if all our discussions about these things have actually made an impact on student learning.

WHY?

Today in one of my Algebra II classes, I used an exit card. We briefly went over why — when working with inequalities — you “flip the direction of the sign” when you multiply or divide by a negative number. I waited a day or two, and then I put the following on an exit slip for them to fill out at the end of class:

I am unsurprised by what I got back. About 1/3 of the kids said “you only switch the direction of the inequality when you divide by a negative number, so matt is wrong.” Almost all of the rest said “when you divide or multiply by a negative number you switch the direction of the inequality.” Only two actually got close to a meaningful solution.

So why am I unsurprised? Because this kind of explanation is new for them. They really haven’t been asked — at least not on a regular basis — to justify their reasoning. It’s a procedure. They “think” they understand it, but when probed, they don’t. Also, more importantly, I’ve realized they have no idea what the word “why” means in math. They think stating the rule is the why. It’s become clear to me in the past year that they don’t know that when I ask them why, I am not asking them for the rule but for the reason for the rule.

The great thing is: this was formative assessment. Without it, I wouldn’t have known that about 1/3 of the kids didn’t even fully know the “rule” for inequalities. And that those kids don’t see that multiplying by -1 is the same as dividing by -1. I also wouldn’t be able to talk specifically with them about what why means in math, and what a comprehensive explanation might look like.

Last year I put concept questions like this one on tests, but that was problematic. Kids usually did poorly on them, and they wouldn’t have a chance to really revise their response because their grade was fixed (I don’t do SBG in Algebra 2). So the feedback loop was stunted: kids saw their score on these kind of problems, they quickly read the comments, and never revisited it.

(I should also say that we did talk about these sorts of concept questions during the lessons too — they weren’t just sprung on them at the time of assessments.)

I’m in debate how to follow this up, after I have my in-class conversation with my kids. Right now I’m leaning towards making a graded take-home “paper” where students answer this question as comprehensively and clearly as they can. And if they want, after I comment on it, they can revise and resubmit. This closes the feedback loop. And I figure if I do this a few times early in the year, I’ll get dividends later on.

Emails!

I always have my kids fill out an online google docs survey at the start of the year. It has logistics (e.g. do they have the book yet? what’s their graphing calculator’s serial number?), but it also asks them some questions about their thoughts on math, their hopes and fears, anything else they’d like me to know, whatever. It’s really useful because you get, with a few questions, exactly the things you need to know in order to start getting to know your kids as math learners (and as people, yadda yadda, blah blah).

In previous years I wrote special emails only to students who said things in their survey that I thought needed a response. Like a student sounding especially nervous about class, or who has a learning difference and wants me to know what sort of things work well for them. However, this year I decided to respond to all surveys. I have already done all my calculus students, and I hope this weekend to get my Algebra II students done too. It takes a surprisingly long time to do it, but I enjoy it. And I hope this is one of those small things that I do that shows these kids, who barely know me, that I care about them and that I’m going to be listening to what they say.

Integrity

Tomorrow is the first calculus assessment. It’s only a 20 minute thing (I’ll let ‘em have 30 minutes though…). Beforehand, I’m going to talk with ‘em about integrity. I tend to overplan things, but I want this to be a more spontaneous discussion that revolves around the ideas of respect and trust. So in opposition to my own inclinations to overthink this, I’m going to wing it in the hopes that it will be more powerful that way. Then I’m going to start ‘em on the test, and leave the room for about 10 minutes. (I won’t be far, because we’ve been having lots of firedrills.)

And yes, like last year, I’m going to continue to have my kids sign these integrity statements. (And I even have another teacher doing it also!)

It’s not that I think it will stop cheating. But I do think that talking and reminding them about it semi-frequently, they at least know that integrity means a lot to me.

With that, I’m done. I’ve almost finished our first full 5-day week of school. Huzzah!

# Make it Better: Drawing with GeoGebra

Hello! Though Sam may refer to me as Kiki, don’t be fooled. My name is Bowman and I’m an American dude teaching MATH at a 9-12 co-ed boarding school in Amman, Jordan. I teach mostly Jordanian kids, though we teach an American-style curriculum in English, with sort of international school type outlook. For the past two years I have taught Physics, then last year I picked up Calculus, and next year I’m dropping the Physics to pick up AP Calculus AB. All of my friends can’t really understand why I’m so pumped about this because they think I’m the only person in the world that gets giddy about Calculus. False.

I love the math blogging community and am excited to be delving into it. Though I already have an “I-don’t-live-in-America” type blog about my time in Jordan, I have relied heavily on edublogs to develop as a teacher and I’m looking forward to repaying my debt. And probably like you, Sam’s blog is my fave, so I’m honored that he would give me some airtime. If you ever get a chance to meet him in person, consider yourself lucky. Since the thing that first drew me here was the wealth of practical lesson planning ideas in his Virtual Filing Cabinet (which I check pretty consistently before I plan a unit), I thought I’d begin repaying my debt by sharing some of the creative ideas I have used to present specific material this past year. Acknowledging my youth and paucity of teaching experience, I’m going to title these posts “Make It Better” to indicate that while I think these ideas have a lot of potential, I’m looking for ways to improve them. Enough introduction… on to the math!

## Drawing with GeoGebra

For anyone who has not discovered the magic of GeoGebra yet, download it right now and then spend some time this summer playing around with it. It has a nice mix of geometric and algebraic capabilities, with fancy looking sliders and animations to help students visualize or experiment with mathematical concepts. These can be used in front of the class or on individual students’ computers. I ended up using it so much throughout the year in student directed learning that when we did end-of-the-year individualized projects, a majority of my students pulled out GeoGebra on their own to graph something or fit a model to some data. Sweet.

One of my favorite GeoGebra exploits this year was a “drawing” project, where students converted an actual picture into a mathematical picture by fitting functions around the outlines and then using integrals to shade in the area between. For example, they could a picture of a guitar and turn it into a sexy mathematical image, like this:

# >>>   Basic steps (more detailed procedure below):

1. Upload a picture into GeoGebra and scale the axes to the right scale.
2. Place points around all the outlines making sure to hit critical points
3. Fit functions to the outlines.
4. Use integrals to shade in the areas between the outlines. The basic syntax looks like this…
which means the integral between the [top function f, and the bottom function g, from x=1, to x=4].
So I conceptualized this project as a low-key but conceptually rich thing to do during the craziness of APs, and as something that the kids who were going to miss many days of class could do on their own. But it turned out to have some other really cool benefits too. Here are some things I really liked about it…
• The hardest part about integrals is setting them up and that’s all students practiced in this project. They did absolutely no calculation. (In the age of Wolfram Alpha and TI’s could that be sooomewhat a thing of the past?)
• The visual nature of the project gave immediate feedback to wrong inputs. If a student chose the wrong endpoints or the wrong functions, the wrong integral that they typed in would show up. They could see what was wrong about it to hopefully figure out how to correct their input, and correct their misconception. The tinkering aspect was maybe my favorite part because they often don’t understand that just by trying something to solve a math problem,  it can point you in the right direction to solve the problem even if it’s “wrong.”
• It unearthed deep misconceptions about integration. Some students were conceptualizing integration diagonally, some would choose endpoints at completely wrong spots and some couldn’t conceptualize what areas they were trying to “color in” in the first place. I had lots of great conversations to address misconceptions that were at the same time a bit scary because we had already been integrating for a few weeks by that point.
• Everybody’s problem was different. Each student was forced to visualize what he or she needed to do and had to attack a rather large problem by breaking it up into much smaller pieces.
• The whole thing was kinda fun. Sometimes I pretend I’m above this, but each student chose a picture they were interested in and then we hung them up in the classroom at the end. And you can color the integrals whatever color you want. Pretty!
Here are some things that I didn’t like about it…
• Some students totally copped out and chose really easy picture. I wasn’t very clear with my expectations (well, I actually didn’t know what to expect) and as a result a few students chose dumb things. One student did a watermelon… uncut…. like, a whole green watermelon. Or other students didn’t know what would be a “good” picture and chose something that ended up being way too hard, or uninteresting.
• The function fitting part was a bit ridiculous. You can go really high with the degrees of the polynomials for the function fitting so people would just put points along a really curvy surface and then pick a 73rd degree polynomial that nicely fit the whole thing. I don’t know if this is actually bad, but it felt weird to me.
• The problem was slightly meaningless. I had them add up the integrals at the end to find the total area, but this was a bit meaningless unless they had chose a flat object.

I can picture something like this being done for lower levels too. The concepts that come to mind immediately to me are piecewise functions and transformations. Instead of having them fit functions to points, you could give them a basic set of functions and force them to manipulate them with various transformations to fit outlines (and then ignore the coloring in part). There are easy ways to limit the domains of functions in GeoGebra. Below are GeoGebra instructions for the various steps and waaaay below are some more examples of student work.

But first, the whole point of this post…
Make it Better.
What do you think? What would you do differently? Do you think this holds educational value even though the problem is contrived? How could I make this more meaningful (i.e. make the result, the integral, not just the picture, actually hold value itself)? Should I give them a set of predetermined images for them to choose from to avoid “bad” choices? How else could I avoid “bad” choices? With what other material could something like this work? Would you use this in your classroom?

from @bowmanimal

The procedural instructions for the various tasks:

Examples of student work (I had to include the watermelon because I mentioned it):

# Disp “Riemann Sums” — Programming the TI-83/84

I just finished teaching Riemann Sums, using the patented Shah Technique. I’ve always had my kids enter a program in their calculator which automatically does Left Handed and Right Handed Riemann Sums (actually it also can do midpoint!). And last year we used this program to estimate how the number of rectangles was related to the error to the true area. (That came out of me just playing around.)

The program we enter is here:

(If you want to use this, this is what you need to know. If you want the Riemann Sum of 20 left handed rectangles of $y=\sqrt{x}$ from [2, 14], you enter A=2, B=14, N=20, and R=0. If you want right handed rectangles, you enter R=1.)

This year I decided to not go into the whole error thing like I did last year. This year I wanted students to really and more fully understand how the program worked. I always explained it, but I never really was convinced that they got it. Me up there lecturing how the program worked wasn’t really effective. So I whipped up this worksheet.

I tried to do less talking and them do more thinking (in pairs). I felt like there were a number of students who had this “OMG!” and “this is crazy” moments. Some were awed that the program worked and it gave them the answers we had been calculating by hand. Some had this amazing moment when they figured out what the variable S stood for — and how it actually calculated the Riemann Sum. And my favorite was when a couple students figured out how the R variable worked — and why R=0 gave left handed rectangles, and R=1 gave right handed rectangles.

I really enjoyed this. I think the worksheet could be tweaked to be clearer, but it’s something I see myself doing again. Well, I guess I will be doing it again tomorrow with the other calculus class. But I mean: next year.

# Part II of a self-inflicted challenge: The Line of Best Fit

Over a month ago, I challenged myself to explain where the line of best fit comes from — conceptually. I started ended Part I with a question:

Our key question is now:

How are we going to be able to choose one line, out of all the possible lines I could draw, that seems like it fits the data well? (One line to rule them all…)

Another way to think of this question: is there a way to measure the “closeness” of the data to the line, so we can decide if Line A or Line B is a better fit for the data? And more importantly, is there an even better line (besides Line A or Line B) that fits the data?

And now, back to our show.

So right now we’re concerned with a measure of closeness. Can we come up with a measurement, a number, which represents how close the data is to a line? And the easy answer is: yes.

The difficulty is that we can come up with a lot of different measurements.

Measurement 1: Shortest Distance

We could measure the shortest distance from each point to the line and add all those distances up.

If I add the distance of all the dashed lines together, I get $\approx 2.23+0.74+0.37+2.41+1.67=7.42$.

Now let’s try a different line (but with the same points).

If I add the distance of all the dashed lines together, I get $\approx 3.54+0.71+1.41+4.95+6.36=16.97$.

It’s obvious that the smaller the total sum of those distances is, the “better” the line is to our data. I mean, if we had a bunch of data that fit perfectly on a line, then the sum of all those distances would be 0. And clearly with our two examples, the second line is a HORRIBLE line of best fit, while the first one seems fairly okay (but not great).

So we could use the sum of the perpendicular segments as our measurement. To find the line of best fit, we would say that we have to try out ALL possible lines (there are like, what, infinity of them? hey, you have study hall…) and find the one with the lowest sum. [1]

But, DUM DUM DUM… there are OTHER measurements you could make.

Measurement 2: Horizontal Distance

We could measure the horizontal distance from each point to the line…

If I add the distance of all the solid lines together, I get $6+2+1+6.5+4.5=23$.

And for a different scenario:

If I add the distance of all the solid lines together, I get $5+2+1+7+9=24$.

So if we define “closeness” to be horizontal distance (instead of the closest distance) between a point and a line, the we have a different measurement.

And yet another…

Measurement 3: Vertical Distance

We could measure the vertical distance from each point to the line…

If I add the distance of all the solid lines together, I get $2.4+0.8+0.4+2.6+1.8=8$.

And for a different scenario:

If I add the distance of all the solid lines together, I get $5+1+2+7+9=24$.

So if we define “closeness” to be vertical distance (instead of the closest distance or the horizontal distance) between a point and a line, the we have a different measurement.

And, in fact, we will see soon (probably in Part III) that there are actually two more measurements we can use.

So which measurement is the best?

You might say: soooo, sir, we have a ton of different measurements. Which one is the right one? The short answer: all of them. Why not? I mean, we wanted to have a measure which tells us how “good” or “bad” a line is when fitting the data, and we have done just that!

It is unsatisfying, but this is how mathematics is. We now have 3 different answers (and there can be more). Each measurement has benefits and drawbacks.

• The benefit of the first measurement is that we are using the closest distance — and that feels (yes, I’m using feeling in math) like a really good thing. The downside is that calculating all those distances from the points to the line is exhausting and algebraically hard.
• The benefit of the second measurement is that calculating the distance between a point and the line is relatively easy. The downside is that the horizontal distance doesn’t feel right.
• The benefit of the third measurement is also that calculating the distance between a point at the line is relatively easy. It also is, conceptually, something deep. If the points are data that have been measured, and the line is a theoretical model for the data, then the distance is the “error” or “difference” between the measured value and the theoretical value. We are summing errors and saying that the line which the smallest sum (least total errors) is minimal. The downside is that it feels better than the second measurement, but less good than the first measurement.

But yeah, you’re upset. You wanted there to be inherently one right answer. We — using our brains — have come up with some proposals. Each have merits. We’ll soon see hone in on one type of measurement that we will use, and talk about the merits of it, and why everyone uses it so much so that it has become the standard measurement to find The Line of Best Fit.

For now, relax. We’ve done something great. Say we gave two of your friends the set of points above and had each one hand draw the line of best fit. You can decide which one did a better job just by adding a bunch of little line segments together. In fact, you have three different ways of deciding, and you have a logical justification for each!

[1] Of course, if you’re a super argumentative student, you might ask: “what if there are two, or even more, lines that have the same lowest measurement?” Well, I love that question. It’s a wonderful question. And worth investigating. Just not right here, right now. And yes, believe it or not, we will check all infinity lines soon enough. It’s possible. Math gives us shortcuts.