jedediyah.github.io/nctm2025

Mathematics for Machine Learning and Artifcial Intelligence

Jedediyah Williams, PhD
jedediyah@gmail.com
NCTM Atlanta 2025

Hi!   I'm Jed
  • B.S. Computer Systems Engineering (1st gen!)
  • Taught Algebra, Astronomy and Physics (2006-2010)
    • Observations and modeling of exoplanets at Maria Mitchell Observatory
  • Ph.D. Computer Science / Robotics
    • NSF Graduate Teaching Fellowship in K-12 STEM Education
      Culturally Situated Design Tools
    • DARPA Mobile Robotics Research
    • Lockheed Martin, Team Trooper - DARPA Robotics Challenge
  • Taught Math ( and some Comp Sci) (2014-2023)
    • M.Ed. Curriculum and Teaching (I took too many credits)
    • 2017 NASA Space Robotics Challenge (Mars), Finalist
    • 2019 Massachusetts PAEMST, Mathematics
    • 2021 NASA Space Robotics Challenge Phase 2 (Moon), Finalist and Top 5 Winner
  • Teaching Data Science, CS, and Physics



What is the math for AI and ML?
Discrete, Stats, and Computing

Logic
\(A \lor \neg B \implies Q\)
Linear Algebra
Graph
Theory
Set
Theory
Combinatorics
Difference Equations, Recursion, Iteration
\(F_{n} = F_{n-1} + F_{n-2}\)

Discrete, Stats, and Computing are not new!

Biggest proponent of Discrete math? NCTM!

Today

  1. Activities
    • Calculator Dynamics
    • ML by Hand
    • AI by Hand
    • Feature Engineering
    • Data Splitting

Activity 1 — Dynamical Systems and Feedback






Activity 1 — Dynamical Systems and Feedback




Activity 1 — Dynamical Systems and Feedback




Iterate

The orbit of \(x_0\) is the sequence generated by iterating
\[S(x) = \sqrt{x}\] \[\quad\] \(x_0 = 16\)
\(x_1 = S^1(x_0)=4\)
\(x_2 = S^2(x_0)=2\)
\(x_3 = S^3(x_0)=1.4142...\)
\(x_4 = S^4(x_0)=1.1892...\)
\(\vdots\)
\(x_n = S^n(x_0)= ...\)

Activity 1 — Dynamical Systems and Feedback

Find the orbit of \(x_0=0.2\) in the following systems:
\(S(x)=\sin(x)\) \(C(x)=\cos(x)\) \(F(x)=4x(1-x)\)
0.2 0.2 0.2
0.1986693 0.9800665 0.64
\(\vdots\) \(\vdots\) \(\vdots\)
     
     

Activity 1 — Calculator Dynamics and Feedback

Chaos

A system is chaotic if it exhibits
sensitive dependence on initial conditions.
\(x_0 = 8 \)
\(x_0 = 8.00001\)

For Later: Watch Robert Devaney

https://www.youtube.com/watch?v=TVfn6P4Z4-8

Summary: Dynamical Systems and Feedback

  • Feedback and recursion are fundamental concepts in AI/ML/DS.
  • Even simple systems can exhibit sensitive dependence on initial conditions.
  • Analyzing dynamical systems is a great application for spreadsheets!
Image: Schutt and O'Neil (2014). "Doing Data Science: Straight talk from the frontline".

Activity 2 — Machine Learning

In 1959, Arthur Samuel created a computer program to play checkers.

Activity 2 — Machine Learning

Hexapawn is a mini chess variant, popularized by Martin Gardner.
White moves first. A piece can either move forward if the space in front of it is empty, or capture an opponent’s piece diagonally. A player wins when:
  1. One of their pawns reaches the other side
  2. They capture all of their opponent's pieces
  3. It is their opponent's turn and there is no legal move


Each position has a value, and each time a game ends, every position from that game gets +1 for player 1 win, or -1 for player 2 win

For Later: Watch Matt Parker

Summary: Hexapawn Machine Learning

  • Analyzing games involves combinatorics, probability, modeling. It can involve experiments, data, statistics, graphing, etc.
  • Understanding the mechanisms of machine learning remove some of the mysticism. AI isn't magic.
  • Adversarial attacks on games develop conceptual understanding of bias, and demonstrate potential weaknesses of deployed ML projects.

Red Green Blue (RGB)


Closeup of LCD display

RGB

An image on a screen is a composite
of three color channels
A digital image is a grid of pixel values, typically with values from 0 (none of that color) to 255 (full color).

0 50 100 200
0 50 100 200
0 50 100 200
0 50 100 255
+
0 0 0 0
50 50 50 50
100 100 100 100
200 200 200 255
+
0 0 100 200
0 50 100 0
100 100 100 200
200 0 200 255
=
0,0,0 50,0,0 100,0,100 200,0,200
0,50,0 50,50,50 100,50,100 200,50,0
0,100,100 50,100,100 100,100,100 200,100,200
0,200,200 50,200,0 100,200,200 255,255,255
Red Green Blue Composite
255
255
255
"Filters" are functions that take an image as input, operate on the pixel values, and output the new image.
Warmer


Cooler


Blur


\(+\Delta RGB\)


\(\Delta\)R: 0
\(\Delta\)G: 0
\(\Delta\)B: 0
Original RGB Histogram
Transformed RGB Histogram
Try isolating different objects with the filter
RGB Filter:
0 255 0 255 0 255
0 255 0 255 0 255

