From: Thomas Walker Lynch
- The difference between function values is called the first finite difference. The forward first difference is defined as: - . + The difference between function values in the above sequence is called the first finite difference. The forward first difference is defined as: + . While the backwards first difference is - . - If 'forward' or 'backwards' is not specified, then the difference is taken to be 'forward'. Hence, extending a function is the same as adding the first difference. + . + If 'forward' or 'backwards' is not specified, then the difference is taken to be 'forward'. Hence, extending a function is identical to adding the first difference.
- A second difference can be defined as the difference between two adjacent first differences, etc. A second difference can be added to a prior first difference to create the next first difference, which could then be added to a prior function value to extend the function to its next value. This pattern can be extended to any number of levels. + A second difference can be defined as the difference between two adjacent first differences. A second difference can be added to a prior first difference to create the next first difference, which could then be added to a prior function value to extend the function to its next value. This pattern can be extended to any number of levels.
@@ -1185,8 +1185,8 @@
- In order to design for recurrent extensions, the Turing Machine tape must retain the current function value alongside its forward differences. Because the second difference is constant, the tape requires three logical cells of state to compute the next step: . No matter how long the finite difference table becomes, each row will have three entries. + In order to design for recurrent extensions, the Turing Machine tape must retain the current function value alongside its forward differences. Because the second difference is constant, the tape requires three logical cells of state to compute the next step: . No matter how long the finite difference table becomes, each row will have three entries.
- Here is the sequence of tape states as the machine is repeatedly called to extend the function from its initial conditions at . During each step, the machine adds to , and to : + Here is the sequence of tape states as the machine is repeatedly called to extend the function from its initial conditions at . During each step, the machine adds to , and to :
-For Call 1 the input tape is the Initial Tape. In Call 1 the machine will take the function value on the input tape, 0, and add the first difference, to write the function value to the result tape. The machine will then continue on and take the first difference on the input tape, 1, and add the second difference on the input tape, 2, to write the first difference for the result tape, 3. Continuing on, the machine will not find a third difference on the input tape, so it will copy the second difference found on the input tape as the second difference for the result tape. +
+ For Call 1, the input tape is the Initial Tape. In Call 1 the machine will take the function value on the input tape, 0, and add the first difference, writing the function value to the result tape. The machine will then continue on and take the first difference on the input tape, 1, and add the second difference on the input tape, 2, writing the first difference for the result tape, 3. Continuing on, the machine will not find a third difference on the input tape, so it will copy the second difference found on the input tape as the second difference for the result tape.
-For Call 2, the input tape is the result tape from Call 1. Execution then proceeds the same as it did for Call 1. This pattern repeats for all successive calls. We can see the values of t^2 as the first number of each result tape. +
+ For Call 2, the input tape is the result tape from Call 1. Execution then proceeds identically to Call 1. This pattern repeats for all successive calls. A person can see the values of as the first number on each result tape.
-The extension function can be called any number of times, when the initial tape is identical to the first row of the finite difference table. No other row is needed from he diagonal table.
++ The extension function can be called any number of times when the initial tape is identical to row 0 of the finite difference table. No other row is needed from the table. +
-This follows from the fact that the extension function is performing the exact operations that were performed when we generated the difference table. At each step, the result tape is identical to the different table row. I.e. the extension function captures formally our definition of how to make the table. +
+ This follows from the fact that the extension function is performing the exact operations that were performed when we generated the difference table. The extension function is merely formalizing the rules used for generating the table. As a consequence, the result tape after the Nth call is identical to row N of the table.
-+ Define the refer to the maximum index for accessing a component of a vector, the extent is often denoted as . Performing extensions to calculate the function value at call will make use of the initial tape up to index , or as many nonzero values as are available up to that extent. +
-Before calling the extension function, the initial result is on the initial tape. Hence, for zero calls, only the value the first column is needed.
++ This can be proven by induction on the step index, . +
+ ++ Base Case (k=0): To generate the value at index 0, , the machine performs zero extensions. It requires the initial tape to have an extent of at least 0, accessing only the value at index 0, which is the function value itself. +
+ ++ Inductive Hypothesis: Assume that generating the value at step index requires the initial tape to have an extent of , consuming indices 0 through : . +
+ ++ Inductive Step: Consider the requirement for the value at step index . By the definition of the forward difference, . +
++ The union of the dependencies for and spans from index 0 to index . Thus, generating the value at step index requires the initial tape to have an extent of exactly . The lemma holds. +
+ ++ Consequently, on a finite tape with no constant difference, each extension reduces the extent of the logical state by one. If a programmer intends to call the extension function to reach step index 4, the initial tape must have an extent of 4, meaning it holds 5 values. The first result tape will have an extent of 3, the second an extent of 2, the third an extent of 1, and the final call will leave an extent of 0: the requested answer. +
-For the first call, the initial first difference is needed to add to the first value, but no other values are needed. Hence at call 1, it is sufficient that the first row has two columns.
-In general, for the Nth call, the Nth difference from the first row, so if the recurrence function is to be called N time, the initial row need only have N + 1 values.
If we desire to compose recurrence functions, in the first order or the second order, the call counts must first be synchronized.
-Say for example, we have a machine called fizz that adds 3 to the input on the tape, while buzz added 5 to the input on the tape, and we wanted to compose the two machines. We would have to define what a call to the resultant machine means to the machines in composition.
+Say for example, we have a machine called fizz that adds 3 to the input on the tape, and another machine called buzz that adds 5 to the input on the tape, and we wanted to compose the two machines. We would have to define what a call to the resultant machine means to the machines in composition.
-Suppose one call to the resultant machine makes 3 calls +
If one call to the resultant machine makes the equivalent of one call to the fizz, and one to buzz, the the resultant machine can be simplified to add 8 to its input tape each time it is called. In contrast if one call the resultant machine makes the equivalent of 5 calls to fizz, and 3 calls to buzz, then the resultant machine reduces to adding 30 to the input tape per call. The two machines are very different.
+ +Performing operations on with recurrence functions requires integrating a call algebra in addition to integrating the machines. Often this is handled by consider the machines being composed to be subroutines, and the outer controller than explicitly calls them. The call algebra can then be dynamic depending on the input. Calls can be skipped due to being inside conditionals, or performed an arbitrary number of times in loops. Though simple control structures that are static are more math like, and are more likely to be more effected by optimizations (simplifications).
+ +