Finding the Regression Line without Calculus

Last month, my latest professional article, Deriving the Regression Line with Algebra, was published in the April 2017 issue of Mathematics Teacher (Vol. 110, Issue 8, pages 594-598). Although linear regression is commonly taught in high school algebra, the usual derivation of the regression line requires multidimensional calculus. Accordingly, algebra students are typically taught the keystrokes for finding the line of best fit on a graphing calculator with little conceptual understanding of how the line can be found.

In my article, I present an alternative way that talented Algebra II students (or, in principle, Algebra I students) can derive the line of best fit for themselves using only techniques that they already know (in particular, without calculus).

For copyright reasons, I’m not allowed to provide the full text of my article here, though subscribers to Mathematics Teacher should be able to read the article by clicking the above link. (I imagine that my article can also be obtained via inter-library loan from a local library.) That said, I am allowed to share a macro-enabled Microsoft Excel spreadsheet that I wrote that allows students to experimentally discover the line of best fit:

http://www.math.unt.edu/~johnq/ExploringTheLineofBestFit.xlsm

I created this spreadsheet so that students can explore (which is, after all, the first E of the 5-E model) the properties of the line of best fit. In this spreadsheet, students can enter a data set with up to 10 points and then experiment with different slopes and y-intercepts. As they experiment, the spreadsheet keeps track of the current sum of the squares of the residuals as well as the best guess attempted so far. After some experimentation, the spreadsheet can also provide the correct answer so that students can see how close they got to the right answer.

My Favorite One-Liners: Part 90

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

Here’s a typical problem that arises in Algebra II or Precalculus:

Find all solutions of 2 x^4 + 3 x^3 - 7 x^2 - 35 x -75 =0.

There is a formula for solving such quartic equations, but it’s very long and nasty and hence is not typically taught in high school. Instead, the one trick that’s typically taught is the Rational Root Test: if there’s a rational root of the above equation, then (when written in lowest terms) the numerator must be a factor of -10 (the constant term), while the denominator must be a factor of 2 (the leading coefficient). So, using the rational root test, we conclude

Possible rational roots = \displaystyle \frac{\pm 1, \pm 3, \pm 5, \pm 15, \pm 25, \pm 75}{\pm 1, \pm 2}

= \pm 1, \pm 3, \pm 5, \pm 15, \pm 25, \pm 75 \displaystyle \pm \frac{1}{2}, \pm \frac{3}{2}, \pm \frac{5}{2}, \pm \frac{15}{2}, \pm \frac{25}{2}, \pm \frac{75}{2}.

Before blindly using synthetic division to see if any of these actually work, I’ll try to address a few possible misconceptions that students might have. One misconception is that there’s some kind of guarantee that one of these possible rational roots will actually work. Here’s another: students might think that we haven’t made much progress toward finding the solutions… after all, we might have to try synthetic division 24 times before finding a rational root. So, to convince my students that we actually have made real progress toward finding the answer, I’ll tell them:

Yes, 24 is a lot\dots but it’s better than infinity.

 

My Favorite One-Liners: Part 86

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

To get students comfortable with i = \sqrt{-1}, I’ll often work through a quick exercise on the powers of i:

i^1 = i

i^2 = -1

i^3 = -i

i^4 = 1

i^5 = i

Students quickly see that the powers of i are a cycle of length 4, so that i^5 = i \cdot i \cdot i \cdot i \cdot i is the same thing as just i. So I tell my students:

There’s a technical term for this phenomenon: aye-yai-yai-yai-yai.

See also http://mentalfloss.com/article/52790/where-did-phrase-aye-yai-yai-come for more on the etymology of this phrase.

My Favorite One-Liners: Part 85

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

Today’s one-liner is one that I’ll use when I want to discourage students from using a logically correct and laboriously cumbersome method. For example:

Find a polynomial q(x) and a constant r so that x^3 - 6x^2 + 11x + 6 = (x-1)q(x) + r.

Hypothetically, this can be done by long division:

