Decidable Problem

In AP Computer Science Principles, a decidable problem is a decision problem for which an algorithm can be written that produces a correct yes-or-no output for ALL possible inputs (EK AAP-4.B.1), like asking "Is this number even?"

Verified for the 2027 AP Computer Science Principles examLast updated June 2026

What is Decidable Problem?

A decidable problem is a decision problem (a question with a yes-or-no answer) where you can write one algorithm that gives the correct answer for every single input, no exceptions. The CED's go-to example is "Is the number even?" You can write a tiny program (check if the number mod 2 equals 0) and it works for 4, for 7, for 9,000,001, for literally any integer you throw at it. That universal coverage is the whole definition.

The word "all" is doing the heavy lifting here. It's not enough for an algorithm to work for some inputs or most inputs. If a correct algorithm exists that handles every case, the problem is decidable. If no such algorithm can ever exist (not "we haven't found one yet," but "it's mathematically impossible to build one"), the problem is undecidable. Decidable problems are the baseline that makes the famous undecidable ones, like the Halting Problem, so surprising.

Why Decidable Problem matters in AP Computer Science Principles

Decidable problems live in Topic 3.18 (Undecidable Problems) in Unit 3: Algorithms and Programming, supporting learning objective 3.18.A, explaining the existence of undecidable problems in computer science. You can't understand what undecidable means without first nailing down decidable, since the two definitions are mirror images (EK AAP-4.B.1 and AAP-4.B.2). This topic is the moment AP CSP zooms out from writing algorithms to asking what algorithms can do at all. The big idea is that computers have hard mathematical limits. Some problems can't be solved by any algorithm ever, no matter how fast hardware gets. Knowing the decidable/undecidable line is how you explain that limit on the exam.

How Decidable Problem connects across the course

Undecidable Problem (Unit 3)

This is the direct opposite. An undecidable problem is one where no algorithm can be built that always gives a correct yes-or-no answer. Decidable means "an algorithm covers all inputs," undecidable means "no algorithm ever can." The exam loves testing whether you can tell these apart.

Halting Problem (Unit 3)

The classic example of an undecidable problem. Asking "will this program ever stop running?" sounds like a normal decision problem, but it's been proven that no algorithm can answer it correctly for all program-and-input combinations. It's the proof that the decidable category doesn't cover everything.

Turing Machine (Unit 3)

Alan Turing's abstract model of computation is the theoretical machine behind the whole decidable/undecidable distinction. "Decidable" really means "a Turing machine can decide it," which is why the limit applies to every computer, not just the ones we've built so far.

Is Decidable Problem on the AP Computer Science Principles exam?

This term shows up as multiple-choice only, and the questions are conceptual, not technical. Expect stems that ask you to distinguish undecidable from merely difficult or slow (a hard problem that an algorithm can solve is still decidable), or to explain the implications of undecidable problems for computer science. One huge piece of good news from the CED's exclusion statement is that you will never be asked to determine whether a specific given problem is undecidable. You just need the definitions and the big idea. Watch for trap answers that confuse "no algorithm exists" (undecidable) with "the algorithm would take too long" (decidable but inefficient), and remember EK AAP-4.B.3, which says an undecidable problem can still have some instances with algorithmic solutions, just not a single algorithm that solves all of them.

Decidable Problem vs Undecidable Problem

Decidable means an algorithm exists that gives the correct yes-or-no answer for every input (like checking if a number is even). Undecidable means no such algorithm can ever exist for all inputs (like the Halting Problem). The trap is thinking undecidable means "really hard" or "slow." A problem that takes a million years to solve is still decidable. Undecidability is about impossibility, not difficulty.

Key things to remember about Decidable Problem

  • A decidable problem is a decision problem where one algorithm can produce the correct yes-or-no output for all possible inputs (EK AAP-4.B.1).

  • The CED's standard example of a decidable problem is "Is the number even?" because a simple algorithm answers it correctly for every integer.

  • Decidable is the opposite of undecidable, where no algorithm can be constructed that always gives a correct answer (EK AAP-4.B.2).

  • A slow or computationally expensive problem is still decidable; undecidability means no correct algorithm exists at all, not that one would take too long.

  • An undecidable problem can have some individual instances that are solvable, but no single algorithm solves every instance (EK AAP-4.B.3).

  • The AP exam will never ask you to prove or determine that a specific problem is undecidable; that's explicitly excluded from the course.

Frequently asked questions about Decidable Problem

What is a decidable problem in AP Computer Science Principles?

A decidable problem is a decision problem for which an algorithm can be written that produces a correct yes-or-no answer for all possible inputs. The CED's example is "Is the number even?" since a mod-2 check works on every integer.

What's the difference between a decidable and an undecidable problem?

Decidable means a correct algorithm exists for all inputs; undecidable means it's mathematically impossible to build one. The Halting Problem is the famous undecidable example, while checking evenness is the classic decidable one.

Is a really hard or slow problem the same as an undecidable problem?

No. Difficulty and decidability are separate things. A problem that takes years of computation but has a correct algorithm is still decidable. Undecidable means no algorithm can ever give a correct answer for all inputs, regardless of time or computing power.

Do I need to prove whether a problem is decidable on the AP CSP exam?

No. The CED's exclusion statement says determining whether a given problem is undecidable is outside the scope of the course and exam. You only need to know the definitions and explain that undecidable problems exist.

Can part of an undecidable problem still be solved by an algorithm?

Yes. EK AAP-4.B.3 says an undecidable problem may have some instances with algorithmic solutions. What's impossible is a single algorithm that correctly handles every instance, which is what would make it decidable.