All mock tests are FREE till 31 December — register to save your progress

Given the functions:
Predecessor function: Pred(x) = x − 1
and T(x, y+1) = Pred(T(x, y)), T(x, 0) = x.
Which of the following operations is a candidate for T?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. Subtraction Operation

Explanation

This is a primitive recursive definition: T(x, 0) = x, and T(x, y+1) = Pred(T(x, y)) = T(x, y) − 1. Unrolling the recursion, each increment of y subtracts 1 more from x, so T(x, y) = x − y. This is exactly the subtraction operation defined recursively in terms of the predecessor function, a classic construction in primitive recursive function theory.

More Theory of Computation and Compilers questions