A problem is described as "a decision problem for which an algorithm can be constructed that always produces a correct yes-or-no answer for all possible inputs." What term does this definition describe?
Opening subject page...
Loading your content
AP Computer Science Principles Quiz
Practice Undecidable Problems in AP Computer Science Principles with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.
Question 1 / 20
0 of 20 answered
A problem is described as "a decision problem for which an algorithm can be constructed that always produces a correct yes-or-no answer for all possible inputs." What term does this definition describe?
This quiz focuses on Undecidable Problems, giving you a quick way to practice the rules, question types, and explanations that matter most for AP Computer Science Principles.
Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.
A problem is described as "a decision problem for which an algorithm can be constructed that always produces a correct yes-or-no answer for all possible inputs." What term does this definition describe?
Explanation: This is the formal definition of a decidable problem. It focuses on the existence of a universally correct and terminating algorithm. The other options describe different classes of problems related to efficiency, approximation, or finding the best solution, rather than just determining a yes/no answer.
What is the overall significance of the existence of undecidable problems for the field of computer science?
Explanation: The discovery of undecidable problems was a landmark in computer science because it established that there are clear, provable boundaries to what computers can solve algorithmically. It defined the limits of computation. Option (B) is the opposite of the implication. Options (C) and (D) are about strategies for difficult problems, not the fundamental meaning of undecidability.
Which of the following is the defining characteristic of an undecidable problem in computer science?
Explanation: The definition of an undecidable problem is one for which no algorithm can be constructed that always provides a correct yes-or-no answer for every possible input. The other options describe different types of difficult problems: (A) describes a problem that runs in an unreasonable amount of time, (C) describes an optimization problem often solved with heuristics, and (D) describes a problem limited by hardware, not by the theoretical limits of computation.
Consider the problem of determining if any given computer program, when run on any given input, will eventually print the word "SUCCESS". It has been proven that no single algorithm can be designed to solve this problem for all possible program-input pairs. What type of problem is this?
Explanation: The problem as described is a classic undecidable problem. The stem explicitly states that no single algorithm can solve it for all cases, which is the definition of undecidability. The reasoning in (A) is flawed because if the program runs forever without printing "SUCCESS", you never get a definitive "no" answer. It is a yes/no decision problem, not an optimization problem (B). It is not about complexity or speed (D) but about theoretical computability.
A programmer creates a new software tool CHECKEQUALS that takes two programs as input. The tool can sometimes determine if the two programs produce the same output for all possible inputs, but for some pairs of programs, it runs forever without giving an answer. Which statement best explains this behavior?
Explanation: The problem of determining if two programs are equivalent for all inputs is a well-known undecidable problem in computer science. The behavior described—working for some cases but failing to terminate for others—is characteristic of an attempt to solve an undecidable problem. Therefore, the issue is the nature of the problem itself, not an inefficient or buggy implementation of a possible algorithm.
A computer science problem has been proven to be undecidable. A company still needs a way to handle this problem for its customers. Which of the following is the most practical and common strategy for the company to adopt?
Explanation: Since the general problem is unsolvable, a common and practical approach is to identify a useful, restricted version of the problem that is decidable and solve that instead. This provides value to customers without attempting the impossible. Options (A) and (D) misunderstand that undecidability is a proven theoretical limit. Option (C) is too pessimistic, as useful partial solutions often exist.
A problem is determined to be undecidable. This means its fundamental unsolvability is due to which of the following?
Explanation: Undecidability is a concept from the theory of computation that establishes fundamental limits on what algorithms can do. It is not a limitation of current hardware (B), programming languages (C), or the reliability of physical machines (D).
A software company wants to create an antivirus program that guarantees it can analyze any file and provide a correct "yes" or "no" answer to the question: "Will running this file install malware?" Why is this guarantee impossible to fulfill from a theoretical computer science perspective?
Explanation: The general problem of predicting a program's behavior (in this case, whether it's malicious) is undecidable. This is a variant of the Halting Problem. No algorithm can exist that can analyze any arbitrary program and perfectly predict its behavior. Options (A) and (C) refer to practical limitations (time and memory), but the core issue is theoretical impossibility. Option (D) is a specific case, but the problem is undecidable even for unencrypted files.
In a passage about software verification, undecidable problems were described as having no algorithm that always halted with a correct decision; the Halting Problem asked whether a program stopped; this blocked perfect analyzers; NP-complete problems were different because they remained decidable though sometimes slow. What makes undecidable problems distinct from NP-complete problems according to the text?
Explanation: This question tests understanding of undecidable problems in algorithms and programming (AP CSP). The key distinction between undecidable and NP-complete problems lies in whether they can be solved by any algorithm at all - undecidable problems have no algorithm that always terminates with a correct answer, while NP-complete problems do have algorithms (though they may be exponentially slow). The passage emphasizes that the Halting Problem is undecidable, meaning no algorithm can always correctly determine if a program halts, whereas NP-complete problems remain decidable despite being computationally expensive. Choice B is correct because it captures this fundamental difference: undecidable problems lack any always-correct terminating algorithm, while NP-complete problems have such algorithms even if they're inefficient. Choice D is incorrect as it reverses the relationship - undecidable problems are actually harder than NP-complete problems in that they cannot be solved at all. To help students: Use a hierarchy diagram showing P ⊆ NP ⊆ Decidable problems, with undecidable problems outside this hierarchy entirely.
In a verification-focused passage, undecidable problems were defined as having no algorithm that always halted with correct answers; the Halting Problem asked whether code stopped; this blocked perfect bug-finding; NP-complete problems differed because they stayed decidable though potentially slow. What makes undecidable problems distinct from NP-complete problems according to the text?
Explanation: This question tests understanding of undecidable problems in algorithms and programming (AP CSP). The fundamental distinction between undecidable and NP-complete problems is that undecidable problems have no algorithm that can solve them for all inputs, while NP-complete problems do have algorithms (though potentially exponentially slow ones). The passage emphasizes that the Halting Problem is undecidable, contrasting it with NP-complete problems that remain decidable despite computational challenges. Choice B is correct because it precisely captures this distinction: undecidable problems lack any always-correct terminating algorithm, while NP-complete problems still have one (even if inefficient). Choice A is incorrect as it reverses the relationship - NP-complete problems are decidable but potentially slow, while undecidable problems are impossible to decide algorithmically. To help students: Create examples showing that you can write a brute-force algorithm for any NP-complete problem, but you cannot write any algorithm for the Halting Problem that works on all inputs.
Which of the following best describes a decidable problem?
Explanation: A decidable problem is defined as a decision problem for which an algorithm can be created that will produce a correct output for all inputs. Option (C) is a characteristic of undecidable problems (some instances may be solvable). Option (D) confuses decidability with algorithmic efficiency (running in reasonable time). Option (A) is incorrect because decidability is specifically about algorithmic solvability.
A programmer develops an algorithm that can correctly determine whether certain specific programs will finish running or run forever. However, the programmer finds it is impossible to create a single algorithm that can do this for every possible program. This situation is a classic example of which of the following concepts?
Explanation: This scenario describes the Halting Problem, a famous undecidable problem. The key aspect is that while specific instances can be solved, no single, general algorithm can solve it for all possible inputs (in this case, all possible programs). This is the definition of an undecidable problem. The other options are incorrect classifications.
A computer scientist has published a proof that a particular decision problem is undecidable. What is the most significant implication of this proof?
Explanation: A proof of undecidability is a fundamental, theoretical limit on computation. It means no algorithm can ever solve all instances of the problem, regardless of increases in computer speed, memory, or the invention of new programming languages. The limitation is inherent to the problem itself.
Which of the following statements accurately distinguishes between a problem that is undecidable and a problem that can be solved but takes an unreasonable amount of time?
Explanation: This correctly separates the two concepts. Undecidability is a question of computability (can an algorithm exist at all for every case?), while unreasonable time is a question of complexity (an algorithm exists, but is it practical?). Option (A) is wrong because undecidable means proven unsolvable, not just unsolved. Options (C) and (D) present common misconceptions.
A student claims that any undecidable problem could eventually be solved if computers become infinitely fast. Which of the following statements best refutes this claim?
Explanation: This statement correctly identifies the core misconception. Undecidability means a correct, terminating algorithm for all instances does not exist. An infinitely fast computer running a non-existent algorithm is still unable to solve the problem. Speed cannot compensate for the lack of a method.
A computer science researcher is investigating a decision problem. If the problem is decidable, which of the following must be true?
Explanation: This is the definition of a decidable problem. A problem can be decidable but still take an unreasonable amount of time to solve (A). A decidable problem has an exact algorithm, not just a heuristic one (C). The algorithm must work for all instances, not just some (D).
The Halting Problem asks whether a given program will finish running or continue to run forever for a given input. As it is undecidable, why does it demonstrate a fundamental limit of computation?
Explanation: The Halting Problem is significant because it's a problem about the behavior of algorithms that cannot be solved by any algorithm. This reveals a fundamental limitation: computation cannot perfectly analyze itself. Option (A) relates to efficiency, not undecidability. Option (C) incorrectly attributes the limit to hardware power. Option (D) misunderstands that the problem is theoretical, not language-specific.
What is the primary difference between a problem that has not yet been solved and a problem that has been proven to be undecidable?
Explanation: This statement correctly distinguishes between the current state of human knowledge (a problem is "unsolved") and a fundamental, proven property of the problem itself (it is "undecidable"). An unsolved problem may one day have an algorithm, but an undecidable problem never will. The other options introduce incorrect or irrelevant distinctions.
Which of the following problems is guaranteed to be decidable?
Explanation: If a problem has a finite number of possible inputs, an algorithm can be constructed to solve it. In the worst case, the algorithm could be a giant lookup table containing the correct answer for every single possible input. Since the number of inputs is finite, this lookup table is finite, and the algorithm is guaranteed to exist and terminate. The other options do not provide such a guarantee.
An algorithm successfully solves a particular instance of a problem. What can be concluded about the decidability of the problem based on this single result?
Explanation: Solving one instance, or even many instances, of a problem does not prove that the problem is decidable. To be decidable, an algorithm must exist that can solve every possible instance of the problem. Undecidable problems can often have many solvable instances, so a single success proves nothing about the general case.