A Classification Problem

We are given an image and want to classify it as "Apple", "Orange", "Banana", or "Blueberry"

Classifier
"Apple"

Feature Engineering a Fruit Classifier

Gather all of the "Apple" images. For each image, add up the total R values, G values, and B values.

Feature Engineering a Fruit Classifier

Gather all of the "Apple" images. For each image, add up the total R values, G values, and B values.

Feature Engineering a Fruit Classifier


Feature Engineering a Fruit Classifier



RGB sum = (2.15, 2.21, 1.8) Million ⟶ ?

Feature Engineering a Fruit Classifier

Given an input image, our Fruit Classifier Algorithm is:
  1. Add up all of the R, G, and B values
  2. If ... then ...
  3. Else if ... then ...
  4. Else if ... then ...
  5. Else ...
Classify these fruit! (Python script)

MNIST

What are the distinguishing features?

  1. If needed, visit this spreadsheet tutorial
  2. Start with this spreadsheet of 0 and 1 pixel data
  3. Familiarize with the data
  4. Write some formulas to get stats about the 0s and 1s
  5. Write a formula to predict if a given row is a 0 or 1
  6. After you have a reliable classifier (formula for predicting 0 or 1), then test it on this new data
https://reproducible.cs.princeton.edu/#rep-failures

Conclusions

We are just getting started!
We need to revitalize K-12 with:
  • Discrete math
  • Computing
  • Exploratory mathematics

References

O'Neil, C., Schutt, R. (2013). Doing Data Science: Straight Talk from the Frontline. United States: O'Reilly Media.
Samuel, A.L. (1959). Some Studies in Machine Learning Using the Game of Checkers. IBM Journal of Research and Development, 44, 206-226.
Gardner, M. (1962, March). How to build a game-learning machine and then teach it to play and to win. Scientific American, 206(3), 138-153.
Williams, J. (2024). Building a Digit Classifier with MNIST. Mathematics Teacher: Learning and Teaching PK-12, 117(2), 129-137. Resources: https://jedediyah.github.io/data/mnist/
Williams, J. (2025). Computing and Data Sciences. URL: https://williams-bhs.github.io/.
Williams, J. (2025). Spreadsheet Tutorial. URL: https://williams-bhs.github.io/spreadsheets/
Abeba Birhane. (2021). The Impossibility of Automating Ambiguity. Artif Life, 27 (1): 44-61. URL: https://direct.mit.edu/artl/article-abstract/27/1/44/101872/The-Impossibility-of-Automating-Ambiguity?redirectedFrom=fulltext
Hart, Eric & Martin, W Gary. (2018). Discrete Mathematics Is Essential Mathematics in a 21st Century School Curriculum. 10.1007/978-3-319-70308-4_1.
Hart, E.W., Martin, W.G. (2018). Discrete Mathematics Is Essential Mathematics in a 21st Century School Curriculum. In: Hart, E., Sandefur, J. (eds) Teaching and Learning Discrete Mathematics Worldwide: Curriculum and Research. ICME-13 Monographs. Springer, Cham. https://doi.org/10.1007/978-3-319-70308-4_1
DeBellis, V.A., Rosenstein, J.G. Discrete mathematics in primary and secondary schools in the United States. Zentralblatt für Didaktik der Mathematik 36, 46–55 (2004). https://doi.org/10.1007/
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
McCulloch, W. S., & Pitts, W. (1943). A logical calculus of the ideas immanent in nervous activity. The Bulletin of Mathematical Biophysics, 5(4), 115–133.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
Turing, A. M. (1950). Computing machinery and intelligence. Mind, 59, 433–460.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^

Workshop topics
  1. Automatic Computers
  2. How Can a Computer be Programmed to Use a Language
  3. Neuron Nets
  4. Theory of the Size of a Calculation
  5. Self-Improvement
  6. Abstractions
  7. Randomness and Creativity
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
Samuel, A. L. (1959). Some Studies in Machine Learning Using the Game of Checkers. IBM Journal of Research and Development, 3, 210--229.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
The Jetsons (1962). "Rosie the Robot".
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
1964 - 1967. ELIZA. Joseph Weizenbaum.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
1975. Pet Rock.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
1983. Wargames.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
1984. The Terminator.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
1996. Kasparov defeats IBM's Deep Blue.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
1997. Deep Blue defeats Gary Kasporav.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
   
2007. NVidia CUDA - A software interface for GPUs, making it much easier to write code that is highly parallelized.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^


The first time I was told, earnestly, by someone who "should know" that teachers won't exist in 5 years because of AI.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
2011. IMB's Watson beats Ken Jennings and Brad Rutter in Jeopardy!
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
2012. AlexNet.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
2014. PhotoMath.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
2013-2015. DARPA Robotics Challenge.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
2016. AlphaGO beats Lee Sudol 4-1 in five game match.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
^
2017. Attention Is All You Need.
A brief and selective history of AI

1940

1945

1950

1955

1960

1965

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

2020

2025
  • AlphaFold (2020)
  • DALL E (2021)
  • Midjourney (2022)
  • Stable Diffusion (2022)
  • Chat GPT (2022)
  • LLaMA (2023)
  • Mistral 7B (2023)
  • Sora (2024)
  • Gemma (2024)