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
1
vote
1 answer

A linear recursion with power coefficient

In my research, I encounter a linear recursion of the form: $$a_n = (AB^n+C)a_{n-1}-AB^na_{n-2},$$ where $A,B,C$ are all positive (arbitrary) constants such that $B,C>1$. Is it possible to get a non-recursive formula for $a_n$? It does not have to…
user69818
  • 360
  • 1
  • 8
1
vote
3 answers

A recursive sequence is defined by...

A sequence is defined recursively by $a_1=1$ and $a_{n+1} = 1 + \frac{1}{1+a_{n}}$. Find the first eight terms of the sequence $a_n$. What do you notice about the odd terms and the even terms? By considering the odd and even terms separately, show…
1
vote
2 answers

A non-homogeneous recurrence of Fibonacci sequence

I am working on Fibonacci sequence (recursively) But the hack is that I have the following non-homogeneous version: $$F_n =F_{n-1} +F_{n-2} +g(n)$$ Where: $F_1=g(1)$ $F_0=g(0)$ I have to use: $$G(x)=\sum_0^\infty g(n) \times x^n$$ I cannot find the…
jumetaj
  • 149
  • 1
  • 7
1
vote
1 answer

Reference for a proof of the recursion theorem, for a general case.

Herbert Enderton in his A Mathematical Introduction to Logic 2nd edition, proves a theorem (a "recursion theorem") in section 1.4, p. 39. Using his example, the idea is the following: We have some set $C \subseteq U $ generated "recursively" from…
Johannes
  • 229
  • 1
  • 4
1
vote
1 answer

Universal languages are primitive recursive.

First of all, this are the definitions I am working with. Definitions: A language $L$ is $universal$ if it is countable, has infinitely many constants, and for each $n$, $1 \leq n$ has infinitely many $n$-ary function symbols and infinitely many…
Sara
  • 511
  • 2
  • 8
1
vote
2 answers

Linear Recurrences

I was working on linear recurrence... But I am having trouble with it. $a_0 = 1; a_1 = 2; a_k = 4a_{k-1} - 2a_{k-2}$ I found $a_2$ which is $$4a_1 - 2 a_0=4\cdot2 - 2\cdot 1 = 6$$ I found $a_3$ which is $$4a_2 - 2 a_1= 4 \cdot6 - 2 \cdot 2= 20$$ I…
1
vote
3 answers

First order difference equation. Solve $u_{n+1}=3u_n+2$.

First order difference equation. Solve $u_{n+1}=3u_n+2$ with $u_0=0$ My notes are very sparse on this topic, so I need some help solving what should be an easy question. I would really appreciate some going through this basic question thoroughly so…
Bob the Builds
  • 1,251
  • 1
  • 12
  • 28
1
vote
2 answers

Help with induction step of proving a recursive definition / sequence

I'm a bit of a maths noob so please bear with me with what is probably a really dumb question, but I could really do with some help - I'm self-learning at home. I'm stuck on the question below from Discrete Mathematics for Computing (Peter Grossman)…
James Allen
  • 115
  • 3
1
vote
1 answer

Undecidable definition of pure function

I am trying to come up with a formal definition for functional purity in a simple programming language (think JavaScript). What I've got so far is this: DEFINITION: A statement is impure if it is an assignment, unless it assigns to a local…
1
vote
3 answers

Finding a recursion

I am supposed to find a recursion for the following sequence: $$a_{n} = (1+\sqrt{s})^{n} + (1-\sqrt{s})^{n}$$ where $s \in \mathbb{N}$ fixed. I tried playing around with it using the binomial theorem, however, I was not able to find a solution! I'd…
Doc
  • 519
  • 2
  • 17
1
vote
0 answers

Primitive recursivness of a function. How does the function work?

So, I need some help with an homework assignment. Firstly: understanding the following function: $h(x) = \prod_{m=0}^{f(x)} m*f(m)$ From my limited knowledge of the product of sequences my guess is that it works this way(output wise) ( $'$ is the…
00sdf0
  • 11
  • 4
1
vote
1 answer

$\mu-$recursive functions

In my book there is the following: Although the class of primitive recursive functions contains a great many functions of practical interest, it does not include all the Turing-computable or effectively computable functions. It does not even…
Mary Star
  • 12,214
  • 10
  • 47
  • 149
1
vote
1 answer

Right notation to recurse over a sequence or list

I have a function $f(x, a)$ which is invoked over all the elements of a sequence feeding the result to the next call, with $x$ being the next element in the list and $a$ the accumulated result. What is the correct (and popular) notation to write…
jbx
  • 343
  • 3
  • 15
1
vote
2 answers

Differential Equations: Recursive Functions

Functions I have some familiarity with look so, $y^\prime(x) = \tan(x+2)$: straightforward expression of the first derivative of y as a function of x. But say I have a function, $y^\prime(x) = \cos{(y)}$? I'm not sure what 'y' is supposed to…
1
vote
3 answers

How to apply Master theorem to this relation?

This is the definition of master theorem I am using(from Master Theorem) I am trying to use that master theorem to find the tight bound for this relation $T(n) = 9T(\frac{n}{3}) + n^3*log_2(n)$ What value of c would I use for the theorem here…
1 2 3
99
100