---
title: "Truth Tables — AP CSA Definition & Boolean Logic Guide"
description: "A truth table lists every input combination for a Boolean expression and its result. In AP CSA Topic 2.6, it's how you prove two expressions are equivalent."
canonical: "https://fiveable.me/ap-comp-sci-a/key-terms/truth-tables"
type: "key-term"
subject: "AP Computer Science A"
unit: "Unit 2"
---

# Truth Tables — AP CSA Definition & Boolean Logic Guide

## Definition

A truth table is a systematic chart listing every possible combination of true/false values for the variables in a Boolean expression along with the expression's result. In AP CSA (EK 2.6.A.1), two expressions are equivalent if their truth tables match in every row.

## What It Is

A [truth table](/ap-comp-sci-a/unit-2/equivalent-boolean-expressions/study-guide/aMDnyFuOcAXnZigLW1vL "fv-autolink") is a brute-force proof tool. You [list](/ap-comp-sci-a/key-terms/list "fv-autolink") every possible true/false combination of your Boolean variables in rows, then evaluate the expression for each row. With one variable you need 2 rows, with two variables 4 rows, with three variables 8 rows. The pattern is 2^n rows for n variables, because each variable doubles the possibilities.

The reason truth tables exist in the AP CSA course is equivalence. EK 2.6.A.1 says two [Boolean expressions](/ap-comp-sci-a/unit-2/boolean-expressions/study-guide/s6j4i9ram3AlCg3uYjwd "fv-autolink") are equivalent if they evaluate to the same value *in all cases*, and a truth table is exactly how you check "all cases" without guessing. Build a table for `!(a && b)`, build one for `!a || !b`, and you'll see the output columns match on every row. That match is the proof, and it's also a demonstration of De Morgan's law. Think of a truth table as the receipts behind any claim that two pieces of Boolean logic do the same thing.

## Why It Matters

Truth tables live in **[Unit 2](/ap-comp-sci-a/unit-2 "fv-autolink") (Selection and Iteration), Topic 2.6: Equivalent Boolean Expressions**, supporting learning objective **2.6.A** (compare equivalent Boolean expressions). They matter because the exam loves to show you a Boolean condition written one way and ask which answer choice means the same thing. Spotting that `!(x > 5)` is the same as `x <= 5`, or that `!(a || b)` is the same as `!a && !b`, is a pure equivalence skill. The truth table is the method that makes those answers checkable instead of vibes-based. The same skill carries through the rest of Unit 2, since every `if` statement and `while` [loop condition](/ap-comp-sci-a/key-terms/loop-condition "fv-autolink") you write is a Boolean expression you might need to simplify or rewrite.

## Connections

### [De Morgan's law (Unit 2)](/ap-comp-sci-a/key-terms/de-morgans-law)

