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...

  • 3
    $\begingroup$ You don't define what you consider to be a closed form solution. What do you allow to appear in a closed form solution? Addition, multiplication, products, exponentiation? Logs? Taking the coefficient of $x^i$ in some power series/generating function? Binomial coefficients? Stirling numbers? Trig functions? Before we can prove something, we first need to precisely formulate the statement that we want to prove (or disprove). See, e.g., math.stackexchange.com/q/9199/14578, en.wikipedia.org/wiki/Closed-form_expression, mathworld.wolfram.com/Closed-FormSolution.html $\endgroup$ – D.W. Jun 11 '14 at 17:54
  • $\begingroup$ A recurrence relation does not compute anything, it specifies. That said, there are certainly many sequences of numbers that are only known by recurrences or implicit functional equations of their generating functions. $\endgroup$ – Raphael Jun 12 '14 at 6:43
  • $\begingroup$ @D.W. I agree that "closed form" is unclear. When I require one in, say, an exam I phrase it like "closed form, i.e. one that can be evaluated with O(1) elementary operations [in the uniform cost model]". $\endgroup$ – Raphael Jun 12 '14 at 8:10

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).

  • 2
    $\begingroup$ This seems like a nice answer, but it doesn't look like it. Please split your answer into reasonable paragraphs, use links and MathJax where appropriate. The editor help can show you how. $\endgroup$ – Raphael Jun 9 '17 at 11:34

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.

  • $\begingroup$ Where does the assumption of linear recurrences come from? $\endgroup$ – Raphael Jun 12 '14 at 6:44
  • $\begingroup$ @Raphael, the question mentioned the Fibonacci sequence. If linear recurrences aren't what the question is asking about, I hope the author will edit the question. In any case, as the last two paragraphs explain, the existence or non-existence of a closed-form solution is not really a big deal either way. If you don't like the focus on linear recurrences, ignore the rest and focus on the last 2 paragraphs of my answer. $\endgroup$ – D.W. Jun 12 '14 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.