---
title: "Decision Problem — AP CSP Definition & Exam Guide"
description: "A decision problem is any computational problem with a yes/no answer, like \"is there a path from A to B?\" Key for AP CSP Topic 3.17 and telling it apart from optimization problems."
canonical: "https://fiveable.me/ap-comp-sci-p/key-terms/decision-problem"
type: "key-term"
subject: "AP Computer Science Principles"
unit: "Unit 3"
---

# Decision Problem — AP CSP Definition & Exam Guide

## Definition

In AP Computer Science Principles, a decision problem is a computational problem whose answer is simply yes or no, such as "is this number prime?" or "is there a path from A to B?" It contrasts with an optimization problem, which asks for the best solution among many (EK AAP-4.A.2).

## What It Is

A decision problem is a [problem](/ap-comp-sci-p/unit-3/algorithmic-efficiency/study-guide/jGSWIqW49BtrQ8dqCWFd "fv-autolink") with a yes/no answer. That's the whole definition, and the AP exam takes it literally. "Is 97 prime?" Yes. "Is there a [path](/ap-comp-sci-p/unit-4/internet/study-guide/HouTEH6ypgVs8tNInelL "fv-autolink") from computer A to computer B in this network?" Yes or no. "Does this list contain the number 42?" Yes or no. If the answer to the problem can only be one of two outcomes, it's a decision problem.

The CED (EK AAP-4.A.1 and AAP-4.A.2) sets this up with two distinctions you need. First, a **problem** is a general task ("sorting"), while an **instance** is that task with specific input ("sort the list (2,3,1,7)"). Second, decision problems sit opposite **optimization problems**, which ask for the *best* answer among many options. "Is there a path from A to B?" is a decision problem. "What is the *shortest* path from A to B?" is an [optimization problem](/ap-comp-sci-p/key-terms/optimization-problem "fv-autolink"). Same situation, different question, different problem type.

## Why It Matters

Decision problems live in **Topic 3.17 (Algorithmic Efficiency)** in [Unit 3](/ap-comp-sci-p/unit-3 "fv-autolink"), under learning objective **3.17.A**, which asks you to explain the difference between [algorithms](/ap-comp-sci-p/key-terms/algorithm "fv-autolink") that run in reasonable time and those that don't, and to spot when a heuristic is the smarter move. The decision vs. optimization vocabulary is the entry point to that whole conversation. Classifying a problem is step one; figuring out whether an algorithm can solve it efficiently (or whether you need a heuristic or approximate solution) is step two. The College Board defines these terms precisely in the essential knowledge, so this is one of the rare spots in AP CSP where a question can hinge on whether you memorized an exact definition.

## Connections

### [Optimization Problem (Unit 3)](/ap-comp-sci-p/key-terms/optimization-problem)

This is the partner concept the CED pairs with decision problems in EK AAP-4.A.2. The trick for telling them apart is the question word. "Is there...?" or "Does...?" means decision problem. "What is the best/shortest/cheapest...?" means optimization problem.

### [Heuristic (Unit 3)](/ap-comp-sci-p/key-terms/heuristic)

When a problem can't be solved in [reasonable time](/ap-comp-sci-p/key-terms/reasonable-time "fv-autolink"), LO 3.17.A says a heuristic (a good-enough shortcut) may be more appropriate. Hard optimization problems are where heuristics usually show up, and decision problems give you the vocabulary to describe what's being traded away.

### [Algorithm (Unit 3)](/ap-comp-sci-p/key-terms/algorithm)

An algorithm is the step-by-step process that actually solves a problem. The decision/optimization split describes the *problem*, not the algorithm. The same network of computers can spawn both a decision problem and an optimization problem, each solved by different algorithms.

### [Approximate Solution (Unit 3)](/ap-comp-sci-p/key-terms/approximate-solution)

Optimization problems can settle for an [approximate solution](/ap-comp-sci-p/key-terms/approximate-solution "fv-autolink") that's close to the best. Decision problems can't, because there's no "approximately yes." That asymmetry is a clean way to remember the difference between the two problem types.

## On the AP Exam

This term shows up in multiple-choice questions, and they're refreshingly direct. Typical stems ask you to pick which scenario is a decision problem rather than an optimization problem, to classify a real situation (like "can a network of computers communicate with each other?") and explain why, or to identify what is NOT a characteristic of a decision problem. Your job is classification. Read the question being asked in the scenario and check whether it has a yes/no answer or asks for a best answer. Watch for traps where the same setup is worded both ways. "Is there a route under 100 miles?" is a decision problem even though it mentions distance, because the answer is still just yes or no.

## Decision Problem vs Optimization Problem

Both can describe the exact same situation, which is why they're easy to mix up. A decision problem asks a yes/no question ("is there a path from A to B?"), while an optimization problem asks for the best solution among many ("what is the shortest path from A to B?"). The quickest test is the form of the answer. If it's yes or no, it's a decision problem. If it's a specific best route, value, or arrangement, it's optimization. Note that adding a threshold turns optimization into decision: "is there a path shorter than 10 miles?" is back to yes/no.

## Key Takeaways

- A decision problem is a computational problem whose answer is yes or no, like determining whether a number is prime.
- An optimization problem asks for the best solution among many, like the shortest path from A to B, while a decision problem only asks whether something is true.
- A problem is a general task (sorting), while an instance is that problem with specific input (sorting the list (2,3,1,7)).
- The same scenario can produce both types: "is there a path from A to B?" is a decision problem, and "what is the shortest path from A to B?" is an optimization problem.
- On the AP exam, classify by the answer's form: yes/no means decision, best-among-many means optimization, even if the wording sounds quantitative.
- Decision problems appear in Topic 3.17 alongside reasonable vs. unreasonable time and heuristics, all under learning objective 3.17.A.

