Skip to main content
Stanford
Computer Science
5 credits

Stanford CS 109: Probability for Computer Scientists

CS 109 is probability built for CS — counting, conditional probability, random variables and distributions, the central limit theorem, then maximum likelihood and the first real machine learning algorithms. It bridges the core sequence to CS 221 and CS 229 and is many students' favorite course in the major.

Fennie is independent and not affiliated with Stanford University. This is an unofficial study guide.

Build my CS 109 study plan

What makes it hard

Probability problems punish almost-right reasoning: a small modeling error — wrong conditioning, double-counted outcomes — produces a confidently wrong answer with no compiler to object. Counting problems early and the inference material late are the classic stumbles, and the exam questions are word problems where the setup is the entire battle.

What you'll cover

  • Combinatorics and counting
  • Conditional probability and Bayes' theorem
  • Discrete and continuous random variables
  • Common distributions
  • Central limit theorem
  • Maximum likelihood and intro machine learning

The CS 109 study guide

How to study for Stanford CS 109, step by step.

  1. 1

    Treat counting as a skill, not a topic

    The early combinatorics is where 109 grades quietly diverge. Do many small counting problems and articulate why each uses permutations, combinations, or neither — the discrimination is the skill.

  2. 2

    Practice the setup phase out loud

    Exam problems are scenarios, and the loss happens translating them into the right probability statement. For every practice problem, write the formal setup before computing anything.

  3. 3

    Make Bayes' theorem mechanical

    Conditioning errors are the course's signature mistake. Drill Bayes and law-of-total-probability problems until identifying what to condition on is reflexive.

  4. 4

    Connect every distribution to its story

    Each named distribution models a situation — know the story, the parameters, and when it applies. Exams reward recognizing which distribution a scenario is wearing.

  5. 5

    Do the psets without solutions open

    Probability intuition only builds through honest failure. Attempt every problem cold, struggle, then consult — the struggle is the studying.

  6. 6

    Build the reps on a Fennie Daily Plan

    Upload the CS 109 syllabus and Fennie schedules daily problem practice paced to psets and exams, weighting the counting and inference units, with practice questions generated from your actual materials. Free to start.

    Start my CS 109 plan free

How Fennie helps with CS 109

Fennie's Daily Plans pace CS 109's problem volume across the quarter so counting is automatic before conditional probability needs it and inference doesn't arrive on a weak base. Chat through problem setups — what to condition on, which distribution fits — since the setup is where these exams are won or lost.

FAQ

Is CS 109 hard?

It's beloved but real: probability punishes slightly-wrong reasoning invisibly, and exam word problems put all the difficulty in the setup. Students who do high problem volume — especially counting early — consistently do well.

What math do I need for CS 109?

Calculus comfort (integrals appear with continuous distributions) and the discrete-math maturity of CS 103. The harder prerequisite is tolerance for word problems where the model, not the arithmetic, is the question.

Does CS 109 cover machine learning?

The final stretch builds real ML from the probability up — maximum likelihood, naive Bayes, logistic regression. It's the conceptual on-ramp to CS 221 and CS 229, which is much of why the course is so popular.

Pass CS 109 with a plan, not a cram

Upload your CS 109 materials and Fennie generates a Daily Plan paced to your deadline — plus chat, flashcards, and quizzes built from the actual course content.

Get started free

More Stanford courses