---
title: "Indicator Variable in Intro to Probability"
description: "Indicator variable in Intro to Probability is a 0-or-1 random variable for a yes/no event, useful for Bernoulli trials, expected value, and counting successes."
canonical: "https://fiveable.me/introduction-probability/key-terms/indicator-variable"
type: "key-term"
subject: "Intro to Probability"
unit: "Unit 8"
---

# Indicator Variable in Intro to Probability

## Definition

An indicator variable is a random variable that equals 1 if an event happens and 0 if it does not. In Intro to Probability, it is the clean way to model yes/no outcomes like a success in a Bernoulli trial.

## What It Is

An indicator variable in Intro to Probability is a binary random variable that marks whether a specific event happened. If the event occurs, the variable equals 1. If it does not, the variable equals 0. That makes it a simple way to turn a probability question into a number you can work with.

You will usually see indicator variables when a problem asks about a single yes/no outcome, such as whether a coin flip lands heads, whether a part passes inspection, or whether a machine succeeds on one trial. The event you care about is the one being "indicated." If the event is A, then the indicator variable for A is often written as I(A) or 1A.

This idea fits perfectly with the Bernoulli distribution. A Bernoulli random variable also has two possible values, 1 for success and 0 for failure, with success probability p. In many Intro to Probability problems, an indicator variable is just a Bernoulli random variable attached to one event. The mean of that variable is the probability of the event, since E[I(A)] = 1 · P(A) + 0 · P(A^c) = P(A).

That expected value fact is what makes indicator variables so useful. Instead of counting outcomes directly in a messy sample space, you can define one indicator for each event you care about and then add them up. For example, if you want the number of heads in three coin flips, you can define one indicator for each flip and sum them. Each indicator is 1 when its flip is heads and 0 otherwise, so the total count is the sum of those 0s and 1s.

A common mistake is thinking an indicator variable describes the whole experiment. It does not. It only tracks one event at a time, and the event has to be named clearly. Another mistake is mixing up the event itself with the indicator. The event is a statement about the outcome. The indicator variable is the random variable that records that statement as 0 or 1.

## Why It Matters

Indicator variables show up any time Intro to Probability moves from "what happened?" to "how many times did it happen?" They are one of the easiest tools for counting successes without building a huge probability table.

They also make expected value problems much cleaner. If a question asks for the expected number of successes, you can often write the answer as a sum of indicator variables and use linearity of expectation. That lets you work with each event separately instead of trying to list every possible outcome.

This term also ties directly to Bernoulli distribution, since a single indicator variable behaves like one Bernoulli trial. Once you are comfortable with that setup, you can use the same idea for coin flips, survey responses, defect checks, or any other binary outcome in the course.

Indicator variables are especially helpful when the sample space gets cluttered. Rather than counting by hand from scratch, you translate the problem into 0s and 1s, which is often the fastest path to the probability or expected value the problem wants.

## Connections

### Bernoulli distribution

An indicator variable is the simplest example of a Bernoulli random variable. Both have only two values, 0 and 1, and both model a success or failure outcome. If a problem names a single binary event, you can usually think of it as an indicator variable or a Bernoulli trial with success probability p.

### [Bernoulli trial](/introduction-probability/key-terms/bernoulli-trial)

A Bernoulli trial is the experiment behind an indicator variable, like one coin flip or one quality check. The trial produces a success or failure, and the indicator records that result as 1 or 0. The trial is the action, while the indicator is the random variable that measures its outcome.

### Categorical variable

A categorical variable names a group or label, like color or brand. An indicator variable is what you get after choosing one category or event and recoding it numerically as yes or no. In probability problems, this recoding makes it easier to compute counts and expected values.

### [Success probability](/introduction-probability/key-terms/success-probability)

The success probability is the chance that the indicator equals 1. If the event happens with probability p, then the indicator variable has expected value p. That is why finding the probability of the event and finding the mean of the indicator are basically the same move.

## On the AP Exam

Problem sets and quizzes often ask you to define an indicator for a specific event, then use it to count how many times that event occurs. You might be asked to write I(A) for a single event, or several indicators for several trials, then compute the total as a sum of 0s and 1s. The main skill is translating a word problem into a random variable setup.

A common follow-up is expected value. If you know each indicator has mean equal to the event probability, you can add those means to get the expected number of successes. When you see a question about "how many" heads, defects, wins, or yes responses, indicator variables are often the cleanest route.

They also show up in short-answer reasoning, where you explain why a binary outcome can be modeled by 0 and 1. If the problem asks whether trials are independent, you may need to say whether one indicator changes another one’s probability. The test move is usually translate, set up, and sum.

## indicator variable vs Categorical variable

A categorical variable is the label or group itself, like red, blue, or green. An indicator variable is the numeric version of one chosen category or event, coded as 1 if it happens and 0 if it does not. So categorical data can be described with indicators, but the indicator is not the same thing as the original category.

## Key Takeaways

