Can you predict whether a passenger would have survived the sinking of the Titanic based on factors like gender and income? How do you know if a mushroom is poisonous or safe to eat? What separates a cancerous cell from a typical one?
Students in Clayton Dagler’s machine-learning class at Franklin High School in Elk Grove, Calif. near Sacramento, Calif., puzzle over such complex problems by pairing a computer-coding language commonly used in artificial intelligence technologies with math concepts. Their assignments mirror how professionals increasingly look to AI to inform everything from disease diagnosis to fraudulent credit charges.
Dagler developed the course after a short conversation with the parent of one of his students, an Apple executive.
This parent told him: “‘Clay, you really need to get students to be able to work with and understand Big Data. Big Data is going to be a big thing for a very long time,’” Dagler recalled.
Dagler and a handful of other teachers around the country are on the leading edge of what may become a new trend in math and computer sciences classes: explicitly making connections for students between often overlooked math concepts—particularly probability and statistics—and AI.
Giving students a peek at the math under the hood of AI can help them understand the potential power and pitfalls of an almost magical-seeming technology, experts and educators say.
And it can bring real-world relevance to math, a challenge school districts across the country are trying to meet at a time when math scores on the National Assessment for Educational Progress are still below pre-pandemic levels.
AI is a good learning partner to use for statistical topics such as regression, a process to determine the impact of different variables, said Pratham Rangwala, a senior in Dagler’s class who took Advanced Placement Statistics earlier in high school.
“Regression fits so neatly into machine learning,” said Pratham, 17. “All of the theory [behind] these models is actually a lot of statistics.”
Though he enjoyed his stats class, Pratham didn’t find it as engaging as Dagler’s machine-learning class.
AP Statistics is “more textbook-oriented,” Pratham said. “It’s more about just solving statistics problems. This is solving real-world problems.”
Learning about artificial intelligence is not just for math geeks
For now, the connection between math and AI is mostly emphasized in high-level classes at well-resourced schools, like the one that supports Dagler’s machine-learning class, a senior level elective course.
Yet, three-quarters of educators who teach math believe that understanding how to use AI to solve math problems is a skill their students will need to succeed in future careers, according to an EdWeek Research Center survey of 411 teachers conducted in February.
Given that concern for helping students succeed in the future, more students—not just high achievers—can and should be given the chance to study how math undergirds AI tools, said Eric Greenwald, a senior researcher at the University of California, Berkeley and a former high school math teacher who studies the connection between AI and math.

“Kids are made to feel that, ‘Oh, I can’t do AI unless I take all these advanced-math courses and study it in college,’” said Greenwald, whose research focuses on teaching probability using AI tools. “The message is that it’s just too hard. It’s too complicated. You have to be a super nerd to do anything with it.’”
But that is not the case, he said.
“There are some core ideas that can help you feel able to understand the tech and to be able to make critical decisions about its use or suggest ways it could be improved,” even if you’re not a math or computer science geek, Greenwald said.
His research has shown that students are better equipped to engage with and understand probability concepts when they apply them to “meaningful problems” that involve technology they use in their daily lives, such as “understanding the recommender system for Spotify,” a digital music service that relies on AI algorithms, he said.
Intentionally focusing on how math informs AI would require schools to place new emphasis on data science and statistics in an education system in which calculus has long been considered the pinnacle of K-12 math courses, some experts argue. Some districts have been working to put those courses on a more equal footing with calculus, but the effort is far from universal.
What’s more, teaching the math concepts that undergird AI would require schools to expose students to topics like probability much earlier than is typical, Greenwald said.
But that would be a good development, he emphasized, because students would likely be more willing to not only engage with and think critically about AI but to “inspire tomorrow and innovate” if they “learned about probability when they were 7 instead of 17,” he said.
“I think there are a lot of things that we save for upper levels, or you’re only allowed if you’ve taken course A, B, C, and D and gotten ‘A’ on each of them,” Greenwald said. “And I think that’s a huge mistake.”
Why it’s important to circle back and review foundational math concepts
Most AI instruction for students is currently focused on training students to use the technology as a brainstorming partner or starting point for a paper—emphasizing how to use it responsibly and not for cheating.
Dagler, though, has a much higher goal in mind for his students. “I want them creating the stuff that we need for the future,” he said.
Dagler, who is certified to teach both computer science and math, requires students to take precalculus before enrolling in his machine-learning class. Many of his students also concurrently take or have previously taken Advanced Placement Statistics. Some, like Pratham, have already tackled calculus.
Still, Dagler will circle back and review statistical concepts such as regression analysis and naive bayes but in the context of vast data sets he shares with the students. Those data sets are centered on topics such as the mileage per gallon certain cars generate, rising housing costs, or detecting spam email.
He also teaches students how to work with the data, for instance, by finding missing values. Students then need to show that they understand the data by explaining in writing what it means.
For the next step, he turns his students loose to collaborate in teams and create their own, similar models using the machine-learning friendly coding language Python. The models must be designed to answer key questions in the data, such as which ads might attract a particular type of consumer, whether a cell is cancerous, and which restaurants have the best burritos.
Typically, students will use a large portion of the data they’re given to create their models and the remaining data to test drive what they developed. If what they create initially isn’t accurate, he’ll ask students to go back and try again.
Dagler knows many of his students probably won’t go on to design AI tools professionally. But he believes that gaining a deeper understanding of how math powers AI will serve them well in almost any career path.

