Questions tagged [recursion]

Recursion is the process of repeating items in a self-similar way. A recursive definition (or inductive definition) in mathematical logic and computer science is used to define an object in terms of itself. A recursive definition of a function defines values of a function for some inputs in terms of the values of the same function on other inputs. Please use the tag 'computability' instead for questions about "recursive functions" in computability theory

Recursion is the process of repeating items in a self-similar way. The most common application of recursion is in mathematics and computer science, in which it refers to a method of defining functions in which the function being defined is applied within its own definition.

Basically, a class of objects exhibiting recursive behaviour can be characterised by two features:

  • There must be a base criterion for which the function should not call itself.

  • Every other iteration of the function should move it closer to the base condition.

2553 questions
615
votes
8 answers

Why is $1 - \frac{1}{1 - \frac{1}{1 - \ldots}}$ not real?

So we all know that the continued fraction containing all $1$s... $$ x = 1 + \frac{1}{1 + \frac{1}{1 + \ldots}} $$ yields the golden ratio $x = \phi$, which can easily be proven by rewriting it as $x = 1 + \dfrac{1}{x}$, solving the resulting…
Martin Ender
  • 5,710
  • 4
  • 17
  • 28
46
votes
1 answer

Limit associated with a recursion

Update: a full solution to the recursion below has now been found, and it is discussed here. If $z_n < 2y_n$ then $y_{n+1} = 4y_n - 2z_n$ $z_{n+1} = 2z_n + 3$ Else $y_{n+1} = 4y_n$ $z_{n+1} = 2 z_n - 1$ Consider the following…
33
votes
1 answer

Show that the maximum value of this nested radical is $\phi-1$

I was experimenting on Desmos (as usual), in particular infinite recursions and series. Here is one that was of interest: What is the maximum value of $$F_\infty=\sqrt{\frac{x}{x+\sqrt{\dfrac{x^2}{x-\sqrt{\dfrac{x^3}{x+ \sqrt{…
TheSimpliFire
  • 25,185
  • 9
  • 47
  • 115
27
votes
2 answers

Does this sequence always terminate or enter a cycle?

I've been fiddling with the recursive sequence defined as follows: $$\begin{equation} f_n=\begin{cases} a, & n=1.\\ b, & n=2.\\ c, & n=3.\\ f_{n-1}f_{n-2}f_{n-3} \mod[f_{n-1}+f_{n-2}+f_{n-3}], & n>3. \end{cases} \end{equation}$$ And no…
23
votes
4 answers

Ackermann Function primitive recursive

I am reading the wikipedia page on ackermann's function, http://en.wikipedia.org/wiki/Ackermann_function And I am having trouble understanding WHY ackermann's function is an example of a function which is not primitive recursive. I understand that…
AlanFoster
  • 333
  • 1
  • 2
  • 6
20
votes
7 answers

Definition of General Associativity for binary operations

Let's say we are talking about addition defined in the real numbers. Then, by induction we define $\sum_{i=0}^{0}a_i=a_0$ and $\sum_{i=0}^{n}a_i=\sum_{i=0}^{n-1}a_i+a_n$ for $n> 1.\:$ Now, how do you define general associativity? I know that this…
Daniela Diaz
  • 3,788
  • 28
  • 50
20
votes
1 answer

The problem of the most visited point.

Represent the set $R_{n\times n}=\{1,2,\ldots, n\}\times\{1,2,\ldots, n\} $ as a rectangle of $n$ by $n$ points as in the figures below for example. How to calculate the number of circuits that visit a chosen point in this rectangle? What is the…
19
votes
4 answers

Find all bijections $\,\,f:[0,1]\rightarrow[0,1],\,$ which satisfy $\,\,f\big(2x-f(x)\big)=x$.

A friend of mine gave me the following problem: Find all functions $f:[0,1]\to[0,1]$, which are one-to-one and onto and satisfy the following functional relation: $$ f\big(2x-f(x)\big)=x, \tag{1} $$ for all $x\in [0,1]$. Clearly, the identity…
19
votes
3 answers

Recursive Integration over Piecewise Polynomials: Closed form?

Is there a closed form to the following recursive integration? $$ f_0(x) = \begin{cases} 1/2 & |x|<1 \\ 0 & |x|\geq1 \end{cases} \\ f_n(x) = 2\int_{-1}^x(f_{n-1}(2t+1)-f_{n-1}(2t-1))\mathrm{d}t $$ It's very clear that this converges against some…
18
votes
1 answer

Primitive recursive function which isn't $\Delta_0$

What is the simplest/cutest example (and/or example with the most student-friendly proof that it is an example) of a primitive recursive function which isn't representable by a $\Delta_0$ wff?
Peter Smith
  • 49,532
  • 3
  • 58
  • 138
17
votes
2 answers

Growth rate of the nth natural number not constructable with n steps of addition and multiplication

While messing around with the idea of ordinal collapsing functions, I stumbled upon an interesting simple function: $$C(0)=\{0,1\}\\C(n+1)=C(n)\cup\{\gamma+\delta:\gamma,\delta\in C(n)\}\\\psi(n)=\min\{k\notin C(n),k>0\}$$ The explanation is simple.…
16
votes
4 answers

What is the closed form of the $f$ with $f(1)=1$, $f(2)=7$ and $f(n)=7f(n-1)-12f(n-2)$ ($n\ge 3$)?

Suppose $f(1)=1$ and $f(2)=7$. For $n\ge 3$ we have $$f(n)=7f(n-1)-12f(n-2). $$ What is the closed form of the function $f$? I've tried unrolling it but it gets very complicated very quickly without a clear pattern emerging. Any ideas?
user686717
16
votes
3 answers

Is there a slowest divergent function?

So I've been playing around with some functions for a while, and started wondering about a slowest divergent function(as in $\lim_{x\to\infty} f(x)\to\infty$) and so I searched around for an answer. I can see that there are ways to construct a new…
Passer By
  • 299
  • 1
  • 7
15
votes
1 answer

Recurrence vs Recursive

Say team 1 is studying the recursive characteristics of a function. Team 2 is studying the recurrent characteristics of the same function. Are the 2 teams studying the same thing? I have found for recursiveness: "Recursive Formula For a sequence…
Just_a_fool
  • 1,852
  • 1
  • 13
  • 27
14
votes
4 answers

Each member of a population dies with probability $\frac12$ each day, what is the probability that there will be exactly $1$ person alive?

Suppose that there are $n$ people alive in a population. Due to a deadly disease, each person dies with probability $\frac12$ each day (and there are no births). What is the probability that there will be exactly one person alive at some…
Alex
  • 1,664
  • 10
  • 14
1
2 3
99 100