[De Morgan's law](/ap-comp-sci-a/key-terms/de-morgans-law "fv-autolink") (EK 2.6.A.2) tells you that `!(a && b)` equals `!a || !b` and `!(a || b)` equals `!a && !b`. A truth table is how you *prove* that claim. De Morgan's is the shortcut, the truth table is the receipt.

### Object reference comparison (Unit 2)

Topic 2.6 also covers comparing references with `==`, `!=`, and `equals` (LO 2.6.B). These comparisons produce Boolean values too, so the same equivalence thinking applies. The [expression](/ap-comp-sci-a/key-terms/expression "fv-autolink") `ref != null` is just another Boolean you can reason about in all cases.

### Conditional statements and loops (Unit 2)

Every `if`, `else if`, and `while` runs on a [Boolean](/ap-comp-sci-a/unit-1/variables-and-primitive-data-types/study-guide/rezA6f3hJz84TKaY5Jjl "fv-autolink") condition. When you simplify a messy condition like `!(score >= 60)` into `score < 60`, you're doing equivalence work that a truth table could verify. Cleaner conditions mean fewer logic bugs in FRQ code.

## On the AP Exam

You won't be handed a blank truth table to fill in on the AP exam. Instead, multiple-choice questions test the *skill* a truth table represents. A typical stem shows a Boolean expression, often a negated compound condition like `!(x < 3 || y == 7)`, and asks which answer choice is equivalent. The fast path is De Morgan's law; the safe path when you're unsure is mentally checking a few true/false combinations, which is a mini truth table in your head. Watch for trap answers that match the original expression in *some* cases but not all, because equivalence requires matching in every case (EK 2.6.A.1). No released FRQ asks for a truth table by name, but writing correct, simplified conditions in your FRQ code is where this skill quietly earns points.

## truth tables vs De Morgan's law

These two get blurred because they show up in the same topic. De Morgan's law is a *rule* for rewriting expressions (distribute the `!` and flip `&&`/`||`). A truth table is a *method* for verifying that any rewrite, De Morgan's or otherwise, is actually equivalent. De Morgan's gives you the answer fast; the truth table proves the answer is right.

## Key Takeaways

- Two Boolean expressions are equivalent only if they produce the same result in every possible case, and a truth table checks every case by listing them all.
- A truth table needs 2^n rows for n Boolean variables, so two variables means 4 rows and three variables means 8 rows.
- If the output columns of two truth tables match on every single row, the expressions are equivalent; if they differ in even one row, they are not.
- Truth tables are the proof behind De Morgan's law, which says !(a && b) equals !a || !b and !(a || b) equals !a && !b.
- On the exam, equivalence questions are usually multiple choice, and testing a couple of true/false combinations in your head can eliminate wrong answers quickly.

## FAQs

### What is a truth table in AP Computer Science A?

It's a table that lists every possible true/false combination of the variables in a Boolean expression and the expression's result for each combination. In Topic 2.6, it's the tool for proving two Boolean expressions are equivalent (EK 2.6.A.1).

### Do I have to draw truth tables on the AP CSA exam?

No. The exam never asks you to fill in a truth table directly. It tests the underlying skill, usually with multiple-choice questions asking which expression is equivalent to a given one, like recognizing that !(a || b) means !a && !b.

### What's the difference between a truth table and De Morgan's law?

De Morgan's law is a rewriting rule (negate each part and swap && with ||), while a truth table is a verification method that checks all cases. You'd use De Morgan's to transform an expression and a truth table to prove the transformation is correct.

### How do you use a truth table to prove two Boolean expressions are equivalent?

Build a table with one row for every combination of variable values (4 rows for two variables, 8 for three), evaluate both expressions in each row, and compare the output columns. If they match on all rows, the expressions are equivalent; one mismatch means they're not.

### How many rows does a truth table have?

2^n rows, where n is the number of Boolean variables. Each variable can be true or false, so every new variable doubles the number of combinations you have to check.

## Related Study Guides

- [2.6 Equivalent Boolean Expressions](/ap-comp-sci-a/unit-2/equivalent-boolean-expressions/study-guide/aMDnyFuOcAXnZigLW1vL)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ap-comp-sci-a/key-terms/truth-tables#resource","name":"Truth Tables — AP CSA Definition & Boolean Logic Guide","url":"https://fiveable.me/ap-comp-sci-a/key-terms/truth-tables","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-a/key-terms/truth-tables#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-11T05:27:18.574Z","isPartOf":{"@type":"Collection","name":"AP Computer Science A Key Terms","url":"https://fiveable.me/ap-comp-sci-a/key-terms"},"publisher":{"@type":"Organization","name":"Fiveable","url":"https://fiveable.me"}},{"@type":"DefinedTerm","@id":"https://fiveable.me/ap-comp-sci-a/key-terms/truth-tables#term","name":"truth tables","description":"A truth table is a systematic chart listing every possible combination of true/false values for the variables in a Boolean expression along with the expression's result. In AP CSA (EK 2.6.A.1), two expressions are equivalent if their truth tables match in every row.","url":"https://fiveable.me/ap-comp-sci-a/key-terms/truth-tables","inDefinedTermSet":{"@type":"DefinedTermSet","name":"AP Computer Science A Key Terms","url":"https://fiveable.me/ap-comp-sci-a/key-terms"}},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is a truth table in AP Computer Science A?","acceptedAnswer":{"@type":"Answer","text":"It's a table that lists every possible true/false combination of the variables in a Boolean expression and the expression's result for each combination. In Topic 2.6, it's the tool for proving two Boolean expressions are equivalent (EK 2.6.A.1)."}},{"@type":"Question","name":"Do I have to draw truth tables on the AP CSA exam?","acceptedAnswer":{"@type":"Answer","text":"No. The exam never asks you to fill in a truth table directly. It tests the underlying skill, usually with multiple-choice questions asking which expression is equivalent to a given one, like recognizing that !(a || b) means !a && !b."}},{"@type":"Question","name":"What's the difference between a truth table and De Morgan's law?","acceptedAnswer":{"@type":"Answer","text":"De Morgan's law is a rewriting rule (negate each part and swap && with ||), while a truth table is a verification method that checks all cases. You'd use De Morgan's to transform an expression and a truth table to prove the transformation is correct."}},{"@type":"Question","name":"How do you use a truth table to prove two Boolean expressions are equivalent?","acceptedAnswer":{"@type":"Answer","text":"Build a table with one row for every combination of variable values (4 rows for two variables, 8 for three), evaluate both expressions in each row, and compare the output columns. If they match on all rows, the expressions are equivalent; one mismatch means they're not."}},{"@type":"Question","name":"How many rows does a truth table have?","acceptedAnswer":{"@type":"Answer","text":"2^n rows, where n is the number of Boolean variables. Each variable can be true or false, so every new variable doubles the number of combinations you have to check."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"AP Computer Science A","item":"https://fiveable.me/ap-comp-sci-a"},{"@type":"ListItem","position":2,"name":"Key Terms","item":"https://fiveable.me/ap-comp-sci-a/key-terms"},{"@type":"ListItem","position":3,"name":"Unit 2","item":"https://fiveable.me/ap-comp-sci-a/unit-2"},{"@type":"ListItem","position":4,"name":"truth tables"}]}]}
```
