3

A recurrence relation computes value $d_n$ with the $\{d_{i},d_{j}\ldots\}$ previous digits of the sequence

So for example, the Fibonacci sequence is defined as follows: $$ F_n = F_{n-1}+F_{n-2},\ \ \ F_0=0, F_1=1 $$ The classic closed form solution is given by the Binet formula: $$ F_n = \frac{\phi^n-\psi^n}{\sqrt{5}} $$ where $\phi=\frac{1+\sqrt{5}}{2}$ and $\psi=1-\phi$.

The question is: are there such sequence of digits defined through some arbitrary recurrence relation that do not have a closed form solution, that is, that provably do not have a closed form solution?

I am asking this question in CS stack exchange because the context of this question is Random Number Generation... If such iterated sequences exist, this could be (could be) helpful in designing RNG's...

user13675
  • 1,684
  • 12
  • 19

2 Answers2

6

Yes, there are. Consider the recurrence $a_{n+1}=(7a_n/4 + 1/2) - (5a_n/4 + 1/2)(-1)^{a_n}$ where $a_0$ is a given integer value. It is well known that this gives the Collatz sequence. There is no "known" closed form solution to the recurrence (and if you find it, you would be quite famous in mathematical circles). Furthermore, it is also well known that there are recurrent sequences that can't be solved in closed form. For instance, Conway shows that a natural generalization of the Collatz problem is undecidable. On the other hand, there are large classes of recurrence relations for which methods are known to determine closed form solutions in terms of sometimes multiple finite or infinite sums. Hypergeometric functions can be used to solve large classes of them. For instance, in theory, all linear recurrences with polynomial coefficients can be solved. More information can be found in Solving Linear Recurrence Equations with Polynomial Coefficients by Petkovsek and Zakrajsek (PDF).

David Richerby
  • 82,470
  • 26
  • 145
  • 239
Christopher
  • 61
  • 1
  • 1
2

Assuming you are asking about linear recurrence relations, roughly speaking, the answer is "No, but that's OK".

More precisely: If the sequence can be defined by a linear recurrence relation with finite memory, then there is a closed form solution for it... but this is not a barrier to building useful PRNGs.

Suppose there is a linear recurrence relation, say

$$a_j = c_1 a_{j-1} + c_2 a_{j-2} + \dots + c_k a_{j-k} + d \text{ for $j\ge k$.}$$

Form the corresponding generating function, $A(z) = a_0 + a_1 z + a_2 z^2 + \dots$. From the recurrence relation we can find a simple relationship on the generating function and then solve for $A(z)$ to find

$$A(z) = {p(z) \over q(z)},$$

for some polynomials $p(z),q(z)$ of degree at most $k$. This gives us a closed form expression for $A(z)$, and now we can say that $a_j$ is the coefficient of $z^j$ of $A(z)$. I don't know if you want to count that as a closed form solution or not.

If you don't, let $\alpha_1,\dots,\alpha_k$ be the complex roots of $q(z)$. This typically lets us express $a_j$ as a linear function of powers of $\alpha_1,\dots,\alpha_k$. In other words, this gives us a closed-form expression for the recurrence.

For details on how to do this, see our reference question Solving or approximating recurrence relations for sequences of numbers, and especially the exposition on generating functions (https://cs.stackexchange.com/a/3135/755).


Such recurrences are not a good way to build a RNG. There is a rich literature on RNGs and PRNGs. RNGs need to generate truly random numbers (not pseudorandom numbers); to paraphrase Knuth, "anyone who uses [deterministic algorithms] to produce random numbers is in a state of sin". Therefore, different techniques are used when building a RNG.

You might be asking about PRNGs, which are for generating pseudorandom numbers. Recurrence relations can be useful for building PRNGs. For instance, I suggest you study LFSRs and linear congruential generators, two kinds of PRNGs that take the form of a recurrence relation. However, the fact that there is (or isn't) a closed-form expression for the output isn't a make-or-break consideration; those generators are useful for some purposes despite the existence of a closed-form solution.

D.W.
  • 167,959
  • 22
  • 232
  • 500