Teaching domain and range incorrectly

What’s wrong with these high-school math questions?

  1. State the domain of the function f(x)=\frac{1}{x}.
  2. Where is the function f(x)=\ln(x) undefined?
  3. State the range of the function f(x)=x^2.

As a math teacher, I’ve asked these questions before too. But I always ask them with a bit of a cringe. Do you see what’s wrong with them?

Domain

A function is only well-defined when it is defined with its domain. A function f is an association between two sets A and B that assigns only one element of B to each element of A. The set A is called the domain and the set B is sometimes called the codomain. If  f is a function mapping elements from A into B, then we often write f:A\to B. For instance, consider the function f:\mathbb{R}\to\mathbb{R} defined by

f(x)=e^x

The domain of this function is \mathbb{R}, since that’s how the function is defined. Notice I explicitly gave the domain right before defining the function rule. Technically, this must always be done when defining any function, ever.

We might ask a student, “What is the domain of f(x)=e^x?” But this is a poor question. The function rule isn’t well-defined by itself. There are many possible domains for this function, like the set of integers \mathbb{Z}, the set of positive reals \mathbb{R}^+, or rational numbers between 20 and 30. What a teacher probably means is, “What is the largest possible subset of \mathbb{R} that could be used as the domain of f(x)=e^x?” In this case, the answer is \mathbb{R}.

So I hope you see why question (1) at the beginning of this post is not a very precise question. Likewise, question (2) is not very precise either. “Where is \ln{x} undefined?” has multiple answers. The answer the teacher is looking for is (-\infty,0]. The question would be better worded, “What real values cannot be in the domain of \ln{x}?”

 

Range

What about the range? The codomain in the example f(x)=e^x is also \mathbb{R}. But the range of f is (0,\infty). The range of a function is defined to be the set of all y\in B such that there exists an x\in A with f(x)=y.

But the range depends on the choice of domain. So asking questions like (3), “State the range of the function f(x)=x^2” aren’t well defined for all the same reasons as above. The desired answer is probably [0,\infty). But the domain of f(x)=x^2 could be the integers, in which case the range is the non-negative integers. We’re not told. So in the case of (3), the more precise question would read, “State the range of the function f(x)=x^2 with x\in\mathbb{R}.”

 

Should we change our teaching?

Maybe. But maybe not. I think I’ll still ask the questions in the imprecise way I started this post. Using the more precise questions would be unnecessarily confusing for most students. But we as teachers should be aware of our slightly incorrect usage, and be ready to give a more precise and thoughtful answer to students who ask.

That being said, I think there’s room for more set theory and basic topology at the high school level. I’m a bit sad I didn’t learn the words onto, surjective, one-to-one, injective, bijective, image, and preimage until very late in my post-high-school studies. I’m not sure all students are ready for such language, but we shouldn’t ever shy away from using precise language. That’s part of what makes us mathematicians.

I ❤ precise language!

Physics of Angry Birds

A nice projectile motion application, suitable for almost any level of high school math.

Here’s an excerpt of the Wired.com article by Rhett Allain:

You know the game, I know you know. Angry Birds. I have an attraction to games like this. You can play for just a little bit at a time (like that) and each time you shoot, you could get a slightly different result. Oh, you don’t know Angry Birds? Well, the basic idea is that you launch these birds (which are apparently angry) with a sling shot. The goal is to knock over some pigs. Seriously, that is the game.

But what about the physics? Do the birds have a constant vertical acceleration? Do they have constant horizontal velocity? Let’s find out, shall we? Oh, why would I do this? Why can’t I just play the dumb game and move on. That is not how I roll. I will analyze this, and you can’t stop me.

 

[Hat tip: Tony Sanders]


 

PEMDAS Problems

Inspired by this post at Education Week, by David Ginsburg, and a fruitful discussion in the comments, I thought I’d make my own post about the order of operations. I feel the need to do this because of my own experiences teaching Algebra 1 and correcting the habits of Algebra 2, Precalculus, and Calculus students. The problem is often with their misunderstanding of the ubiquitous “PEMDAS” approach to order of operations (parentheses, exponentiation, multiplication, division, addition, subtraction).

The classic example given by those who have discussed this before is an expression like the following. This example shows the problem with instructing students to simply “add then subtract”:

8-4+1

You can easily see that blindly following PEMDAS would give you an answer of 3, not 5. In reality, addition and subtraction can be done in any order, provided that you think of the expression this way:

8+(-4)+1

I have to constantly reinforce in my students the notion that the “-” goes with the 4. It owns it. That’s the right way to think of it, since subtraction (and division) are just shorthand for addition by the additive inverse (and multiplication by the multiplicative inverse). That’s right kids, subtraction is an illusion. The typical Real Analysis approach is to use the field axioms to define the properties of addition. Here they are:

  1. If x and y are in the field, so is x+y (closure).
  2. x+y=y+x (commutativity)
  3. (x+y)+z=x+(y+z)=x+y+z (associativity)
  4. There exists an element 0 such that 0+x=x for all x (identity)
  5. For each x there is an element called -x such that x+(-x)=0 (inverse)

There are almost identical ones for multiplication, and then one more axiom for distribution. Just listing the field axioms for addition  helps us in the discussion of order of operations. As I said above, subtraction is never really mentioned. We only later define x-y to mean x+(-y).

Similarly, division is an illusion. Or more precisely, it is defined in terms of multiplication. We define x/y to mean x\cdot(1/y).

The other important thing to notice is that addition and multiplication are binary operations, meant to be functions of two variables. So the expression x+y+z is defined to mean (x+y)+z=x+(y+z).

