Fiveable

⌨️AP Computer Science Principles Unit 3 Review

QR code for AP Computer Science Principles practice questions

3.18 Undecidable Problems

3.18 Undecidable Problems

Written by the Fiveable Content Team • Last updated June 2026
Verified for the 2027 exam
Verified for the 2027 examWritten by the Fiveable Content Team • Last updated June 2026
⌨️AP Computer Science Principles
Unit & Topic Study Guides

AP Computer Science Principles Exam

Pep mascot

TLDR

A decidable problem is a yes or no question where an algorithm always gives the correct answer for every possible input. An undecidable problem is one where no single algorithm can always give a correct yes or no answer, even though some specific cases might still be solvable. In AP Computer Science Principles, you need to explain that undecidable problems exist and recognize the difference between problems computers can always solve and problems they cannot.

Why This Matters for the AP Computer Science Principles Exam

This topic shows up on the multiple-choice section, where you may be asked to identify a problem as decidable or undecidable or to explain why some problems have no complete algorithmic solution. It pairs naturally with algorithmic efficiency: that topic covers problems that take too long to solve, while this topic covers problems that cannot be solved by any algorithm for all inputs. You will not be asked to prove that a specific problem is undecidable, since that is outside the scope of the course and exam. The goal is to explain that undecidable problems exist and describe what makes them different from decidable ones.

Key Takeaways

  • A decision problem is any problem with a yes or no answer, like "Is this number even?"
  • A decidable problem has an algorithm that produces a correct answer for all possible inputs.
  • An undecidable problem has no algorithm that can always give a correct yes or no answer for every input.
  • Undecidable does not mean unsolvable in every case. Some individual instances of an undecidable problem can still be solved.
  • The exam asks you to explain that undecidable problems exist, not to prove a problem is undecidable.

Decidable vs Undecidable Problems

Start with the idea of a decision problem: a question that has only two possible answers, yes or no. "Is this number even?" is a decision problem because every number is either even or not.

A decidable problem is a decision problem where you can write an algorithm that gives the correct yes or no answer for every possible input. The "is this number even?" example is decidable because you can check it with a simple rule for any number you are given.

An undecidable problem is a decision problem where no algorithm can be written that always gives a correct yes or no answer. The key word is "always." For an undecidable problem, you cannot build one algorithm that handles every possible input correctly.

Here is the part students often miss: an undecidable problem can still have some instances that are solvable. You might be able to answer the question correctly for certain specific inputs. What makes the problem undecidable is that there is no single algorithm that works for all inputs.

The Halting Problem (Example)

The most famous undecidable problem is the halting problem, which Alan Turing described in 1936. The halting problem asks whether you can write one algorithm that takes any program as input and correctly answers the question, "Will this program eventually stop running, or will it run forever?"

Turing showed that no such algorithm can exist that works for every possible program. This is the classic illustration that some problems simply cannot be solved by an algorithm for all inputs.

Treat the halting problem as a helpful example, not as required content you must memorize in detail. The exam wants you to understand the concept of undecidability, and you will not need to reproduce a formal proof.

How to Use This on the AP Computer Science Principles Exam

MCQ

  • Read the problem carefully and decide if it is a decision problem (yes or no answer) first.
  • If an algorithm can correctly answer for every input, it is decidable. If no algorithm can always answer correctly, it is undecidable.
  • Watch for answer choices that confuse "undecidable" with "takes too long." Those are different ideas. A slow problem can still be decidable.

Common Trap

  • Do not assume undecidable means "impossible to ever answer." Some specific cases of an undecidable problem can still be solved. The issue is that no one algorithm covers all inputs.

Common Misconceptions

  • "Undecidable means a computer can never give an answer." Not quite. A computer can answer some individual cases. The problem is that no single algorithm works for every input.
  • "Undecidable is the same as inefficient or slow." These are separate ideas. An inefficient problem might still be decidable, it just takes a long time. An undecidable problem has no algorithm that always works, no matter how much time you allow.
  • "Every problem has an algorithmic solution if you write good enough code." Some problems are undecidable, so no amount of clever coding produces an algorithm that handles all inputs correctly.
  • "You need to prove a problem is undecidable on the exam." You only need to explain that undecidable problems exist and what makes them different from decidable ones.

Vocabulary

The following words are mentioned explicitly in the College Board Course and Exam Description for this topic.

Term

Definition

algorithm

Step-by-step procedures or sets of rules designed to solve a problem or accomplish a task.

decidable problem

A decision problem for which an algorithm can be written to produce a correct output for all inputs.

decision problem

A problem that requires a yes-or-no answer as output.

undecidable problem

A problem for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer for all instances.

Frequently Asked Questions

What is AP CSP 3.18 about?

AP Computer Science Principles 3.18 is about undecidable problems. You learn that some decision problems have no algorithm that can always produce a correct yes-or-no answer for every possible input.

What is a decidable problem?

A decidable problem is a decision problem for which an algorithm can produce a correct answer for all inputs. A simple example is deciding whether a given number is even.

What is an undecidable problem?

An undecidable problem is a decision problem for which no algorithm can always provide a correct yes-or-no answer for every input. The issue is not speed; it is that a complete algorithmic solution does not exist.

Is the halting problem required for AP CSP?

The halting problem is a useful example of an undecidable problem, but AP CSP does not require you to prove that a specific problem is undecidable. You need to explain that undecidable problems exist and recognize the basic idea.

Does undecidable mean a computer can never solve any case?

No. Some individual instances of an undecidable problem may have an algorithmic solution. What makes the problem undecidable is that no algorithm can solve all possible instances correctly.

How do undecidable problems show up on the AP CSP exam?

Expect conceptual multiple-choice questions that ask you to distinguish decidable from undecidable problems. Watch for answer choices that confuse undecidable with inefficient, because a slow problem can still be decidable.

Pep mascot
Upgrade your Fiveable account to print any study guide

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Click below to go to billing portal → update your plan → choose Yearly→ and select "Fiveable Share Plan". Only pay the difference

Plan is open to all students, teachers, parents, etc
Pep mascot
Upgrade your Fiveable account to export vocabulary

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Plan is open to all students, teachers, parents, etc
report an error
description

screenshots help us find and fix the issue faster (optional)

add screenshot