Skip to content

Problems - Computation

A problem is a well-defined question that we want an algorithm to solve.

It consists of:

  • Input: Some data or value(s)
  • Output: A required answer based on the input

A problem is solved if there exists an algorithm that produces the correct output for every valid input.

In theoretical computer science and computational complexity theory, problems are categorized based on how difficult they are to solve or verify, using formal models like Turing machines. There’s no fixed number of categories, but here’s a structured list of the most widely recognized problem classes, from basic to advanced:


1. Decidable vs Undecidable Problems

Decidable (Computable)

Problems for which an algorithm exists that solves it in finite time.

  • Example: Is a number even?
  • Class: Turing-decidable

Undecidable

No algorithm can solve these problems for all inputs.

  • Example: Halting Problem
  • Often involves self-reference or infinite loops
  • Class: Not Turing-decidable

2. Within Decidable: Complexity Classes

These are the most important categories of decision problems based on time and space complexity:

ClassDescription
PSolvable in polynomial time (O(n^k))
NPVerifiable in polynomial time; solution may be hard to find
co-NPComplements of NP problems (e.g., "is this formula unsatisfiable?")
NP-completeHardest problems in NP; if one is in P, all NP problems are in P
NP-hardAt least as hard as NP-complete but may not be in NP (e.g., optimization problems)
EXP (EXPTIME)Solvable in exponential time (O(2^n)); bigger than P or NP
PSPACESolvable using polynomial space (regardless of time)
EXPSPACESolvable using exponential space
BPPBounded-error probabilistic polynomial time (randomized algorithms)
ZPP, RP, co-RPRandomized classes with different guarantees
LSolvable in logarithmic space (very small memory)
NLNondeterministic log space
#PCounting problems (e.g., how many solutions exist to a SAT problem?)
PHPolynomial hierarchy (nested levels of NP and co-NP)

TypeWhat it AsksExample
DecisionYes/No questionsIs there a path < 10km?
SearchFind the actual solutionWhat is the path < 10km?
OptimizationFind the best possible solutionWhat is the shortest path?

→ Often, NP-complete problems are decision versions of NP-hard optimization problems.


4. Semantic Categories

CategoryDescription
TractableProblems solvable in "reasonable" (polynomial) time
IntractableProblems that require exponential or worse time
ApproximationHard to solve exactly, but can be approximated
ParameterizedComplexity depends on certain input parameters
Online problemsInput arrives piece-by-piece; decisions must be made in real-time

5. For Undecidable Problems

These are usually not solvable by any algorithm:

ClassExample Problem
RE (Recursively Enumerable)You can enumerate the “yes” answers (e.g., Halting Problem)
co-REYou can enumerate the “no” answers
Not REEven unrecognizable problems

Visual Hierarchy (Simplified)

All Problems
├── Decidable
│   ├── P
│   ├── NP
│   │   ├── NP-complete
│   ├── co-NP
│   ├── PSPACE
│   ├── EXP
│   └── ...
└── Undecidable
    ├── RE
    ├── co-RE
    └── Not RE

Summary

CategoryHow Many?Contains Problems Like…
Basic Divide2Decidable, Undecidable
Complexity Classes15+P, NP, co-NP, NP-complete, EXP, PSPACE…
Problem Types3Decision, Search, Optimization
Randomized4+BPP, RP, co-RP, ZPP
Counting & Others5+#P, PH, L, NL, EXPSPACE…

  • "Introduction to the Theory of Computation" by Michael Sipser
  • "Computational Complexity: A Modern Approach" by Arora & Barak

Powered by VitePress