Stanford · Probability for AI / PAI00
Stanford's Probability for AI: an Introduction to the Course
The next course I am taking is Probability for AI (PAI, pronounced "pie"), a free online course from Stanford that teaches the probability modern AI is built on. This page introduces the course before my weekly notes begin: who runs it, how it is taught, what the student site looks like, and how the six weeks are planned.
- section
- key term
- reading note
What PAI is
PAI is based on material from CS109, Stanford's probability course for computer scientists, rebuilt for the general public. The course says comfort with algebra is all you need: if you can make sense of y = 2x + 1, you have the background.
| Cost | Free: no fees, no ads, no premium tier |
| Length | Six weeks, a few focused hours each week |
| Prerequisites | Algebra; no programming or calculus needed |
| Grades and credit | None; you keep a public portfolio of your work, hosted by Stanford |
| Fixed time | One live section a week; everything else on your own schedule |

The people behind it
The course is led by two Stanford computer science professors, Chris Piech and Mehran Sahami, with Kelly Cochran as the course director. Chris's research uses machine learning to understand how people learn. Mehran also worked as a research scientist at Google.
They have done this before. In 2020 they helped start Code in Place, a free introduction to coding that welcomed more than ten thousand students in its first offering. PAI is taught the same way.

The Code in Place way
The model is simple: one volunteer teacher for every ten students. The teaching team's bet is that the number of people who want to teach is large, perhaps close to the number who want to learn, and that teaching is the best way to learn. Many section leaders took a course like this once and came back to pass it on.

Inside the class
Once you are in, the student site has a few parts, each with a clear job:
- Home: the week's plan as a path: lessons to watch, something to build, and your section.
- Lessons: the lecture videos, plus a toolbox with every definition and rule in one place, and the course book.
- Puzzles: a new probability puzzle for everyone each day, and a trainer with every puzzle released so far.
- Portfolio: everything you build. My first projects are a Word Detective and an Inference Time Calculator.
- Events: a half-hour session with Chris every Monday, and it is recorded.
- Forums: where the whole class, and each section, talks.



The weekly section
For me the most interesting part of the design is the section. Each week I meet live for 50 minutes with a volunteer section leader and about ten other students. Our leader goes over that week's ideas, and we work through problems together. Sections run at all hours from Wednesday to Friday, so there is a time for every time zone.
Our first topic was "Same prompt, different answers?". This week it is the Palpatine poll: how do you find out how many people secretly support someone, when nobody wants to say so out loud?

Section is also how the course knows you are doing your own work: the certificate depends on taking part each week, not on online answers that an AI could produce.
How the six weeks are built
Each week pairs one idea from probability with something you build:
| Week | You learn | You build |
|---|---|---|
| 1 | Core probability | An inference-time resource decision maker for large AI models |
| 2 | Random variables | Probabilistic artwork |
| 3 | Maximum likelihood estimation | Find hidden chambers in the pyramids, a cell-phone tracker, and more |
| 4 | Logistic regression | A test suite to see where it works and where it fails |
| 5 | Neural networks | Visualize how large models work under the hood |
| 6 | Probabilistic evaluation | Critique how AI models perform, including fairness and calibration |
The course ends with a final project of your own design, which becomes the centrepiece of the public portfolio.

How to join
There are two ways in: apply to learn, or volunteer to teach a small group of learners. Applications open once a year. For 2026 they closed at the end of September, and class started on 9 October, so the next chance is next year's round on pai.stanford.edu.
My first thought
I have just finished week one, and my notes from it come next. One line from the course FAQ has stayed with me: "not a math person" usually means "had one bad math class a while ago"
. It made me wonder whether I would have loved math and computer science even more if I had met teachers like these earlier.

Links
- Probability for AI: the course home page, FAQ and applications.
- The Probability for AI team.
- Code in Place: the earlier free Stanford course taught the same way.
- Chris Piech and Mehran Sahami: Stanford profiles.
