Skip to content
ComputerCS
Start learning

Algorithms and Problem Solving · Lesson 3.3.1–3.3.2

Solvable, Unsolvable, Tractable and Intractable Problems

Understand whether a general algorithm exists for a problem and distinguish feasible polynomial-growth tasks from tasks whose exact solutions can become impractical.

01

Learning objectives

  • Define a solvable problem and an unsolvable problem.
  • Explain the Halting Problem at a conceptual level.
  • Distinguish tractable from intractable problems.
  • Explain why runtime growth matters as input size increases.
  • Recognise that intractable problems may still have useful approximations or restricted solutions.
02

Lesson notes

A solvable problem has an algorithm that produces the required answer for every valid input and terminates after a finite number of steps. Sorting a finite list and calculating a greatest common divisor are examples. An unsolvable problem has no general algorithm that can correctly solve every possible input in the stated problem class.

The Halting Problem asks whether an arbitrary program, given an arbitrary input, will eventually stop or run forever. Alan Turing showed that no general algorithm can always decide this correctly for every program and input. This does not mean we cannot identify many ordinary programs that halt; it means there is no universal perfect decision procedure for all cases.

A tractable problem is one for which an algorithm can solve instances with a cost that grows reasonably as input size increases, commonly polynomial time. An intractable problem is one for which the known exact approaches can require resources that grow so quickly that larger instances become impractical. These are practical complexity descriptions, not claims that an individual input can never be solved.

Input size matters. An algorithm taking O(n) time grows proportionally with n; O(n²) grows much faster as n increases; exponential growth such as O(2ⁿ) can become prohibitive even for moderate input sizes. Real performance also depends on constants, hardware, memory, data structure and the actual input distribution.

For difficult problems, practical systems may use approximation algorithms, heuristics, restricted input domains or domain-specific knowledge. A solution should be clear about whether it is exact, approximate or guaranteed only for a limited class of inputs.

03

Worked code examples

Worked example

The number of checks grows linearly. This contrasts with an algorithm that explores every subset or permutation, whose search space may grow far more quickly.

def linear_work(n):
    checks = 0
    for _ in range(n):
        checks += 1
    return checks

for n in (10, 100, 1000):
    print(n, "input items ->", linear_work(n), "checks")
Output
10 input items -> 10 checks
100 input items -> 100 checks
1000 input items -> 1000 checks
04

Key terminology

Solvable problem

A problem for which a general algorithm can produce the required result and terminate on every valid input.

Unsolvable problem

A problem for which no algorithm can correctly solve all possible instances in the general case.

Halting Problem

The undecidable problem of determining whether an arbitrary program halts on an arbitrary input.

Tractable problem

A problem with an algorithmic cost that remains practical as input size grows.

Intractable problem

A problem whose exact solution cost grows too quickly to be practical for large instances.

05

Common misconceptions

Common mistake

The Halting Problem means no program can be analysed for termination.

Correct understanding

Many particular programs can be analysed; the result is that no universal algorithm decides all possible program-input pairs.

Common mistake

An intractable problem can never be solved for any input.

Correct understanding

Small or restricted instances may be solvable; the difficulty concerns scaling to general larger inputs.

06

Check your understanding

1. What does the Halting Problem ask?

2. Which cost grows faster as n increases?

3. What is a practical strategy for a hard optimisation problem?

NERDLYY · FEEDBACK

Help shape Nerdlyy

Your feedback goes directly to the team. We read every submission.

No reply needed — you can send feedback without sharing contact details.