- An indicator variable is a 0-or-1 random variable that records whether a specific event happens.
- In Intro to Probability, indicator variables are a clean way to model Bernoulli-style yes/no outcomes.
- The expected value of an indicator variable equals the probability of the event it tracks.
- You can add indicator variables to count how many times an event occurs across trials.
- The big mistake is confusing the event with the variable, since the event is a statement and the indicator is the numeric record of that statement.

## FAQs

### What is an indicator variable in Intro to Probability?

An indicator variable is a random variable that equals 1 when a chosen event happens and 0 when it does not. In Intro to Probability, it is used to turn a yes/no outcome into a number you can calculate with. That makes it useful for counting successes and finding expected values.

### Is an indicator variable the same as a Bernoulli random variable?

Yes, in many Intro to Probability problems, an indicator variable is just a Bernoulli random variable tied to one event. Both have values 0 and 1. The main idea is that the variable records success or failure for a single trial.

### How do you use indicator variables to count outcomes?

Define one indicator for each trial or event, with 1 for success and 0 for failure. Then add them up. The sum gives the total number of successes, which is much easier than counting directly from every outcome in the sample space.

### Why is the expected value of an indicator variable equal to a probability?

Because the variable only takes values 0 and 1. Its expected value is 1 times the chance of success plus 0 times the chance of failure, which simplifies to the probability of the event. That shortcut is one of the most useful tricks in the course.

## Related Study Guides

- [8.1 Bernoulli distribution](/introduction-probability/unit-8/bernoulli-distribution/study-guide/1twgAtuVK6BLb0AM)

## About This Document

Canonical Fiveable pages are available as Markdown at the same path plus `.md`.

- [llms.txt](https://fiveable.me/llms.txt): index of Fiveable's sections and URL patterns
- [llms-full.txt](https://fiveable.me/llms-full.txt): complete subject and unit listing
- [MCP server](https://fiveable.me/mcp): call Fiveable as tools instead of fetching pages (`https://fiveable.me/api/mcp`)
- [MCP server for AP teachers](https://fiveable.me/mcp/teachers): a teacher's classes, assignments and AP-rubric grading (`https://fiveable.me/api/mcp/teacher`)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/introduction-probability/key-terms/indicator-variable#resource","name":"Indicator Variable in Intro to Probability","url":"https://fiveable.me/introduction-probability/key-terms/indicator-variable","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/introduction-probability/key-terms/indicator-variable#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-07-03T02:23:02.089Z","isPartOf":{"@type":"Collection","name":"Intro to Probability Key Terms","url":"https://fiveable.me/introduction-probability/key-terms"},"publisher":{"@type":"Organization","name":"Fiveable","url":"https://fiveable.me"}},{"@type":"DefinedTerm","@id":"https://fiveable.me/introduction-probability/key-terms/indicator-variable#term","name":"indicator variable","description":"An indicator variable is a random variable that equals 1 if an event happens and 0 if it does not. In Intro to Probability, it is the clean way to model yes/no outcomes like a success in a Bernoulli trial.","url":"https://fiveable.me/introduction-probability/key-terms/indicator-variable","inDefinedTermSet":{"@type":"DefinedTermSet","name":"Intro to Probability Key Terms","url":"https://fiveable.me/introduction-probability/key-terms"}},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is an indicator variable in Intro to Probability?","acceptedAnswer":{"@type":"Answer","text":"An indicator variable is a random variable that equals 1 when a chosen event happens and 0 when it does not. In Intro to Probability, it is used to turn a yes/no outcome into a number you can calculate with. That makes it useful for counting successes and finding expected values."}},{"@type":"Question","name":"Is an indicator variable the same as a Bernoulli random variable?","acceptedAnswer":{"@type":"Answer","text":"Yes, in many Intro to Probability problems, an indicator variable is just a Bernoulli random variable tied to one event. Both have values 0 and 1. The main idea is that the variable records success or failure for a single trial."}},{"@type":"Question","name":"How do you use indicator variables to count outcomes?","acceptedAnswer":{"@type":"Answer","text":"Define one indicator for each trial or event, with 1 for success and 0 for failure. Then add them up. The sum gives the total number of successes, which is much easier than counting directly from every outcome in the sample space."}},{"@type":"Question","name":"Why is the expected value of an indicator variable equal to a probability?","acceptedAnswer":{"@type":"Answer","text":"Because the variable only takes values 0 and 1. Its expected value is 1 times the chance of success plus 0 times the chance of failure, which simplifies to the probability of the event. That shortcut is one of the most useful tricks in the course."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Intro to Probability","item":"https://fiveable.me/introduction-probability"},{"@type":"ListItem","position":2,"name":"Key Terms","item":"https://fiveable.me/introduction-probability/key-terms"},{"@type":"ListItem","position":3,"name":"Unit 8","item":"https://fiveable.me/introduction-probability/unit-8"},{"@type":"ListItem","position":4,"name":"indicator variable"}]}]}
```
