ArticleslgStudy

mathematics

Primitive recursive function

Primitive recursive function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Primitive recursive function rather than just read about it. In short: In computability theory, a primitive recursive function is, roughly speaking, a function that can be computed by a computer program whose loops are all "for" loops (that is, an upper bound of the number of iterations of every loop is fixed before entering the loop). Primitive recursive functions form a strict subset of those general recursive functions that are also total functions.

Key takeaways

  • Primitive recursive function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Primitive recursive function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Primitive recursive function from memory before moving on to harder problems.

Reference excerpt

In computability theory, a primitive recursive function is, roughly speaking, a function that can be computed by a computer program whose loops are all "for" loops (that is, an upper bound of the number of iterations of every loop is fixed before entering the loop). Primitive recursive functions form a strict subset of those general recursive functions that are also total functions. The importance of primitive recursive functions lies in the fact that most computable functions that are studied in number theory (and more generally in mathematics) are primitive recursive. For example, addition and division, the factorial and exponential function, and the function which returns the nth prime are all primitive recursive. In fact, for showing that a computable function is primitive recursive, it suffices to show that its time complexity is bounded above by a primitive recursive function of the input size. It is hence not particularly easy to devise a computable function that is not primitive recursive; some examples are shown in section § Limitations below. The set of primitive recursive functions is known as PR in computational complexity theory.

Definition A primitive recursive function takes a fixed number of arguments, each a natural number (nonnegative integer: {0, 1, 2, ...}), and returns a natural number. If it takes n arguments, it is called n-ary. The basic primitive recursive functions are given by these axioms:

More complex primitive recursive functions can be obtained by applying the operations given by these axioms:

The primitive recursive functions are the basic functions and those obtained from the basic functions by applying these operations a finite number of times.

Primitive-recursiveness of vector-valued functions A (vector-valued) function f : N m → N n {\displaystyle f:\mathbb {N} ^{m}\to \mathbb {N} ^{n}} is primitive recursive if it can be written as

f ( x 1 , … , x m ) = ( f 1 ( x 1 , … , x m ) , … , f n ( x 1 , … , x m ) ) {\displaystyle f(x_{1},\dots ,x_{m})=(f_{1}(x_{1},\dots ,x_{m}),\dots ,f_{n}(x_{1},\dots ,x_{m}))}

where each component f i : N m → N {\displaystyle f_{i}:\mathbb {N} ^{m}\to \mathbb {N} } is a (scalar-valued) primitive recursive function.

Examples

Addition A definition of the 2-ary function Add {\displaystyle \operatorname {Add} } , to compute the sum of its arguments, can be obtained using the primitive recursion operator ρ {\displaystyle \rho } . To this end, the well-known equations

0 + y = y , S ( x ) + y = S ( x + y ) {\displaystyle {\begin{aligned}0+y&=y,\\S(x)+y&=S(x+y)\end{aligned}}}

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Primitive recursive function

Start with the simplest possible case. Write down what Primitive recursive function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Primitive recursive function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Primitive recursive function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Primitive recursive function

In research
Primitive recursive function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Primitive recursive function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Primitive recursive function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computability theory, Functions and mappings, Recursion, so understanding it makes those chapters shorter.
In everyday life
Look for Primitive recursive function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Primitive recursive function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Primitive recursive function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Primitive recursive function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Primitive recursive function in simple terms?

In computability theory, a primitive recursive function is, roughly speaking, a function that can be computed by a computer program whose loops are all "for" loops (that is, an upper bound of the number of iterations of every loop is fixed before entering the loop). Primitive recursive functions fo…

Why does Primitive recursive function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Primitive recursive function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Primitive recursive function.

Tags

  • Computability theory
  • Functions and mappings
  • Recursion
  • Theory of computation

Keep exploring