In this online functions course I have been teaching, and which is nearly halfway complete, a question has been kicking around in various forms. *What do we need functions for?*

There are many versions of this question. What do we need functions for (in middle school math)? What do we need functions for (in solving visual patterns tasks)? Et cetera.

One permutation of this question comes from the blogosphere’s own Michael Pershan. What do we need functions for (in mathematics more broadly)?

Here was my response to that question in class this morning. I do not consider this to be the definitive answer to it. Instead, it is an example. One of many, no doubt.

Apologies for the imperfect typesetting on the mathematics below. It’s good enough to get the point across and I don’t have time to look up all the relevant TEX commands to get it looking just right.

—

You know what blew my mind about functions on returning to higher math in graduate school? That we can make functions work for us—tirelessly like robots. My introduction to the idea that we can create functions that we can program to make something useful happen was the *characteristic function*. I am going to assume most of you have not taken graduate Real Analysis, so let me explain quickly.

The characteristic function of a set is defined to have the value 1 when the input is in the set, and to have the value 0 otherwise. Formally, that looks like this (*UPDATE: apologies for broken math text*):

That capital Xish thing is the Greek letter “Chi”. Here is the graph of .

So what, right? Well, the characteristic function links sets with functions. We can begin to talk about the *size of a set* based on the results of operations on the set’s characteristic function.

One question that mathematicians have been interested in dealing with over the years is *how big is the set of rational numbers?* By using the characteristic function , we can rephrase that question in terms of functions. Without giving away the first three weeks of graduate analysis, you can imagine the graph of this function as being a whole bunch of points on the x-axis and a whole bunch of points at y=1. Indeed, there are so many of each that you can’t *see* that the function is a function. It looks like two functions (Note; I have cheated and just plotted y=1 and y=0 below—I do not believe Desmos can work with the condition that x must be rational).

The question about the characteristic function on the rational numbers that corresponds to asking *How big is the set of rational numbers?* is this: *What is the value of the integral of the characteristic function? *That is, we ask what is the value of the following expression?

Geometrically, we are asking how much area is shaded below (given that the points at y=1 correspond ONLY to the rational values of x in the interval 0≤x≤1).

The standard definition of integrals (the Riemann integral) cannot answer this question. One way of computing gives 0, another way gives 1, so we have to say that the integral *does not exist*. This function is not integrable in standard calculus.

So we invent the Lebesgue integral, which is defined in terms of sets rather than areas of rectangles. And we learn that the value of this integral is zero.

That is, the set of rational numbers is so small that we can say—relative to the size of the set of real numbers—that there are essentially none of them. The rational numbers are so few that we say the size of the *measure* of the set is zero.

They are infinite yet insignificant.

The machinery to prove all of that is the characteristic function.

That’s one thing that functions are good for.

Dig.

Having had a typical, algorithmically myopic American math education, I too was blown away when I came back to math later in life. During the review process, I had a series of remarkable Russian professors who just could not even comprehend doing mathematics without a deep immersion in functions and in functional thinking. And I tell you, it changed me. It changed my relationship to mathematics and it changed the way I think about teaching mathematics. And it also has changed the way my students respond to my teaching. All together, it has been well worth the price of admission!

– Elizabeth (aka @cheesemonkeysf)

Elizabeth, will you tell us more? I hate the way functions are presented in textbooks. Find the domain and range. Blah.

And Christopher, I’d like to hear more about what questions you consider in this course.

Ohh, I just thought of something. In my pre-calculus we’ll be starting logarithms today. I skipped the whole functions chapter, and will be going back to the section there on inverse functions. Maybe before I even mention the book, I’ll start with the function machine game, and once they’ve got it, we can turn it backwards. I can do output is input squared, and then they can figure out that there’s a problem going backwards with this one. Much nicer than “the vertical line test”.