Stanford CS 221: Artificial Intelligence: Principles and Techniques
CS 221 is Stanford's broad AI foundations course — search, Markov decision processes, reinforcement learning, games, constraint satisfaction, Bayesian networks, and a taste of logic — with homeworks mixing math and substantial coding. It's the survey that maps the whole field before the deeper 22x courses.
Fennie is independent and not affiliated with Stanford University. This is an unofficial study guide.
Build my CS 221 study planWhat makes it hard
Breadth is the difficulty: each unit introduces a new modeling paradigm with its own formalism, and the homeworks demand both correct math and working implementations on the same deadline. The recurring exam skill is modeling — taking a messy scenario and casting it as a search problem or MDP — which is harder than executing any single algorithm.
What you'll cover
- • State-space search and A*
- • Markov decision processes
- • Reinforcement learning
- • Game playing and adversarial search
- • Constraint satisfaction problems
- • Bayesian networks
The CS 221 study guide
How to study for Stanford CS 221, step by step.
- 1
Master each paradigm's formalism completely
Every unit is a modeling language: states, actions, rewards, factors. Learn each one's components cold, because the course's recurring question is 'cast this scenario in the formalism.'
- 2
Practice modeling, not just solving
Take scenarios and define the state space or MDP yourself before touching algorithms. Exams put their weight on the modeling step, and it's the part homework templates do for you.
- 3
Budget homeworks as math plus code
Each assignment has written derivations and a real implementation, and they fail on different schedules. Start the written part early; start the code earlier.
- 4
Keep the prerequisite math loaded
Probability from CS 109 and big-O maturity get used without ceremony. A weekly hour of refresher on probability manipulation pays off across every unit.
- 5
Connect the units to each other
Search becomes MDPs become RL as uncertainty enters. Build the through-line explicitly — exam questions love the boundaries between paradigms.
- 6
Cover the breadth with Fennie
Upload your CS 221 syllabus and Fennie's Daily Plan paces each unit's formalism and homework across the quarter so no paradigm gets crammed, with quizzes generated from the actual course content. It's free to start.
Start my CS 221 plan free
How Fennie helps with CS 221
Fennie's Daily Plans pace CS 221's paradigm-a-fortnight breadth so each formalism is solid before the next arrives, with homework deadlines tracked across both their math and coding halves. Chat through casting scenarios as search problems or MDPs — the modeling skill the exams actually isolate.
FAQ
Is CS 221 hard?
The breadth is the challenge: five-plus modeling paradigms in ten weeks, with homeworks demanding correct math and working code simultaneously. Students with solid CS 109 probability and honest weekly pacing manage it; crammers meet a wall of formalisms.
Should I take CS 221 or CS 229 first?
They're complementary, not ordered: 221 surveys all of AI (search, MDPs, RL, CSPs, Bayes nets) while 229 goes deep on machine learning specifically. Many students take 221 first for the map, then 229 for the depth — but the reverse works fine.
How much coding is in CS 221?
Substantial — homeworks include real implementations of search, MDP, and RL algorithms in Python, alongside written derivations. Programming maturity at the CS 107 level is assumed; the code itself isn't the hard part, the modeling is.
Pass CS 221 with a plan, not a cram
Upload your CS 221 materials and Fennie generates a Daily Plan paced to your deadline — plus chat, flashcards, and quizzes built from the actual course content.
Get started freeMore Stanford courses
CS 106A — Programming Methodology
CS 106A is Stanford's famous introduction to programming, taught in Python — control flow, functions, decomposition, lists, dictionaries, and graphics — assuming zero prior experience. Its lectures and assignments are public, and through Code in Place it has been taught free to hundreds of thousands of people, so it's studied worldwide by enrolled students and self-learners alike.
CS 106B — Programming Abstractions
CS 106B follows 106A with programming abstractions in C++ — recursion, ADTs and the standard collections, big-O, linked structures, trees, and hashing. It's the course where Stanford CS gets real, and like 106A its materials are public and heavily used by self-learners.
CS 107 — Computer Organization and Systems
CS 107 takes students from C++ down to the machine: C programming, pointers and memory, bit-level representation, x86-64 assembly, and how the heap actually works — culminating in the famous heap allocator assignment. It's the systems gateway of the Stanford CS core.
CS 103 — Mathematical Foundations of Computing
CS 103 is Stanford's discrete math and theory gateway — proof techniques, set theory, induction, graph basics, then finite automata, regular languages, and the first look at computability and P vs NP. For most students it's the first course where the deliverable is a proof, not a program.