Lecture 15: Bounded Minimization and Ackermann's Function - CSCI 381 Goldberg
Administrative Updates
Section titled “Administrative Updates”Homework Assignments:
(1) Ackermann’s Function Computation Exercise
- Attempt to compute A(4, 4) by hand using pencil and paper
- Stop when either: your hand gets tired, or you fill up a sheet of paper without completing the computation
- Not for submission, but strongly encouraged for understanding recursion and the growth rates of functions
(2) Philosophical Analysis of Ackermann’s Function
- Reflect on how Ackermann’s function differs philosophically from primitive recursive functions
- Consider what makes it fundamentally different, beyond just the mathematical fact that it computes something different
- This distinction is significant to understanding the limitations of primitive recursion
Next Class - Possible Schedule Change:
- Next Wednesday’s class may need to be conducted offline via pre-recorded media
- Professor may be attending a conference (confirmation expected by Monday)
- If offline: topic will be on data structures the operating system uses for recursion (related to current topic)
- Email announcement to follow if this change occurs
Summary So Far
Section titled “Summary So Far”Davis (on behalf of Turing) wanted to provide a “reduced instruction set” (RISC) of mathematical functions from which all mathematically computable functions can be computed. He developed primitive recursive for this purpose but then realized (at end of today’s lecture) that primitive recursive does not suffice. Something is missing (discussed next class).
In anticipation, he created a more general class of functions termed a Primitive Recursive Class (PRC) which must have all the primitive recursive functions and possibly in addition, other initial functions and/or other mathematical techniques included.
Primitive Recursive:
- Initial Functions:
- Techniques: Composition and Recursion
Davis goes through a number of highly utilized mathematical functions and proves them to be primitive recursive to show the expressive power of primitive recursive. This leads up to Bounded Minimization (which is the goal of today’s lecture). Although he proves other important primality functions to be primitive recursive, we do not need those as of now.
Additional Boolean Predicates
Section titled “Additional Boolean Predicates”Less Than or Equal to
Section titled “Less Than or Equal to”- Boolean returning 0 or 1
- //PRIM#13
- Composition alone
Greater Than
Section titled “Greater Than”- Boolean returning 0 or 1
- //PRIM#14
- Composition alone
Less Than
Section titled “Less Than”- Boolean returning 0 or 1
- //PRIM#15
- Composition alone
Greater Than or Equal to
Section titled “Greater Than or Equal to”- Boolean returning 0 or 1
- //PRIM#16
- Composition alone
Boolean Logic Operations
Section titled “Boolean Logic Operations”Assuming and are (primitive recursive) boolean predicates:
- //PRIM#17
- Composition alone
- Since the output of is only 0 or 1
- //PRIM#18
- Composition alone
- Since the outputs of and are only 0 or 1
- If or outputs 0, then AND outputs 0; and if AND output 1, then AND outputs 1
- //PRIM#19
- Composition alone
- De Morgan’s Law in essence states that OR is NOT AND; AND is NOT OR
- Originally stated in terms of Union and Intersection of sets, but the membership of Union is OR and the membership of Intersection is AND
IF-THEN-ELSE
Section titled “IF-THEN-ELSE”- //PRIM#20
- Composition alone
- is Boolean and therefore can only have outputs 0 or 1
- If is TRUE (value 1), then (NOT) will return 0; then, the final output of this formula will be
- If is FALSE (value 0), then (NOT) will return 1; then, the final output of this formula will be
Summation and Product Operations
Section titled “Summation and Product Operations”Summation
Section titled “Summation”- “Running” Sum
- //PRIM#21
- Base case:
- Recursive case:
- Where
- is the SUM function
Product
Section titled “Product”- “Running” Product
- //PRIM#22
- Base case:
- Recursive case:
- is the PRODUCT function
Existential Quantifiers on Boolean Predicates
Section titled “Existential Quantifiers on Boolean Predicates”For All (Universal Quantification)
Section titled “For All (Universal Quantification)”Mathematicians use the upside down A notationally for “FOR ALL”
- //PRIM#23
- Is the running product of equal to 1?
- Equivalently:
- Is TRUE for ALL values in the range ?
There Exists (Existential Quantification)
Section titled “There Exists (Existential Quantification)”Mathematicians use the backwards E notationally for “THERE EXISTS”
- //PRIM#24
- If is true for any such , then the summation of over all such would not equal 0
- If is false for all such , then the summation of over all such would equal 0
- Thus, for EXISTS to be TRUE, we don’t want that the summation of equals 0
- Is TRUE for some value(s) in the range ?
Bounded Minimization
Section titled “Bounded Minimization”- //PRIM#25
- Composition alone
Which can be written compactly as:
Interesting Note: The compact formula is actually the namesake of Sigma Pi Alpha, a computer science honor society! This elegant triple combination of summation, product, and the NOT (alpha) function is fundamental to understanding primitive recursive functions.
Concept
Section titled “Concept”What is the first time that is TRUE in the range ?
The formula works by counting how many values before the first true value the predicate is false. Since we start from value 0, when is the first time is TRUE, there are exactly 5 falses before it (at ), so the summation returns 5.
Key Insight: Bounded minimization is in spirit dovetailing “exists” but it’s much more than there exists. While “exists” says that somewhere between 0 and , is true, bounded minimization wants to know the first time that is true between 0 and .
Detailed Example
Section titled “Detailed Example”In this example, is the first time that is TRUE.
Important Assumption (GIGO - Garbage In, Garbage Out): The above formula will only work if you can actually get to . If the parameter , then the formula won’t work as intended because you never reach the point where is true. Therefore, this is a “garbage in, garbage out” situation—if is at least 5, the formula works correctly; otherwise, the results are undefined or incorrect.
P(t) Output Values Table
Section titled “P(t) Output Values Table”| … | ||||||||
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 |
Bounded Minimization Calculation (t = 0 to t = 4)
Section titled “Bounded Minimization Calculation (t = 0 to t = 4)”| Note | |||||||
|---|---|---|---|---|---|---|---|
| 0 | for index | ||||||
| 0 | 0 | for indices | |||||
| 0 | 0 | 0 | for indices | ||||
| 0 | 0 | 0 | 0 | for indices | |||
| 0 | 0 | 0 | 0 | 0 | 1 | for ; for | |
| α values | Product of these = 1 |
For each value of (t = 0 to 4):
- : Checking only . . Product = 1. Sum += 1.
- : Checking . Both give . Product = . Sum += 1. (Running sum = 2)
- : Checking . All give . Product = 1. Sum += 1. (Running sum = 3)
- : Checking . All give . Product = 1. Sum += 1. (Running sum = 4)
- : Checking . All give . Product = 1. Sum += 1. (Running sum = 5)
The SUM OF THESE VALUES (which all equal 1) is 5, the correct answer—identifying that is the first time is true.
What Happens When t ≥ 5 (Continuation)
Section titled “What Happens When t ≥ 5 (Continuation)”Suppose we continue the calculation until :
| … | Note | |||||||
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | … | ||
| 0 | 0 | 0 | 0 | 0 | 1 | … | ||
| 0 | 0 | 0 | 0 | 0 | 1 | … | ||
| … | … | … | … | … | … | … | … | … |
| α values | etc. | Product = 0 |
Key Observation: Once we reach , we have , so appears in the product. Since the product now contains a zero, the product becomes 0 and remains 0 for all subsequent values. When the product is 0, nothing is added to the sum anymore—the sum remains frozen at 5.
Key Insight: The brilliance of this formula is that it naturally terminates the contribution to the sum once becomes true. The product acts as a gate: it multiplies 1s (from the false values before the first true value), contributing to the sum at each step. But as soon as it encounters a 0 (from when becomes true), the product becomes 0 and stays 0, preventing any further changes to the sum.
Logistic Issues with Bounded Minimization
Section titled “Logistic Issues with Bounded Minimization”What happens if is FALSE for all values ?
Then the above formula would return since is 1 for all these indices 0, 1, …, .
There are those who instead embed the above formula within an IF-THEN-ELSE so that if is never true over the stated range, then the output will be zero. However, the above formula also returns 0 if, in fact, is TRUE.
Thus you would actually need to test “IF ” after computing this embedded IF-THEN-ELSE.
Note: The formula above is not changing - that is our major formula. However, there is this issue: if is always false, you will have to do a bunch of Boolean tests after the fact to make sure that it’s not always false. There’s nothing you can do about it, but that’s what you have to do.
Davis also shows a number of prime-based functions to be primitive and recursive. While very interesting, the purpose of today’s lecture was to concentrate on Boolean predicates and to lead up to bounded minimization. See Davis et al. book if you would like to explore those other functions.
Ackermann’s Function
Section titled “Ackermann’s Function”The key insight is that Ackermann’s function is the main character and protagonist of this play. It demonstrates that primitive recursive functions are not sufficient to compute all computable functions.
Definition
Section titled “Definition”Ackermann’s function (modified by Rosa Peter and Raphael Robinson) is recursively defined as follows:
Key Observations
Section titled “Key Observations”Ackermann’s function uses only primitive recursive components:
- Successor: (which is SUCC, a primitive recursive function)
- Composition and recursion
Other than that, we have composition and recursion. Yet, Davis and others prove that Ackermann’s function CANNOT be primitive recursive.
This is remarkable and unbelievable. The above function has only , which is a primitive recursive function. Other than that, we have composition and recursion. Yet despite using only these operations, Ackermann’s function cannot be primitive recursive.
Why This Matters
Section titled “Why This Matters”The proof that Ackermann’s function cannot be primitive recursive relies on showing that Ackermann’s function grows in value faster than any possible primitive recursive function. They call this property dominating—a dominating function is one where it grows faster than any other function.
This demonstrates a fundamental limitation of primitive recursion: there exist computable functions (Turing-computable) that are not primitive recursive. This gap between primitive recursive functions and all computable functions is what necessitates additional operators beyond composition and recursion.
Philosophical Significance
Section titled “Philosophical Significance”How is the above formula philosophically different than primitive recursion? (Ignore the issue of top-down vs. bottom-up .)
There is something very majorly different between Ackermann’s function and all of our primitive recursive functions. This distinction is not just about what it computes mathematically, but what makes it fundamentally different philosophically from the primitive recursive framework.