Students use a custom-built Desmos slider activity to visually fit an exponential model to the data, compute its fit in Pyret, and interpret the results. They also discuss the challenges of using a computer to work with the very large or very small numbers that show up when dealing with exponential functions, and the trade-offs Data Scientists have to make.
Lesson Goals |
Students will be able to…
|
Student-facing Lesson Goals |
|
Materials |
|
Preparation |
|
🔗Modeling in Desmos
Overview
Students extend their sampling techniques to exponential relationships, experimenting in Desmos to come up with plausible models.
Launch
Now that you’re familiar with exponential functions, let’s use them to model this Covid data!
-
Open code.pyret.org (CPO), find your saved copy of the Covid Spread Starter File and click "Run".
-
Make a scatter plot showing the change in
positive
Covid cases over time (i.e.day
) forMA-table
. -
With your partner, discuss what you can learn from the scatter plot about the exponential function that will model the data.
Project the questions on the next slide to guide small group discussion.
-
Does your scatter plot show exponential growth or exponential decay?
-
The scatter plot shows exponential growth. The "hockey stick" is pointing up, meaning that positive cases are increasing.
-
Can we make any conclusions about the value of b? Explain.
-
Because we see exponential growth, we know that b must be greater than one.
-
Can we make any conclusions about the value of k?
-
Responses will vary. The horizontal asymptote appears to be at around roughly 90,000 positive cases.
-
Can we make any conclusions about the value of a? Explain.
-
a must be positive, because the curve is consistently above k.
Investigate
Make sure your students have a link to Modeling Covid Spread (Desmos) and you’ve advanced your teacher dashboard of to the fourth slide ("Exponential Model for MA") so that students are looking at the correct screen.
In the next activity, students will use our custom slider activity to find promising exponential models, which they will later fit programmatically in Pyret!
-
Let’s return to the Modeling Covid Spread Desmos file.
-
You should now be on the fourth slide ("Exponential Model for MA").
-
Use it to complete Exponential Models of Covid in Massachusetts.
Crowdsource the various values for each model setting, writing 4-5 examples of each on the board.
-
Look at all the lists of values we came up with for a, b, and k.
-
What do you notice? Are they clustered around a particular value, or completely spread out? Are there any values that are really far from the others?
Synthesize
-
Is an exponential model a good fit for this data?
🔗Modeling in Pyret
Overview
Students take their Desmos-derived model settings back to Pyret, to formalize their understanding. They are also exposed to computational limitations, which arise when dealing with extremely small or extremely large numbers.
Launch
Inside the Daya Bay Antineutrino Detector
Scientists send satellites to far-away planets and reason about the mass of tiny particles, like the neutrinos we see in this image. The numbers involved in these calculations are very big or very small, and can involve hundreds or even thousands of digits.
In math, this isn’t a problem: numbers can be infinitely large or small, and have any number of digits or decimal places! But computers are finite, and some numbers get too big to fit in their memory.
-
So what could computers do, to make math work when numbers have too many digits?
-
Solicit ideas from the class…
Voyager 2 approaching Neptune
Almost every programming language uses approximations of long numbers, in the same way a model approximates real data. If you’ve ever asked a calculator to compute 1 ÷ 3, you’ve probably seen it displayed as 0.333333 instead of 0.. This is an example of the approximation trick at work!
The number "one octillion" is a 28-digit number: one followed by 27 zeros. A computer can just store the one at the front and remember that there are 27 zeroes. That’s 3 digits, rather than 28! Numbers like a "one octillion and four " get approximated as "roughly octillion".
-
Turn to the first section of Limits of Computational Modeling.
-
With your partner, brainstorm some possible benefits and downsides to approximating long numbers.
-
What are some possible benefits to chopping off digits like this?
-
Tornadoes can form very quickly, so it’s more important to get a warning out fast, even if that warning is off by a few minutes or miles.
-
What are some possible downsides?
-
A satellite whose launch angle is off by just 0.0001° will miss Neptune by 5,000 miles!
-
The mass of a neutrino is so small that chopping off the 100th decimal place might mean missing it entirely!
Investigate
Pyret’s function expt
is the function that we use for exponents. It takes in two numbers: the base and the power. expt(10, 2)
, for example will produce 102 .
-
As you know, exponents get big quickly! Try computing a large number like
expt(10, 100)
. -
In the Covid Spread Starter File, use
expt
to calculate three different exponents. -
Be prepared to discuss what you observed.
Pyret has a special kind of Number, called a RoughNum, which chops off digits for faster calculation. But unlike other languages, Pyret wants to put the programmer in control. It will never drop digits unless you tell it to!
-
Use Covid Spread Starter File to complete the second section of Limits of Computational Modeling.
-
Be prepared to discuss what you observed.
-
Why do you think Pyret won’t let us compare two RoughNums?
-
Because it knows that two different Numbers can both round to the same RoughNum, which means comparisons are not reliable!
-
A Number takes up exactly one point on the number line. A RoughNum, on the other hand, takes up a range of points on the number line (in this case, all the ones that are "roughly 3"). That makes precise equality tests impossible!
To turn a number into a RoughNum, we use the approximation symbol ~
. For example, the RoughNum ~3
, is "roughly three." This tells Pyret to round off the calculation, prioritizing speed over accuracy to get a result that is "roughly accurate". Any computations performed on a RoughNum will also produce RoughNums.
-
In Pyret, try multiplying
~2 * 2
. What do you get? -
~4
, or "Roughly four" -
Why did Pyret turn the answer into a RoughNum?
-
Pyret is trying to show us that the result was based on an estimate, and therefore is also an estimate.
Exponential growth and decay can create enormously large and enormously small numbers, which can slow down computation. When we try to fit our exponential models to the data, it could take a VERY long time to compute!
-
In Covid Spread Starter File, find the definition of a function called
exponential
. Why does this definition multiplyx
by~1
? -
Turn to Predicting Exponential Growth. Using the exponential model you selected on Exponential Models of Covid in Massachusetts, fill in the blanks at the top of this page.
-
Remind yourselves why the model in Pyret needs
~1
! What do you think would happen without it? Why?
Synthesize
-
What makes exponential models different from the linear and quadratic models you’ve seen before?
-
They don’t have constant growth like linear models.
-
Unlike quadratic models, they only grow or decay in one direction. The growth rate also changes much more quickly.
-
Is it always okay for Data Scientists to round off their numbers to speed up computation? Why or why not?
-
No! Sometimes approximations put lives at risk and it’s worth taking the time to maximize precision.
Linear regression allows us to find the computationally optimal model, not just a model that "fit really well."
-
Do we know whether or not our exponential model is the best?
-
We don’t know!
-
How do you know?
-
This fitting process was purely about adjusting sliders and seeing if S goes down. It was all trial-and-error, with no guarantee that there’s no better model out there.
🔗Reasoning about Exponential Growth
Overview
Students apply mental math to their models, and discover that it’s very hard to reason about exponential growth.
Launch
Even when epidemiologists came up with exponential models for Covid spread, policymakers who were genuinely worried failed to understand how quickly the virus would spread. Why?
Invite students to share their ideas. Some answers may be political. Steer the conversation back to focusing on the math: Those who took the threat of Covid seriously underestimated how quickly it would spread. Why?
Investigate
Models are helpful because they give us an easy way to make predictions about complex data. Oftentimes, we can just use mental arithmetic to do a quick calculation! So why did mental arithmetic fail for exponential models like ours?
-
Use your model to complete the first section, Estimating with our Model on Predicting Exponential Growth.
-
Be sure to use ONLY mental math: you can look at the graph and model, but don’t use a calculator, Pyret, or anything else that will automatically give you the exact answer!
Have students share their predictions for each of the time-spans in this section.
-
Using your model in Pyret, complete the last section, Fitting Exponential Models in Pyret, on Predicting Exponential Growth.
-
How accurate were your "guesstimates" for your models' predictions after 50 days? (Very accurate? Not accurate at all?)
-
How accurate were your "guesstimates" after 250 days?
-
How accurate were your "guesstimates" after 450 days?
Chances are, your guesses got less accurate as the number of days increased!
Why was it so much harder to guesstimate the farther out we got, when the number of days was always increasing by a fixed amount?
Humans evolved in nature, so our brains evolved to be really good at working with quantities that commonly show up in nature. It’s normal to see groups of 2, 5, or even 10 or 100, and we have a pretty good intuition for comparing group sizes as long as they’re small.
But when numbers grow really, really, really fast…we get lost! Our brains lose track of differences when two numbers get really enormous.
Exponential growth poses a problem for those of us with human brains, because the numbers get so big, so fast that it can be difficult to wrap our heads around it!
This has been proven by some really fascinating studies - We know that the integer number line is made of infinite, equal-sized intervals…but our brains don’t process it that way at all!
Humans' inability to reason about exponential growth may have played a role in the sluggish response of many countries, and the tragic loss of life and decrease in public health that followed.
Synthesize
-
When would you expect mental arithmetic to be an effective strategy for reasoning about the world?
-
With smallish numbers.
-
With constant growth, rather than exponential growth.
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927).
Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.