## FAQs

### What is a decision problem in AP Computer Science Principles?

A decision problem is a computational problem with a yes/no answer, defined in EK AAP-4.A.2 of Topic 3.17. Classic examples are "is this [number](/ap-comp-sci-p/unit-3/variables-assignments/study-guide/vtJhAf5XFOkm1uHNDMvh "fv-autolink") prime?" and "is there a path from A to B?"

### What's the difference between a decision problem and an optimization problem?

A decision problem has a yes/no answer, while an optimization problem seeks the best solution among many. "Is there a path from A to B?" is decision; "what is the shortest path from A to B?" is optimization.

### Are all yes/no questions decision problems?

In the AP CSP framing, yes. If a computational problem's answer can only be yes or no, it's a decision problem by definition. Be careful in reverse, though: a question that mentions numbers can still be a decision problem if the final answer is yes/no, like "is there a route under 100 miles?"

### Is a decision problem the same as a problem instance?

No. "Decision problem" describes the type of question (yes/no answer), while an instance is any problem plus a specific input. "Is a number prime?" is a decision problem; "is 97 prime?" is an instance of it (EK AAP-4.A.1).

### Do I need to know decision problems for the AP CSP exam?

Yes. The term is explicitly defined in the CED under Topic 3.17 (learning objective 3.17.A), and multiple-choice questions ask you to classify scenarios as decision problems vs. optimization problems and explain why.

## Related Study Guides

- [3.17 Algorithmic Efficiency](/ap-comp-sci-p/unit-3/algorithmic-efficiency/study-guide/jGSWIqW49BtrQ8dqCWFd)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ap-comp-sci-p/key-terms/decision-problem#resource","name":"Decision Problem — AP CSP Definition & Exam Guide","url":"https://fiveable.me/ap-comp-sci-p/key-terms/decision-problem","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-p/key-terms/decision-problem#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-11T00:50:13.996Z","isPartOf":{"@type":"Collection","name":"AP Computer Science Principles Key Terms","url":"https://fiveable.me/ap-comp-sci-p/key-terms"},"publisher":{"@type":"Organization","name":"Fiveable","url":"https://fiveable.me"}},{"@type":"DefinedTerm","@id":"https://fiveable.me/ap-comp-sci-p/key-terms/decision-problem#term","name":"Decision Problem","description":"In AP Computer Science Principles, a decision problem is a computational problem whose answer is simply yes or no, such as \"is this number prime?\" or \"is there a path from A to B?\" It contrasts with an optimization problem, which asks for the best solution among many (EK AAP-4.A.2).","url":"https://fiveable.me/ap-comp-sci-p/key-terms/decision-problem","inDefinedTermSet":{"@type":"DefinedTermSet","name":"AP Computer Science Principles Key Terms","url":"https://fiveable.me/ap-comp-sci-p/key-terms"},"educationalAlignment":[{"@type":"AlignmentObject","alignmentType":"educationalSubject","educationalFramework":"AP® Course and Exam Description","targetName":"AP® Computer Science Principles Unit 3, Topic 3.17, LO 3.17.A"}]},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is a decision problem in AP Computer Science Principles?","acceptedAnswer":{"@type":"Answer","text":"A decision problem is a computational problem with a yes/no answer, defined in EK AAP-4.A.2 of Topic 3.17. Classic examples are \"is this [number](/ap-comp-sci-p/unit-3/variables-assignments/study-guide/vtJhAf5XFOkm1uHNDMvh \"fv-autolink\") prime?\" and \"is there a path from A to B?\""}},{"@type":"Question","name":"What's the difference between a decision problem and an optimization problem?","acceptedAnswer":{"@type":"Answer","text":"A decision problem has a yes/no answer, while an optimization problem seeks the best solution among many. \"Is there a path from A to B?\" is decision; \"what is the shortest path from A to B?\" is optimization."}},{"@type":"Question","name":"Are all yes/no questions decision problems?","acceptedAnswer":{"@type":"Answer","text":"In the AP CSP framing, yes. If a computational problem's answer can only be yes or no, it's a decision problem by definition. Be careful in reverse, though: a question that mentions numbers can still be a decision problem if the final answer is yes/no, like \"is there a route under 100 miles?\""}},{"@type":"Question","name":"Is a decision problem the same as a problem instance?","acceptedAnswer":{"@type":"Answer","text":"No. \"Decision problem\" describes the type of question (yes/no answer), while an instance is any problem plus a specific input. \"Is a number prime?\" is a decision problem; \"is 97 prime?\" is an instance of it (EK AAP-4.A.1)."}},{"@type":"Question","name":"Do I need to know decision problems for the AP CSP exam?","acceptedAnswer":{"@type":"Answer","text":"Yes. The term is explicitly defined in the CED under Topic 3.17 (learning objective 3.17.A), and multiple-choice questions ask you to classify scenarios as decision problems vs. optimization problems and explain why."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"AP Computer Science Principles","item":"https://fiveable.me/ap-comp-sci-p"},{"@type":"ListItem","position":2,"name":"Key Terms","item":"https://fiveable.me/ap-comp-sci-p/key-terms"},{"@type":"ListItem","position":3,"name":"Unit 3","item":"https://fiveable.me/ap-comp-sci-p/unit-3"},{"@type":"ListItem","position":4,"name":"Decision Problem"}]}]}
```
