AP CSP Topic 3.18: Undecidable Problems | Big Idea 3 | APCSExamPrep.com

AP CSP Course Big Idea 3 Topic 3.18: Undecidable Problems
🎓54.5% score 5s vs 9.6% nationally
5.0 Wyzant — 451+ reviews
📍Blue Valley North, Overland Park KS
3.18
AP CSP — Big Idea 3: Algorithms & Programming
CED Aligned • Exam Ready

Topic 3.18: Undecidable Problems

🎓 High School AP
💻 Python + AP Pseudocode
🎯 30-35% Exam Weight
📚 Interactive Lesson

🎯 Learning Objectives

  • Define what it means for a problem to be undecidable
  • Explain the halting problem and why no general solution exists
  • Distinguish undecidable from merely difficult (unreasonable efficiency)
  • Recognize the limits of what computing can and cannot accomplish
📈
Exam Impact: Undecidable problems is a conceptual endpoint of BI3. The AP exam tests understanding of the halting problem and what undecidable means.
💡 Why This Matters

Can a program check any other program for infinite loops and always give the right answer? Mathematicians proved in 1936 that it's impossible -- not because we haven't found the algorithm yet, but because no such algorithm can exist. Ever.

What Is an Undecidable Problem?

A decidable problem has an algorithm that always gives a correct yes/no answer in finite time. An undecidable problem cannot -- no algorithm exists that correctly answers all possible instances.

Undecidable is different from inefficient. An inefficient problem CAN be solved; it just takes a long time. An undecidable problem CANNOT be solved by any algorithm.

# We CANNOT write this correctly for all inputs:
def will_halt(program, input):
    # No algorithm can always return
    # True or False correctly here.
    # This is the Halting Problem.
    pass
{The halting problem asks:}
{Given any program P and input I,}
{will P eventually stop?}

{No algorithm can answer this}
{for ALL possible programs.}
{It is undecidable.}

The Halting Problem

Alan Turing proved in 1936 that no algorithm can determine, for every possible program and input, whether the program will halt or run forever. The proof uses a contradiction: assume a halting-checker H exists. Build a program P that does the opposite of what H predicts. P breaks H. Therefore H cannot exist.

AP exam point: The halting problem shows computing has fundamental mathematical limits. Some problems are not just hard -- they are provably impossible.

Practice Problems

🔎 Practice MCQ
Which BEST describes an undecidable problem?
🔎 Practice MCQ
The halting problem proves no algorithm can determine halting for every program. Which conclusion is CORRECT?
⚠️ Predict your answer BEFORE clicking.
🔎 Practice MCQ
A student says: 'The halting problem is just an efficiency problem -- given enough time it could be solved.' What is wrong?
I. Efficiency problems are solvable given time; undecidable problems cannot be solved at all
II. The halting problem has been proven mathematically impossible, not just slow
III. Given infinite time, all programs produce an answer
⚠️ Predict your answer BEFORE clicking.
🎮 Game
Decidable or Undecidable?
Classify each problem as decidable or undecidable. 8 questions.
0
Correct
1/8
Question
0
Streak 🔥
🤔 Evaluate:
0/8
correct
💻 Python Code Editor
Practice Problems
Write Python and check your answer. Paste into Replit for complex programs.
Problem 1 of 3
Print decidable if a primality-checking function for any number can exist. Expected: decidable
Hint: Primality testing has a well-defined algorithm for all inputs. It is decidable.
Problem 2 of 3
Print undecidable to reflect the classification of the general halting problem. Expected: undecidable
Hint: The halting problem is undecidable.
Problem 3 of 3
Print whether efficiency_problem or undecidable describes a problem solvable in 2^n steps. Expected: efficiency_problem
Hint: Exponential time = unreasonable efficiency, but the problem IS solvable. Undecidable = not solvable at all.

Frequently Asked Questions

No. There are infinitely many undecidable problems. The halting problem is most famous because it is intuitive and foundational.
Yes. We can write programs that correctly answer SOME inputs (but not all). Heuristics provide good-enough answers for practical cases.
A decidable problem is one where you can write a program that, given any valid input, always terminates and returns the correct yes/no answer in finite time.
📦
AP CSP Teacher SuperpackSlides, lesson plans, unit tests for all 5 Big Ideas — $249
Get the Superpack →

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]