A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Partial vs. Total Recursive Functions

Graduate Depth 84 in the knowledge graph I know this Set as goal
21topics build on this
451prerequisites beneath it
See this on the map →
General Recursive Functions and the μ-OperatorMu-Recursive FunctionsDecidable and Semi-Decidable LanguagesTuring Degrees
recursion partial-functions computability

Core Idea

Partial recursive functions (computable by Turing machines) may not halt on all inputs, while total recursive functions halt on every input. Not all computable functions are total: the halting problem shows no total recursive function can predict if an arbitrary program halts. This gap between partial and total computability is foundational to undecidability.

How It's Best Learned

Write examples of partial functions (e.g., integer division when denominator is computed) and total functions, then study the proof that some total functions are not computable.

Common Misconceptions

Explainer

You have already studied general recursive (µ-recursive) functions, which extend primitive recursion with the minimization operator µ. The µ-operator searches for the least input satisfying a predicate — and it may search forever if no such input exists. This possibility of non-termination is precisely what introduces partiality: a partial recursive function is one that may be undefined on some inputs (meaning a Turing machine computing it diverges on those inputs). A total recursive function, by contrast, halts and returns a value on every input without exception.

Partiality is not a defect in the theory; it is an unavoidable feature of any sufficiently powerful computational model. Any system capable of simulating other programs — including Turing machines — will inevitably contain programs that loop forever on some inputs. You cannot excise all non-terminating programs while preserving the same expressive power. More precisely, the set of total recursive functions is not recursively enumerable: there is no algorithm that, given a program description, decides whether that program is total.

This asymmetry is the crux of the halting problem's undecidability, which you will explore next. If totality were decidable, you could decide halting: to ask whether M halts on w, build a new function f that, on any input, simulates M on w and outputs 0 if M halts — then ask whether f is total. Since halting is undecidable, totality must be undecidable too. The argument works by a diagonalization similar to Cantor's: any hypothetical totality-tester could be used to construct a self-defeating function, producing a contradiction.

The practical lesson is directional: computability and termination are distinct properties that do not imply each other. You can write a partial function that always gives the correct answer whenever it terminates, or a total function that always terminates but cannot solve certain problems at all. The partial recursive functions are exactly the computable functions — those computed by some Turing machine. The total computable functions are a strict subset. The gap between "total recursive" and "all total functions" contains functions that are always defined yet cannot be computed by any algorithm, and understanding that gap is a central project of computability theory.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraIntroduction to Propositional LogicIntroduction to Predicate Logic (First-Order Logic)First-Order Logic SyntaxZFC Axioms OverviewAxiom Schema of SeparationAxiom Schema of ReplacementVon Neumann OrdinalsHereditarily Finite SetsRecursive Definitions on Finite SetsNatural Numbers in Set Theory: Iterative ConstructionFormal Arithmetic and ExpressibilityPrimitive Recursive FunctionsAckermann FunctionGeneral Recursive Functions and the μ-OperatorMu-Recursive FunctionsPartial vs. Total Recursive Functions

Longest path: 85 steps · 451 total prerequisite topics

Prerequisites (2)

Leads To (2)