Skip to main content Skip to secondary navigation

Hey, Prospective Frosh!

IntroSems are designed with you in mind. Browse this catalog website to learn more and look for the 2024-25 seminars to post here in August, when you'll be able to start signing up for priority enrollment in 3 IntroSems every quarter.

Main content start

CS 31N: Counterfactuals: The Science of What Ifs?

Psychic Vision store sign in LA. Wyron A on Unsplash

General Education Requirements

Not currently certified for a requirement. Courses are typically considered for Ways certification a quarter in advance.


Please note: CS 31N has been canceled for 2023-24.


Course Description

How might the past have changed if different decisions were made? This question has captured the fascination of people for hundreds of years. By precisely asking, and answering such questions of counterfactual inference, we have the opportunity to both understand the impact of past decisions (has climate change worsened economic inequality?) and inform future choices (can we use historical electronic medical records data about decision made and outcomes, to create better protocols to enhance patient health?).

In this course I will introduce some of the most common quantitative approaches to counterfactual reasoning, as well as give a wide sampling of some of the many important problems and questions that can be addressed through the lens of counterfactual reasoning, including in climate change, healthcare and economics. Students will also have the opportunity to do a deep dive into one topic through a course project. No prior experience with counterfactual or “what if” reasoning, nor probability, is required.


Meet the Instructor: Emma Brunskill

Emma Brunskill

"I am an associate professor of computer science. My research focuses on how to create artificial intelligence agents that together with humans help improve people’s lives through reinforcement learning, a form of continual improvement through experience. If we want reinforcement learning techniques to be suitable in intelligent tutoring systems or as doctors’ assistants, we need algorithms that can learn from prior decisions made and their outcomes, in effect data mining to see if better strategies already exist within the natural variability of past decision makers. This naturally introduces the question of counterfactual reasoning, which has been a major focus of my lab, driven by my interest in education and healthcare."