However, this takes a lot of time and space, and there are ample opportunities to make a careless mistake along the way (particularly when subtracting negative numbers). Since there’s an alternative method that could be used (we’re dividing by something of the form x-c or x+c, I’ll tell my students:

Yes, you could use long division. You could also stick thumbtacks in your eyes; I don’t recommend it.

Instead, when possible, I guide students toward the quicker method of synthetic division:

My Favorite One-Liners: Part 82

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

In differential equations, we teach our students that to solve a homogeneous differential equation with constant coefficients, such as

y'''+y''+3y'-5y = 0,

the first step is to construct the characteristic equation

r^3 + r^2 + 3r - 5 = 0

by essentially replacing y' with r, y'' with r^2, and so on. Standard techniques from Algebra II/Precalculus, like the rational root test and synthetic division, are then used to find the roots of this polynomial; in this case, the roots are r=1 and r = -1\pm 2i. Therefore, switching back to the realm of differential equations, the general solution of the differential equation is

y(t) = c_1 e^{t} + c_2 e^{-t} \cos 2t + c_3 e^{-t} \sin 2t.

As t \to \infty, this general solution blows up (unless, by some miracle, c_1 = 0). The last two terms decay to 0, but the first term dominates.

The moral of the story is: if any of the roots have a positive real part, then the solution will blow up to \infty or -\infty. On the other hand, if all of the roots have a negative real part, then the solution will decay to 0 as t \to \infty.

This sets up the following awful math pun, which I first saw in the book Absolute Zero Gravity:

An Aeroflot plan en route to Warsaw ran into heavy turbulence and was in danger of crashing. In desparation, the pilot got on the intercom and asked, “Would everyone with a Polish passport please move to the left side of the aircraft.” The passengers changed seats, and the turbulence ended. Why? The pilot achieved stability by putting all the Poles in the left half-plane.

My Favorite One-Liners: Part 81

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

Here’s a problem that hypothetically could appear in Algebra II or Precalculus:

Find the solutions of x^4 + 2x^3 + 10 x^2 - 6x + 65 = 0.

While there is a formula for solving quartic equations, it’s extremely long and hence is not typically taught to high school students. Instead, the techniques that are typically taught are the Rational Root Test and (sometimes, depending on the textbook) Descartes’ Rule of Signs. The Rational Root Test constructs a list of possible rational roots (in this case \pm 1, \pm 5, \pm 13, \pm 65) to test… usually with synthetic division to accomplish this as quickly as possible.

The only problem is that there’s no guarantee that any of these possible rational roots will actually work. Indeed, for this particular example, none of them work because all of the solutions are complex (1 \pm 2i and 2 \pm 3i). So the Rational Root Test is of no help for this example — and students have to somehow try to find the complex roots.

So here’s the wisecrack that I use. This wisecrack really only works in Texas and other states in which the state legislature has seen the wisdom of allowing anyone to bring a handgun to class:

What do you do if a problem like this appears on the test? [Murmurs and various suggestions]

Shoot the professor. [Nervous laughter]

It’s OK; campus carry is now in effect. [Full-throated laughter.]

 

My Favorite One-Liners: Part 80

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

Today’s awful pun comes courtesy of Math With Bad Drawings. Suppose we need to solve for x in the following equation:

2^{2x+1} = 3^{x}.

Naturally, the first step is taking the logarithm of both sides. But with which base? There are two reasonable options for most handheld scientific calculators: base-10 and base-e. So I’ll tell the class my preference:

I’m organic; I only use natural logs.

 

My Favorite One-Liners: Part 68

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

When discussing the Laws of Logarithms, I’ll make a big deal of the fact that one law converts a multiplication problem into a simpler addition problem, while another law converts exponentiation into a simpler multiplication problem.

After a few practice problems — and about 3 minutes before the end of class — I’ll inform my class that I’m about to tell the world’s worst math joke. Here it is:

After the flood, the ark landed, and Noah and the animals got out. And God said to Noah, “Go forth, be fruitful, and multiply.” So they disembarked.

Some time later, Noah went walking around and saw the two dogs with their baby puppies and the two cats with their baby kittens. However, he also came across two unhappy, frustrated, and disgruntled snakes. The snakes said to Noah, “We’re having some problems here; would you mind knocking down a tree for us?”

Noah says, “OK,” knocks down a tree, and goes off to continue his inspections.

Some time later, Noah returns, and sure enough, the two snakes are surrounding by baby snakes. Noah asked, “What happened?”

The snakes replied, “Well, you see, we’re adders. We need logs to multiply.”

After the laughter and groans subside, I then dismiss my class for the day:

Go forth, and multiply (pointing to the door of the classroom). For most of you, don’t be fruitful yet, but multiply. You’re dismissed.

My Favorite One-Liners: Part 54

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

The complex plane is typically used to visually represent complex numbers. (There’s also the Riemann sphere, but I won’t go into that here.) The complex plane looks just like an ordinary Cartesian plane, except the “x-axis” becomes the real axis and the “y-axis” becomes the imaginary axis. It makes sense that this visualization has two dimensions since there are two independent components of complex numbers. For real numbers, only a one-dimensional visualization is needed: the number line that (hopefully) has been hammered into my students’ brains ever since elementary school.

While I’m on the topic, it’s unfortunate that “complex numbers” are called complex, as this often has the connotation of difficult. However, that’s not why our ancestors chose the word complex was chosen. Even today, there is a second meaning of the word: a group of associated buildings in close proximity to each other is often called an “apartment complex” or an “office complex.” This is the real meaning of “complex numbers,” since the real and imaginary parts are joined to make a new number.

When I teach my students about complex number, I tell the following true story of when my daughter was just a baby, and I was extremely sleep-deprived and extremely desperate for ways to get her to sleep at night.

I tried counting monotonously, moving my finger to the right on a number line with each number:

1, 2, 3, 4, ...

That didn’t work, so I tried counting monotonously again, but this time moving my finger to the left on a number line with each number:

-1, -2, -3, -4, ...

That didn’t work either, so I tried counting monotonously once more, this time moving my finger up the imaginary axis:

i, 2i, 3i, 4i...

For the record, that didn’t work either. But it gave a great story to tell my students.

 

My Favorite One-Liners: Part 49

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them. Today’s post is certainly not a one-liner but instead is my pseudohistory for how the roots of polynomials were found.

When I teach Algebra II or Precalculus (or train my  future high school teachers to teach these subjects), we eventually land on the Rational Root Test and Descartes’ Rule of Signs as an aid for finding the roots of cubic equations or higher. Before I get too deep into this subject, however, I like to give a 10-15 minute pseudohistory about the discovery of how polynomial equations can be solved. Historians of mathematics will certain take issue with some of this “history.” However, the main purpose of the story is not complete accuracy but engaging students with the history of mathematics. I think the story I tell engages students while remaining reasonably accurate… and I always refer students to various resources if they want to get the real history.

To begin, I write down the easiest two equations to solve (in all cases, a \ne 0:

ax + b = 0 \qquad and \qquad ax^2 + bx + c = 0

These are pretty easy to solve, with solutions well known to students:

x = -\displaystyle \frac{b}{a} \qquad and \qquad x = \displaystyle \frac{-b \pm \sqrt{b^2-4ac}}{2a}

In other words, there are formulas that you can just stick in the coefficients and get the answer out without thinking too hard. Sure, there are alternate ways of solving for x that could be easier, like factoring, but the worst-case scenario is just plugging into the formula.

These formulas were known to Babylonian mathematicians around 2000 B.C. (When I teach this in class, I write the date, and all other dates and discoverers, next to the equations for dramatic pedagogical effect.) Though not written in these modern terms, basically every ancient culture on the globe that did mathematics had some version of these formulas: for example, the ancient Egyptians, Greeks, Chinese, and Mayans.

Naturally, this leads to a simple question: is there a formula for the cubic:

ax^3 + bx^2 + cx + d = 0

Is there some formula that we can just plug a, b, c, and d to just get the answer?  The answer is, Yes, there is a formula. But it’s nasty. The formula was not discovered until 1535 A.D., and it was discovered by a man named Tartaglia. During the 1500s, the study of mathematics was less about the dispassionate pursuit of truth and more about exercising machismo. One mathematician would challenge another: “Here’s my cubic equation; I bet you can’t solve it. Nyah-nyah-nyah-nyah-nyah.” Then the second mathematician would solve it and challenge the first: “Here’s my cubic equation; I bet you can’t solve it. Nyah-nyah-nyah-nyah-nyah.” And so on. Well, Tartaglia came up with a formula that would solve every cubic equation. By plugging in a, b, c, and d, you get the answer out.

Tartaglia’s discovery was arguably the first triumph of the European Renaissance. The solution of the cubic was perhaps the first thing known to European mathematicians in the Middle Ages that was unknown to the ancient Greeks.

In 1535, Tartaglia was a relatively unknown mathematician, and so he told a more famous mathematician, Cardano, about his formula. Cardano told Tartaglia, why yes, that is very interesting, and then published the formula under his own name, taking credit without mention of Tartaglia. To this day, the formula is called Cardano’s formula.

So there is a formula. But it would take an entire chalkboard to write down the formula. That’s why we typically don’t make students learn this formula in high school; it’s out there, but it’s simply too complicated to expect students to memorize and use.

This leads to the next natural question: what about quartic equations?

ax^4 + bx^3 + cx^2 + dx + e = 0

The solution of the quartic was discovered less than five years later by an Italian mathematician named Ferrari. Ferrari found out that there is a formula that you can just plug in a, b, c, d, and e, turn the crank, and get the answers out. Writing out this formula would take two chalkboards. So there is a formula, but it’s also very, very complicated.

Of course, Ferrari had some famous descendants in the automotive industry.

So now we move onto my favorite equation, the quintic. (If you don’t understand why it’s my favorite, think about my last name.)

ax^5 + bx^4 + cx^3 + dx^2 + ex + f = 0

After solving the cubic and quartic in rapid succession, surely there should also be a formula for the quintic. So they tried, and they tried, and they tried, and they got nowhere fast. Finally, the problem was solved nearly 300 years later, in 1832 (for the sake telling a good story, I don’t mention Abel) by a French kid named Evariste Galois. Galois showed that there is no formula. That takes some real moxie. There is no formula. No matter how hard you try, you will not find a formula that can work for every quintic. Sure, there are some quintics that can be solved, like x^5 = 0. But there is no formula that will work for every single quintic.

Galois made this discovery when he was 19 years old… in other words, approximately the same age as my students. In fact, we know when wrote down his discovery, because it happened the night before he died. You see, he was living in France in 1832. What was going on in France in 1832? I ask my class, have they seen Les Miserables?

France was torn upside-down in 1832 in the aftermath of the French Revolution, and young Galois got into a heated argument with someone over politics; Galois was a republican, while the other guy was a royalist. More importantly, both men were competing for the hand of the same young woman. So they decided to settle their differences like honorable Frenchmen, with a duel. So Galois wrote up his mathematical notes one night, and the next day, he fought the duel, he lost the duel, and he died.

Thus giving complete and total proof that tremendous mathematical genius does not prevent somebody from being a complete idiot.

For the present, there are formulas for cubic and quartic equations, but they’re long and impractical. And for quintic equations and higher, there is no formula. So that’s why we teach these indirect methods like the Rational Root Test and Descartes’ Rule of Signs, as they give tools to use to guess at the roots of higher-order polynomials without using something like the quadratic formula.

green lineReal references:

http://mathworld.wolfram.com/QuadraticEquation.html

http://mathworld.wolfram.com/CubicFormula.html

http://mathworld.wolfram.com/QuarticEquation.html

http://mathworld.wolfram.com/AbelsImpossibilityTheorem.html

http://mathworld.wolfram.com/QuinticEquation.html

http://library.wolfram.com/examples/quintic/

http://library.wolfram.com/examples/quintic/timeline.html