CHAPTER 1
WAKE UP AND SMELL THE FUNCTIONS
IT’S FRIDAY MORNING. The alarm clock next to me reads 6:55 a.m. In five minutes it’ll wake me up, and I’ll awake refreshed after sleeping roughly 7.5 hours. Echoing the followers of the ancient mathematician Pythagoras—whose dictum was “All is number”—I deliberately chose to sleep for 7.5 hours. But truth be told, I didn’t have much of a choice. It turns out that a handful of numbers, including 7.5, rule over our lives every day. Allow me to explain.
A long time ago at a university far, far away I was walking up the stairs of my college dorm to my room. I lived on the second floor at the time, just down the hall from my friend Eric Johnson’s room. EJ and I were in freshman physics together, and I often stopped by his room to discuss the class. This time, however, he wasn’t there. I thought nothing of it and kept walking down the narrow hallway toward my room. Out of nowhere EJ appeared, holding a yellow Post-it note in his hand. “These numbers will change your life,” he said in a stern voice as he handed me the note. Off in the corner was a sequence of numbers:
Like Hurley from the Lost television series encountering his mystical sequence of numbers for the first time, my gut told me that these numbers meant something, but I didn’t know what. Not knowing how to respond, I just said, “Huh?”
EJ took the note from me and pointed to the number 1.5. “One and a half hours; then another one and a half makes three,” he said. He explained that the average human sleep cycle is 90 minutes (1.5 hours) long. I started connecting the numbers in the shape of a “W.” They were all a distance of 1.5 from each other—the length of the sleep cycle. This was starting to sound like a good explanation for why some days I’d wake up “feeling like a million bucks,” while other days I was just “out of it” the entire morning. The notion that a simple sequence of numbers could affect me this much was fascinating.
In reality getting exactly 7.5 hours of sleep is very hard to do. What if you manage to sleep for only 7 hours, or 6.5? How awake will you feel then? We could answer these questions if we had the sleep cycle function. Let’s create this based on the available data.
What’s Trig Got to Do with Your Morning?
A typical sleep cycle begins with REM sleep—where dreaming generally occurs—and then progresses into non-REM sleep. Throughout the four stages of non-REM sleep our bodies repair themselves,1 with the last two stages—stages 3 and 4—corresponding to deep sleep. As we emerge from deep sleep we climb back up the stages to REM sleep, with the full cycle lasting on average 1.5 hours. If we plotted the sleep stage S against the hours of sleep t, we’d obtain the diagram in Figure 1.1(a). The shape of this plot provides a clue as to what function we should use to describe the sleep stage. Since the graph repeats roughly every 1.5 hours, let’s approximate it by a trigonometric function.
To find the function, let’s begin by noting that S depends on how many hours t you’ve been sleeping. Mathematically, we say that your sleep stage S is a function of the number of hours t you’ve been asleep,i and write S = f (t). We can now use what we know about sleep cycles to come up with a reasonable formula for f (t).
Since we know that our REM/non-REM stages cycle every 1.5 hours, this tells us that f (t) is a periodic function—a function whose values repeat after an interval of time T called the period—and that the period T = 1.5 hours. Let’s assign the “awake” sleep stage to S = 0, and assign each subsequent stage to the next negative whole number; for example, sleep stage 1 will be assigned to S = −1, and so on. Assuming that t = 0 is when you fell asleep, the trigonometric function that results is ∗1
where π ≈ 3.14.
Before we go off and claim that f (t) is a good mathematical model for our sleep cycle, it needs to pass a few basic tests. First, f (t) should tell us that we’re awake (sleep stage 0) every 1.5 hours. Indeed, f (1.5)= 0 and so on for multiples of 1.5. Next, our model should reproduce the actual sleep cycle in Figure 1.1(a). Figure 1.1(b) shows the graph of f (t), and as we can see it does a good job of capturing not only the awake stages but also the deep sleep times (the troughs).ii
In my case, though I’ve done my best to get exactly 7.5 hours of sleep, chances are I’ve missed the mark by at least a few minutes. If I’m way off I’ll wake up in stage 3 or 4 and feel groggy; so I’d like to know how close to a multiple of 1.5 hours I need to wake up so that I still feel relatively awake.
We can now answer this question with our f (t) function. For example, since stage 1 sleep is still relatively light sleeping, we can ask for all of the t values for which f (t) ≥ −1, or
The quick way to find these intervals is to draw a horizontal line at sleep stage −1 on
Figure 1(b). Then all of the
t-values for which our graph is
above this line will satisfy our inequality. We could use a ruler to obtain good estimates, but we can also find the exact intervals by solving the equation
f (
t) = −1:
∗2 Figure 1.1. (a) A typical sleep cycle.2 (b) Our trigonometric function f (t).
We can see that the endpoints of each interval are 0.25 hour—or 15 minutes—away from a multiple of 1.5. Hence, our model shows that missing the 1.5 hour target by 15 minutes on either side won’t noticeably impact our morning mood.
This analysis assumed that 90 minutes represented the average sleep cycle length, meaning that for some of us the length is closer to 80 minutes, while for others it’s closer to 100. These variations are easy to incorporate into f (t): just change the period T. We could also replace the 15-minute buffer with any other amount of time. These free parameters can be specified for each individual, making our f (t) function very customizable.
I’m barely awake and already mathematics has made it into my day. Not only has it enabled us to solve the mystery of EJ’s multiples of 1.5, but it’s also revealed that we all wake up with a built-in trigonometric function that sets the tone for our morning.
How a Rational Function Defeated Thomas Edison, and Why Induction Powers the World
Like most people I wake up to an alarm, but unlike most people I set two alarms: one on my radio alarm clock plugged into the wall and one on my iPhone. I adopted this two-alarm system back in college when a power outage made me late for a final exam. We all know that our gadgets run on electricity, so the power outage must have interrupted the flow of electricity to my alarm clock at the time. But what is “electricity,” and what causes it to flow?
On a normal day my alarm clock gets its electricity in the form of alternating current (AC). But this wasn’t always the case. In 1882 a well-known inventor—Thomas Edison—established the first electric utility company; it operated using direct current (DC).3 Edison’s business soon expanded, and DC current began to power the world. But in 1891 Edison’s dreams of a DC empire were crushed, not by corporate interests, lobbyists, or environmentalists, but instead by a most unusual suspect: a rational function.
The story of this rational function begins with the French physicist André-Marie Ampère. In 1820 he discovered that two wires carrying electric currents can attract or repel each other, as if they were magnets. The hunt was on to figure out how the forces of electricity and magnetism were related.
The unexpected genius who contributed most to the effort was the English physicist Michael Faraday. Faraday, who had almost no formal education or mathematical training, was able to visualize the interactions between magnets. To everyone else the fact that the “north” pole of one magnet attracted the “south” pole of another—place them close to each other a...