Skip to content

LearnCourses

Harvard University (CS50)

CS50's Introduction to Artificial Intelligence with Python

Learn search, knowledge, uncertainty, optimization, machine learning, neural networks and language through Python projects, for people who know Python.

Taught by Brian Yu, David J. Malan at Harvard University (CS50)FreeCertificateVerified

From Search to Language
7 weeks
What it uses
scikit-learn and TensorFlow
Before you startCS50x or at least one year of experience with Python.
Intermediate level
7 weeks of lectures and projects
Self-paced
CS50's Introduction to Artificial Intelligence with PythonFreeOpen the course

What you’ll learn

  • Use search algorithms such as depth-first, breadth-first and A* search, and minimax for games.
  • Represent knowledge with logic, and reason under uncertainty with probability, Bayesian networks and Markov models.
  • Solve optimization problems with hill climbing, simulated annealing, linear programming and constraint satisfaction.
  • Build machine learning models, from nearest-neighbor and Q-learning to neural networks in TensorFlow.
  • Work with language using grammars, n-grams, word2vec, attention and transformers.

Skills you’ll gain

PythonNeural networksMachine Learning

Tools it uses

scikit-learn and TensorFlow.

Details to know

  • Certificate of completionFree when every project scores 70%
  • Free to takeNo fee on cs50.harvard.edu
  • Taught in EnglishNo other languages listed
  • VerifiedOct 2026

Lessons

7 weeks of lectures and projects

CS50's Introduction to Artificial Intelligence with Python is Harvard's free course on the ideas behind modern AI, taught by Brian Yu and David J. Malan. Over seven weeks you move from search and logic through probability and optimization to machine learning, neural networks and language.

Each week has a recorded lecture with notes, slides and source code, an optional quiz, and a Python project that is checked automatically when you submit it. You need a free edX account to submit, and you work at your own pace until the course deadline.

Across 7 weeks, you will:

  • Search: Write programs that find paths and pick game moves with BFS, A* and minimax.
  • Knowledge: Store facts in logic and let a program work out what follows from them.
  • Uncertainty: Reason with probability, Bayesian networks and Markov models.
  • Optimization: Solve problems with local search, linear programming and constraint satisfaction.
  • Learning: Train classifiers, then teach a program to play a game by reinforcement learning.
  • Neural Networks: Build and train neural networks in TensorFlow, including convolutional ones for images.
  • Language: Parse sentences with grammars, represent words as vectors and look inside attention.

Applied learning project

Every week ends in a Python project, 12 in all across seven weeks, and each is checked automatically when you submit it. You need at least 70% on every project for the free certificate.

  • Degrees and Tic-Tac-Toe: Find how closely two actors are linked, and build a Tic-Tac-Toe player that plays perfectly.
  • Knights and Minesweeper: Solve logic puzzles, and play Minesweeper by inference.
  • PageRank and Heredity: Rank web pages, and estimate the odds that a person carries a genetic trait.
  • Crossword: Fill a crossword grid as a constraint satisfaction problem.
  • Shopping and Nim: Predict which online shoppers will buy, and train a Nim player by reinforcement learning.
  • Traffic: Train a neural network to recognize traffic signs in photos.
  • Parser and Attention: Pull noun phrases out of sentences, and predict a masked word with BERT.

By the end, you can use Python's machine learning libraries and apply the core methods of AI to design small intelligent programs of your own.

SearchWeek 1 • 7 lessonsWeek details

What you’ll learn

  • Frame a task as a search problem with states, actions and a goal.
  • Compare depth-first, breadth-first, greedy best-first and A* search.
  • Choose moves in two-player games with minimax and alpha-beta pruning.
  • Code the Degrees and Tic-Tac-Toe projects.

Lessons

  1. 1.1Search Problems
  2. 1.2Depth-First Search
  3. 1.3Breadth-First Search
  4. 1.4Greedy Best-First Search
  5. 1.5A* Search
  6. 1.6Minimax
  7. 1.7Alpha-Beta Pruning
KnowledgeWeek 2 • 6 lessonsWeek details

What you’ll learn

  • Write facts as propositional logic sentences a program can reason about.
  • Check what a knowledge base entails with model checking and resolution.
  • See how first-order logic describes objects and the relations between them.
  • Code the Knights and Minesweeper projects.

