Desmos Activity: Sieve of Eratosthenes

Here’s a digital activity I made for exploring integers and discovering prime numbers.

One of my favorite ideas to use in class is the Sieve of Eratosthenes. Even if you’re not familiar with the name, there’s a chance you’ve come across it before. It’s the algorithm to find the prime numbers which are left after the multiples of earlier prime numbers have been eliminated. (Given the name of this blog, there’s not much surprise I like this topic.)

Prime numbers are not required in the Oklahoma standards for the classes I’m teaching, but I thought the Sieve would make a good start of the year activity. I’ve shared an activity and worksheet based on this, but that was from a more na├»ve time, when sharing papers and colored highlighters seemed like a good idea.

So I went looking for a digital alternative, and after trying a few different approaches… well, you’ve seen the title of this post. The solution, as it so often is, was Desmos.

This is what I came up with:

Weirdly enough, this is the first activity I’ve created using the Activity Builder and the Computation Layer in Desmos. But over the last few years, I’ve either been in grad school, or teaching where I didn’t have one-to-one devices.

The activity is very similar to the worksheet I shared above. It steps students through identifying prime numbers, crossing out the composite numbers as they go. But instead of literally crossing out the numbers, students type the list of numbers and Desmos takes care of the crossing. Here’s a partially complete step:

There are some limitations here. I’ve only gone to 100, rather than 150 as I did in the original worksheet, because it’s a lot easier to use a square grid in this case. I preferred 150 originally, because it means crossing out the multiples of 11 makes a difference. (I did consider using something other than 10 by 10, but the grid is already getting a little cramped at this point.) Also, typing in the lists of the multiples gets tedious. Though, I guess that’s no more so than crossing the numbers out by hand. If anyone from Desmos is reading this: would it be possible to allow tables in the Activity Builder to automatically follow a pattern, as they do in the calculator?

This is the final result:

(Note that this image is taken from this graph rather than the activity itself, but I did use the graph to make the activity.)

If you’re looking for a way to discover prime numbers in class which doesn’t involve a paper grid, hopefully you’ll consider giving this a look.


Linear Regression Intro Activity

Today in Statistics we started discussing linear regression. Before getting into the details of how it works, I wanted to help my students understand what we are trying to use it to achieve. That is, creating a linear equation that models bi-variate data.

To start with, I posted this data in Desmos on my smart board:

There’s nothing special about the data, they were just the numbers I happened to type into Desmos at the time. If I was going to do this again in the future, I think I’d want to source some real-world data to use. But as this activity didn’t have a whole lot of preparation go into it, there wasn’t a whole lot of opportunity to find that data. (That said, if you’d like to use my artificially created data, go for it.)

I had students create their own scatter plots for the data. Once they had done this, I told them to rule a line through the data that they thought summarized and modeled the data as well as possible. I informed them that there is an objective way to determine which equation does the best job of this, so it was now a competition.

Then the moment that revealed to us just how rusty some of their algebra skills are: I had them each find the equation of their line. After they complained that it’s been too long since Algebra 1 (despite most of them seeing this in Algebra 2 or Geometry with me last year), and a quick recap tutorial on slope-intercept form, they were able to find their equations.

Then to compare them, I typed their equations into Desmos so that we could visually compare them. I’m happy to say that most of the equations fit the data reasonably well, at least to the naked eye (which is, of course, all my students had to work with for the activity.) Then, I added one more line: the regression equation created by Desmos itself (in orange.)

One of the lines (the blue dashed one) is actually very close! I also changed all of my students’ equations into regression equations, so we could compare their R2 values. For now, I just told them that this is a measure of how well the model fits the data. In future lessons, I will explain the more formal meaning to them.

To finish our discussion, I had Desmos plot the residuals for the linear regression equation, as well as for some of the students’ equations. I explained that what Desmos was doing was trying to make these residuals as close to zero as possible. Over the next few days, we’ll start to get into the details of how the mechanisms of regression actually work. But for this lesson, I wanted to give students a sense of what regression is about, rather than how it works.