What Harvard's CS50 Course Teaches About AI, Week by Week

What Harvard's CS50 Introduction to AI with Python covers in seven weeks, with a worked Bayes' rule example, prerequisites, and what is free.

Guide: AI BasicsLast verified: October 20266 min read

Harvard's public answer to the question "what is artificial intelligence" is a seven-week course, CS50's Introduction to Artificial Intelligence with Python, taught by Brian Yu and David J. Malan. It treats AI as a set of techniques that let a program perceive a situation and choose an action, and it sorts those techniques into seven topics: search, knowledge, uncertainty, optimization, learning, neural networks, and language. The course expects either CS50x or at least one year of Python experience.

Key takeaways

  • The course page lists seven weeks: search, knowledge, uncertainty, optimization, learning, neural networks, and language, each with a lecture and a project.
  • Four of the seven topics, including search, logic, and optimization, involve no learning from a training set, which shows that AI is a family of methods and not one technology.
  • Non-Harvard students can take the course free through OpenCourseWare; the paid options are an online-platform certificate and transfer credit, and the page does not state their prices.
  • Large language models appear only near the end of the course, after the classical methods they build on.
  • Bayes' rule, taught in the uncertainty week, gives a worked example: if 80 percent of rainy days are cloudy, 10 percent of days are rainy, and 40 percent are cloudy, a cloudy day means a 20 percent chance of rain.

What the course means by an AI system

The first lecture notes define an agent as an entity that perceives its environment and acts on it. A state is one configuration of that agent in its environment, actions are the choices available in a state, and a transition model says which state results from each action. A goal test checks whether a state is a goal, and a path cost scores a sequence of actions. A solution is a sequence of actions from the starting state to a goal state, and an optimal solution is the one with the lowest path cost.

This vocabulary is plain but strict. A route-finding app, a game-playing program, and a puzzle solver all fit it, which is why the same few ideas recur across the whole course. The definition says nothing about consciousness or human-like understanding. It describes behavior that code can specify and tests can measure.

The seven topics and what each one teaches

The course site lists the weeks in order and links each to lecture notes. The table below pairs each topic with ideas named in those notes.

WeekTopicCore ideas in the notesLearns from data?
0SearchBreadth-first and depth-first search, greedy best-first search, A*, minimax, alpha-beta pruningNo
1KnowledgePropositional logic, entailment, model checking, resolution, first-order logicNo
2UncertaintyConditional probability, Bayes' rule, Bayesian networks, Markov models, hidden Markov modelsUses probabilities that are supplied
3OptimizationHill climbing, simulated annealing, linear programming, constraint satisfactionNo
4LearningClassification, nearest neighbors, perceptrons, regression, overfitting, reinforcement learning, clusteringYes
5Neural networksActivation functions, gradient descent, backpropagation, convolution, pooling, recurrent networksYes
6LanguageGrammars, n-grams, bag of words, Naive Bayes, word embeddings, attention, transformersMostly yes

The last column is a reading of the topics, not a claim made by the course. It makes one point visible: four of seven weeks cover methods that run without a training set.

A worked example from the uncertainty week

The notes illustrate Bayes' rule with weather. Suppose 80 percent of rainy days begin with cloudy skies, 10 percent of all days are rainy, and 40 percent of all days are cloudy. The rule states that the probability of rain given clouds equals the probability of clouds given rain, times the probability of rain, divided by the probability of clouds. That is 0.8 times 0.1, divided by 0.4, or 0.2.

The same result appears when the numbers are counted out. Take 1,000 mornings. About 400 are cloudy, and 100 are rainy, of which 80 were cloudy. So among the 400 cloudy mornings, 80 turn into rain, which is one in five. The calculation is the building block of the Bayesian networks and the Naive Bayes text classifier that the course introduces later. Because the inputs here are the course's illustrative figures, the answer describes that example and not real weather.

A worked example from the search week

The notes use the 15 puzzle, a sliding-tile game, to show the vocabulary in action. A state is one arrangement of the tiles, the actions depend on where the empty square sits, and the goal test asks whether the tiles are in order. Breadth-first search uses a queue and expands level by level, so it is guaranteed to find the optimal solution, though it is usually slower. Depth-first search uses a stack and follows one path as far as it goes. It can be faster if it picks well, but its solution may not be optimal.

Informed search adds an estimate of the remaining distance, called a heuristic. A* combines the cost already paid with that estimate, and it is optimal when the estimate never overstates the true cost. Nothing in this procedure is learned from examples. It is a careful search with a good estimate.

What the course does not settle

A course is a curriculum, so it makes choices. It covers techniques taught at the introductory level and does not rank them or predict which will matter most. Its seven listed topics are technical and do not include social questions such as regulation or employment; those need other sources. A reader who wants a one-sentence definition of AI will find that the course answers with a toolkit instead, and that is a fair description of the field.

The format also has limits worth knowing. The course is self-paced, with a lecture and a project each week. Projects are submitted through an online-course account for feedback, and questions go to the course communities. Credit and certificates are separate paid options that the page names without stating prices.

FAQ

Is the Harvard AI course free?

The course page says non-Harvard students can take it free through OpenCourseWare. It lists an online-platform verified certificate, an online-platform professional certificate, and transfer credit through Harvard Extension School or Harvard Summer School as paid routes, without prices.

Is programming required?

Yes. The listed prerequisite is CS50x or at least one year of Python experience, and the projects are Python programs that use AI libraries.

Does the course teach chatbots like ChatGPT?

Partly. The final week covers language, including attention and transformers, the architecture behind modern language models. The overview names large language models among the topics, but most of the course covers earlier methods.

Is this the only Harvard source on AI?

No. Harvard publishes many other courses and articles. This one is documented in enough detail to describe accurately, so it is the one summarized here.

Last verified: October 2026

Sources

New to artificial intelligence?

Start with the basics, then follow the guides to tools, rules, and effects on society.

Start with AI Basics