But the problems with PEMDAS don’t stop with multiplication and addition. There are many other issues with the order of operations as well. We lie to students when we just tell them they’ll encounter those limited operations in tidy situations. Here’s a perfectly legitimate expression with which PEMDAS would flounder:

-2^{3^2}+\left|\frac{2\sin{0}+3!}{2-\sqrt{9}}\right|\pmod{3}

The reason the expression is so difficult for PEMDAS is because PEMDAS doesn’t acknowledge the existence of other functions or grouping symbols, and ignores the possibility of nested exponentiation.

As another somewhat related example, I often have Calculus students who evaluate the following expression incorrectly (because they misuse their calculator):

e^{(0.05)(10)}

And some high school students at every level still struggle with evaluating these expressions:

  • -2^2
  • Given f(x)=-x^2+x, evaluate f(-2).

The wikipedia article on Order of Operations is very clear on all this, but I wanted to just highlight some of the common misconceptions. For more, feel free to check out that article. I’m in no way recommending that PEMDAS be removed from math curriculum, but that it be used with great care. And by the way, the expression above evaluates to 1.

 

Geogebra has new skills

A new version of Geogebra has been released, in beta. It’s called Geogebra 5.0, and you can see the news about it here. Or, here’s a direct link to launch it right away. Thanks to The Cheap Researcher for the lead on this. As readers of this blog may already know, I love Geogebra!

One of the main highlights is that Geogebra now supports 3D manipulations. Awesome! However, don’t get too excited–it doesn’t let you graph anything except planes. No surfaces. It will do geometric constructions, like spheres and prisms. Using parametric equations and the locus feature, you can coax it into rendering spirals or other space curves. [edit: I figured this was possible, but it actually wasn’t. Not sure why.]

Another highlight, which I find even more exciting, is that Geogebra now has a built in CAS. Here’s a screen shot of me playing around with a few of its features. It also has a ways to go, especially for those who are used to more robust systems like Mathematica/Maple/Derive/TI-89. But this is a great step in the right direction, and 10 points for the open-source camp!

Notice that it can work with polynomials in ways you would expect, it can symbolically integrate and derive (simple things), perform partial fraction decomposition, evaluate limits, and find roots. Here are a few more things it can do. Strangely, it had problems finding the complex roots of a quadratic (easy), but not a cubic (hard). Just take a look at my screen shot. Seeing that it did okay finding the complex roots, I wondered if it could also plot them for me. I started by entering (copying and pasting) the complex zeros as points in Geogebra, which worked. But then I discovered the new ComplexRoot[] function which approximates the roots and plots them on the coordinate plane all at once. Cool! Here’s the screenshot:

The seven complex roots of f(z)=z^7+5z^4-z^2+z-15

As you can see, I asked for the roots of a 7th degree polynomial. Since the polynomial had real coefficients, notice that every zero’s conjugate is also a zero, as we’d expect. And we also expect that at least one solution of an odd-degreed polynomial will be real (notice this one has only one real root, approximately 1.22).

That’s all I’ve discovered so far. I’ll let you know if I come across anything else exciting. Keep in mind that this is beta, so the final release will likely have all the bugs worked out and more features.

Vi Hart’s Blog

It’s high time I gave a bit of press to Vi Hart’s Blog. If you haven’t checked it out, do so right away. It’s brilliant.  A number of people have pointed me to her blog, including one of my Calc students. Her little math videos are fresh, funny, and insightful. Denise, at Let’s Play Math, gave her some press too, which is what reminded me to finally make this post. Here’s the video Denise highlighted (the most recent of Vi’s creations):

This is particularly appropriate because there were a couple of us in our math department discussing this very question: In total, how many gifts are given during the 12 Days of Christmas song? It’s a nice problem, perfect for a Precalculus student. Or any student. Here’s a super nice explanation of how to calculate this total, posted at squareCircleZ. But before you go clicking that link, take out a piece of scrap paper and a pencil and figure it out yourself!

Here’s another nice video from Vi Hart:

You could spend a lot of time on her site. Here’s another awesome video. I’ll have to have my Precalculus class watch this one when we do our unit on sequences and series.

And you’ve got to love the regular polyhedra made with Smarties ,  right?

Plus, Vi Hart plays StarCraft, which is awesome too.  Back in the day, I really loved playing. I haven’t played in a while, and I certainly haven’t tried SC 2 yet, because then I’d never grade my students’ papers.

Bottom line is, you need to check out all the playful stuff Vi Hart is doing at her blog. Happy Wednesday everyone!

 

Home, Home on the Range

The first week of school I gave this problem and never came back to it:

Find the range of f(x)=2^{x^2-4x+1}.

 

The answer is \left[\frac{1}{8},\infty \right). Here’s why:

First consider the range of the quadratic in the exponent, h(x)=x^2-4x+1.  It’s a parabola that opens up with its vertex at (2,-3). So the range of h(x) is [-3,\infty).

Now, consider the function g(x)=2^x.  If we let the domain of g be the values coming from  the range of h, we have the mapping \left[-3,\infty\right)\to\mathbb{R}. That is, we’re considering the composition f(x)=g(h(x)). Since g is monotonically increasing, for any x_1<x_2, we know g(x_1)<g(x_2). So the range of g in \mathbb{R} is \left[g(-3),\infty\right). So the range of f is \left[\frac{1}{8},\infty \right).

Do you feel “at home on the range”?

Here are a few more for you to try. In each case, find the range of the function. These aren’t meant to be any harder than the original problem, just different. Though watch out for the third one :-).

y=3^{-x^2+4}

y=4^{\sqrt{x}}

y=\ln{(x^2-x+1)}

y=\sin{(x^2+2x+5)}