Food Triad

Have you heard of the “The Incompatible Food Triad” problem? This was first introduced formally here by George Hart (father of the now famous Vi Hart). Here’s the statement, taken straight from his website:

Can you find three foods such that all three do not go together (by any reasonable definition of foods “going together”) but every pair of them does go together?

Hart’s page is full of various suggested solutions, most of which are shot down in one way or another. It’s obviously not a rigorous mathematical question, since much of the success of a solution depends on culturally-defined taste. But it still doesn’t stop us from trying solutions.

pictured above: chocolate and strawberries on a waffle, one suggested pairing. just don’t you dare also add peanut butter!!

Here’s mine. My wife and I sat down to have waffles one weekend and we think we discovered an Incompatible Food Triad: chocolate, strawberries, and peanut butter.

  • Chocolate & strawberries obviously taste good together on a waffle.
  • Chocolate & peanut butter also obviously taste good together on a waffle.
  • Strawberries & peanut butter is okay if you think of it like a peanut butter & jelly sandwich (mash the strawberries!)

But we found that all three did not taste good together on a waffle. A quick web search reveals that people do sometimes eat these three things together, but not on a waffle.Let me make a slightly more rigorous statement of my suggestion then: I claim (chocolate AND waffle), (strawberries AND waffles), and (peanut butter AND waffles) are an incompatible food triad.

Can you see how this is not a very mathematical/scientific question? 🙂

Would you agree with our incompatible food triad? Do you have any other suggested solutions?

Great NCTM problem

Yesterday I presented this problem from NCTM’s facebook page:

Solve for all real values of x:


We’ve had an active discussion about this problem on their facebook page, and you should go check it out and join the conversation yourself. Go ahead and try it if you haven’t already.

Don’t read below until you’ve tried it for yourself.

Okay, here’s the work. Factor everything.


Multiply both sides by the denominator.


Use the zero-product property to find x=5,6,7,8. Now check for extraneous solutions and find that x=5 and x=7 give you \frac{0}{0}\neq 0 and x=6 gives x=\frac{0}{\sqrt{-1}}=\frac{0}{i}=0. This last statement DOES actually hold for x=6 but we exclude it because it’s not in the domain of the original expression.The original expression has domain (-\infty,5)\cup(7,\infty). We could have started by identifying this, and right away we would know not to give any solutions outside this domain. The only solution is x=8.

Does this seem problematic? How can we exclude x=6 as a solution when it (a) satisfies the equation and (b) is a real solution? This is why we had such a lively discussion.

But this equation could be replaced with a simpler equation. Here’s one that raises the same issue:

Solve for all real values of x:


Same question: Is x=-5 a solution? Again, notice that it DOES satisfy the equation and it IS a real solution. So why would we exclude it?

Of course a line is drawn in the sand and many people fall on one side and many fall on the other. It’s my impression that high-school math curriculum/textbooks would exclude x=-5 as a solution.

Here’s the big question: What does it mean to “solve for all real values of x“? Let’s consider the above equation within some other contexts:

Solve over \mathbb{Z}:


Is x=-5 a solution? No, I think we must reject it. If we try to check it, we must evaluate \frac{0}{\sqrt{5}} but this expression is undefined because \sqrt{5}\notin\mathbb{Z}. Here’s another one:

Solve over \mathbb{Z}_5:


Is x=-5 a solution? No. Now when we try to check the solution we get \frac{0}{\sqrt{5}}=\frac{0}{\sqrt{0}}=\frac{0}{0} which is undefined.

The point is that, if we go back to the same question and ask about the solutions of \frac{x+5}{\sqrt{x}}=0 over the reals, and we check the solution x=-5, we must evaluate \frac{0}{\sqrt{-5}} which is undefined in the reals.[1]

So in the original NCTM question, we must exclude x=6 for the same reason. When you test this value, you get \frac{0}{i} on the left side which YOU may think is 0. But this is news to the real numbers. The reals have no idea what \frac{0}{i} evaluates to. It may as well be \frac{0}{\text{moose}}.

There’s a lot more to say here, so perhaps I’ll return to this topic another time. Special thanks to all the other folks on facebook who contributed to the discussion, especially my dad who helped me sort some of this out. Feel free to comment below, even if it means bringing a contrary viewpoint to the table.


[1] This last bit of work, where we fix the equation and change the domain of interest touches on the mathematical concept of algebraic varieties, which I claim to know *nothing* about. If someone comes across this post who can help us out, I’d be grateful! 🙂

Inverse functions and the horizontal line test

I have a small problem with the following language in our Algebra 2 textbook. Do you see my problem?

Horizontal Line Test

If no horizontal line intersects the graph of a function f more than once, then the inverse of f is itself a function.

Here’s the issue: The horizontal line test guarantees that a function is one-to-one. But it does not guarantee that the function is onto. Both are required for a function to be invertible (that is, the function must be bijective).

Example. Consider f:\mathbb{R}\to\mathbb{R} defined f(x)=e^x. This function passes the horizontal line test. Therefore it must have an inverse, right?

Wrong. The mapping given is not invertible, since there are elements of the codomain that are not in the range of f. Instead, consider the function f:\mathbb{R}\to (0,\infty) defined f(x)=e^x. This function is both one-to-one and onto (bijective). Therefore it is invertible, with inverse f^{-1}:(0,\infty)\to\mathbb{R} defined f(x)=\ln{x}.

This might seem like splitting hairs, but I think it’s appropriate to have these conversations with high school students. It’s a matter of precise language, and correct mathematical thinking. I’ve harped on this before, and I’ll harp on it again.

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?


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


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}?”



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!

Irrationals of the form a+b√c

I made the claim in a post last week that the set of irrationals of the form a+b\sqrt{c} is countable. I said that pretty quickly, without justification. I’ve never proved statements like this before, but here I’m going to try.

Theorem. The set of irrationals of the form a+b\sqrt{c}, with a,b \neq 0,c>0\in\mathbb{Q}, is countable.

Proof. Consider the set of irrationals of the form a+b\sqrt{c}, with a,b \neq 0,c >0\in\mathbb{Q}. More formally, define

\mathbb{I}=\left\{a+b\sqrt{c}\in\mathbb{R}: a,b \neq 0,c>0\in\mathbb{Q}\right\}

And also require that c is ‘square free’–that is, we require that neither the numerator or denominator of c contain factors that are perfect squares. So a+b\sqrt{c} is in ‘simplest’ form. We aim to show that \mathbb{I} is countable.

Now, consider the function

\mathbb{I} \overset{f}{\rightarrow} \mathbb{Q}^3



This function is one-to-one since we require c to be in simplest form–that is, the image of any number a+b \sqrt{c} under f is unique. So f is an injection from \mathbb{I} into\mathbb{Q}^3.

We know that \mathbb{Q} is countable. Since a finite Cartesian product of countable sets is countable, \mathbb{Q}^3 must also be countable. And we have constructed a function f which is an injection from \mathbb{I} into \mathbb{Q}^3. So the cardinality of \mathbb{I} must be no greater than the cardinality of \mathbb{Q}^3. Thus \mathbb{I} must also be countable, as desired.

I think I did that right. Any suggestions, math readers?