If one of his students becomes a doctor, for instance, they probably wouldn’t get a breakdown of the proprietary algorithm that powers a new diagnostic tool. But the course content would help them grasp why they can’t rely entirely on the diagnostic tool’s conclusions.
“If they have a basic understanding of how these models are created, then they know they need to use it as a tool and not a replacement” for their own judgment, Dagler said.
How to look underneath the hood of AI to see the math connections
Andrew Smith, who teaches computer science at Woodstock High School in Woodstock, Vt., also works to make connections between common math processes and AI systems.
For instance, Smith shows students how AI tools determine whether a message is spam or a potentially important email by examining a long list of characteristics—length of the message, the sender, number of exclamation points. The AI tools can almost immediately plot all those details on a graph and determine whether an email falls into the spam category by looking at its “nearest neighbors” or the values that are closest to it on the graph.
Two important math concepts at play in his lessons are the Pythagorean theorem—a geometry standard explaining how the sides of a triangle relate to one another—and the x/y axis, a basic statistical concept.
In his classes, Smith also demonstrates how probability informs AI by asking his students to use coding to create a Pick-Up Sticks game called “Nim.” Then they play against the computer and watch as it applies probability to get progressively better at picking its next move. Smith explains that process mirrors how chatbots employ probability to generate their recommendations, even as fine-grained as picking which word will come next.
“I think it’s really cool that it’s really basic stuff,” Smith said. “It’s like, there’s eight blue socks in my drawer and two red socks. What are the chances I reach in and pick out a blue sock one day?” (Answer: Four in five.)
AI can “turn the dial up on that math problem a little bit and do it 10,000 times and keep track, and now suddenly you’re like writing sonnets in the style of Edgar Allen Poe,” Smith added, explaining how AI can take that the simple concept of probability and use it to respond to sophisticated tasks.
Smith’s students also use relatively simple math to create their own algorithms—a set of coded instructions for a computer to follow to complete a task.
One assignment asks students to write an algorithm that sorts job applicants by certain characteristics—including level of education, experience, and grade point average. The students then check to see what kind of candidates their algorithm elevates or de-prioritizes—and consider whether they are missing out on a potentially great hire if they follow its instructions.
That real-world example might lead students to realize they’ve inadvertently created a system that, for instance, penalizes candidates with lower grades but strong work experience and that they need to rethink their math to eliminate the problem, Smith said.
Testing their work this way not only points students to AI’s fallibility, it also helps ignite their sense of fairness, which Smith sees as a major engagement tool.

“No offense to all the watermelon salespeople out there, but [the most engaging] math problems are not really rooted in ‘How many watermelons can I buy for $15?’” Smith said.
Rather, combining math with computer science concepts and AI can get students to think: “Who is harmed by this choice that I made to do the math in one way versus doing it in a different way? That activates this sense of justice that I think is underutilized in kids.”
Making the case for AI literacy to be a top priority in K-12 schools
Deciding to teach math concepts alongside machine learning can be difficult to pull off at a time when few teachers understand the technology and math and computer science teachers are already hard to come by.
“I think it’s really about the administration making space for this in the schedule and saying ‘No, OK, we’re not going to pull this guy off and use him ... to teach another section of geometry,” Smith said. “We want to start to dedicate this time toward the AI class.”
Dagler also credits his school’s administration with supporting his course, allowing it to grow from just 17 students the first year it was offered to two sections of 36 this year. He thinks time will show the investment was a savvy one.
“Education is always way behind industry,” Dagler said. “And not just K through 12, by the way. I think colleges are, too. I think it will take time” before schools catch on that math concepts are vital to understanding AI.