Lessons

  1. 2.1Propositional Logic
  2. 2.2Entailment
  3. 2.3Inference
  4. 2.4Model Checking
  5. 2.5Resolution
  6. 2.6First Order Logic
UncertaintyWeek 3 • 10 lessonsWeek details

What you’ll learn

  • Work with conditional probability, independence and Bayes' rule.
  • Model uncertain events with Bayesian networks and estimate answers by sampling.
  • Follow changes over time with Markov and hidden Markov models.
  • Code the PageRank and Heredity projects.

Lessons

  1. 3.1Probability
  2. 3.2Conditional Probability
  3. 3.3Random Variables
  4. 3.4Independence
  5. 3.5Bayes’ Rule
  6. 3.6Joint Probability
  7. 3.7Bayesian Networks
  8. 3.8Sampling
  9. 3.9Markov Models
  10. 3.10Hidden Markov Models
OptimizationWeek 4 • 6 lessonsWeek details

What you’ll learn

  • Improve a solution step by step with hill climbing and simulated annealing.
  • Find the cheapest solution under constraints with linear programming.
  • Model puzzles as constraint satisfaction problems and solve them with backtracking search.
  • Code the Crossword project.

Lessons

  1. 4.1Local Search
  2. 4.2Hill Climbing
  3. 4.3Simulated Annealing
  4. 4.4Linear Programming
  5. 4.5Constraint Satisfaction
  6. 4.6Backtracking Search
LearningWeek 5 • 13 lessonsWeek details

What you’ll learn

  • Train classifiers such as nearest-neighbor, perceptrons and support vector machines.
  • Measure error with loss functions and limit overfitting with regularization.
  • Teach an agent through rewards with Q-learning, and group data with k-means clustering.
  • Code the Shopping and Nim projects.

Lessons

  1. 5.1Supervised Learning
  2. 5.2Nearest-Neighbor Classification
  3. 5.3Perceptron Learning
  4. 5.4Support Vector Machines
  5. 5.5Regression
  6. 5.6Loss Functions
  7. 5.7Overfitting
  8. 5.8Regularization
  9. 5.9Reinforcement Learning
  10. 5.10Markov Decision Processes
  11. 5.11Q-Learning
  12. 5.12Unsupervised Learning
  13. 5.13k-means Clustering
Neural NetworksWeek 6 • 9 lessonsWeek details

What you’ll learn

  • Build neural networks from activation functions and train them with gradient descent and backpropagation.
  • Write networks in TensorFlow, including convolutional networks for images.
  • See where recurrent neural networks fit for sequences.
  • Code the Traffic project.

Lessons

  1. 6.1Artificial Neural Networks
  2. 6.2Activation Functions
  3. 6.3Gradient Descent
  4. 6.4Backpropagation
  5. 6.5Overfitting
  6. 6.6TensorFlow
  7. 6.7Image Convolution
  8. 6.8Convolutional Neural Networks
  9. 6.9Recurrent Neural Networks
LanguageWeek 7 • 11 lessonsWeek details

What you’ll learn

  • Parse sentences with context-free grammars in nltk.
  • Classify text with n-grams, bag-of-words and naive Bayes.
  • Represent words as vectors with word2vec, then see how attention and transformers work.
  • Code the Parser and Attention projects.

Lessons

  1. 7.1Syntax
  2. 7.2Semantics
  3. 7.3Context-Free Grammar
  4. 7.4nltk
  5. 7.5n-grams
  6. 7.6Bag-of-Words Model
  7. 7.7Naive Bayes
  8. 7.8Word Representation
  9. 7.9word2vec
  10. 7.10Attention
  11. 7.11Transformers
Earn a certificateFree CS50 certificate once every project scores 70% or more; a verified edX certificate costs extra.

FAQs

Is CS50's Introduction to Artificial Intelligence with Python free?

Yes. The course is free.

Open the course

Do I get a certificate?

Yes. Free CS50 certificate once every project scores 70% or more; a verified edX certificate costs extra.

What do I need before I start?

CS50x or at least one year of experience with Python.

How long is it?

7 weeks of lectures and projects; you take it at your own pace.

See the lessons

Which tools does it teach?

scikit-learn and TensorFlow.

Who makes it?

Taught by Brian Yu and David J. Malan at Harvard University (CS50). Recaply lists 1 course from Harvard University (CS50).

More courses

See all
Freeon cs50.harvard.eduOpen the course