Skip to main content

Questions tagged [recursion]

For questions about defining recursive functions, recursive algorithms and solving recursive equations.

Filter by
Sorted by
Tagged with
2 votes
1 answer
118 views

Consider the following system: ...
user13892's user avatar
  • 10.4k
3 votes
5 answers
788 views

From real analysis, I was asked the following question: What happens when you hit the square root key repeatedly on a calculator for any initial positive number $x$? Formulate this question in terms ...
user475550's user avatar
5 votes
4 answers
258 views

I would like to define a data representation SomeHead[l, r], where the constructor automatically returns a simplified or normalized form. The simplification process ...
Nick's user avatar
  • 442
2 votes
3 answers
301 views

I am trying to recursively define the following function: ...
FamisherCaterpillar's user avatar
0 votes
0 answers
87 views

I admit I’m a bit desperate for a solution here, I have defined in Mathematica: A basis newBasis (built from a function ...
edoiannu's user avatar
3 votes
1 answer
178 views

I am trying to figure out how to implement a Lagrangian where one of the constraints is a recursive function. Let me give a super simplified example: Consider the following recursive function: ...
GioCav's user avatar
  • 31
2 votes
1 answer
224 views

Below is my Mathematica code to generate the bifurcation diagram of the sine map x_n+1 = rsin(Pix_n) or in this form f(x) = rsin(Pix). (How to isolate the bifurcation points from the sine map's ...
user42700's user avatar
  • 2,027
2 votes
1 answer
129 views

I would like some advice - help for the following: Suppose $A, B$ two subsets of $\mathbb N$, we define the following action "$\cdot$": $A\cdot B=\{ |a\pm b|,\ \forall a\in A, b\in B$ }. For ...
dmtri's user avatar
  • 634
4 votes
2 answers
287 views

This may be a simple problem, but the goal is to process the list recursively. I want to call a function that splits a list in half recursively. My function is shown below. Could I get help to call it ...
Soon's user avatar
  • 1,484
1 vote
3 answers
245 views

Problem: I want to obtain a recursion relation for the coefficients of the power series, which satisfies an ODE. Note: the purpose here is to get the recursion relation, rather than solving the ODE ...
anecdote's user avatar
  • 153
2 votes
2 answers
364 views

I'd like to draw a graph, using recurrence table, but when I add normalization, the program stops working (it does not draw anything). Can you please help me fix it? For example: Without ...
Sasha's user avatar
  • 61
3 votes
3 answers
371 views

I have the following code for the bifurcation diagram of the sine map. It works well but I would like to isolate where the onset of period doubling begins (the bifurcation points) along the horizontal ...
user42700's user avatar
  • 2,027
5 votes
2 answers
214 views

I am trying to find an expression for the x[t+1] in the following recurrence relation x[t + 1] == x[t]/P . x[t] Where ...
ydd's user avatar
  • 8,789
1 vote
1 answer
163 views

Here is the code : Generation of the pulse signal with parameters Vmin, Vmax, Subscript[t, r], Subscript[t, f], Subscript[t, on], T ...
Elie CAMPAGNOLO's user avatar
0 votes
1 answer
140 views

According to Mathematica documentation the following code works: ...
user57467's user avatar
  • 3,150
4 votes
5 answers
568 views

A sequence (a_n) is given with a recursive formula, and another new sequence (b_n) is formed by the remainders of each term of (a_n) divided by 3. When calculating the sum of the first 2022 terms of ...
user avatar
0 votes
3 answers
111 views

My Goal is to get summation from definition a[k] as below. I tried simple arithmetic progression 1,2,3,4,5.. . Although the function Sum returns symbolic result nicely, but my code doesn't. How to fix ...
Soon's user avatar
  • 1,484
1 vote
1 answer
122 views

I want to list all the preimages of the critical values of a polynomial, and I'd like to have them in a list of lists so that all preimages of the same critical values are in the same list. ...
Wolfgangg's user avatar
2 votes
2 answers
222 views

I am trying to relearn Mathematica after a gap of around 30 years. I want a list of all sequences of non-negative integers with certain properties. Each sequence has the same length len and the sum of ...
David Epstein's user avatar
5 votes
1 answer
148 views

How to "catch" a _TerminatedEvaluation while calculating. Supposing that I have two methods to get the result, f[x] ...
Crack-Hu's user avatar
  • 165
14 votes
0 answers
384 views

Bug introduced at or before 5.2, persisting through 14.2 I am trying to solve the recurrence solution: $$ a_{n+1}=a_{n}+2+2\sqrt{a_{n}} \tag1 $$ and the following is my Mathematica code: ...
narip's user avatar
  • 521
0 votes
3 answers
130 views

My objective is as follows: Create a sequence of numbers where the denominator is always the next even number (starting with 2) and the numerator is always the next prime (starting with 2). My first ...
anonmous's user avatar
  • 195
9 votes
4 answers
629 views

I am trying to represent this in Mathematica, then evaluate it: ...
Steve237's user avatar
  • 1,747
2 votes
1 answer
189 views

How do I define the following recurrence relation in Mathematica? $$ q_0 = \sqrt{w + 2 \epsilon J},\ q_n = \frac{\epsilon\left(J_n q_0 + \sum\limits_{m=1}^{n-1} \left(J_{n-m} + J_{n+m}\right)q_m\right)...
KZ-Spectra's user avatar
0 votes
3 answers
141 views

...
liang zhang's user avatar
2 votes
2 answers
81 views

The following is a simplified version of a more detailed problem. I have two coupled recursion equations of two variables, x and y. One equation also depends on a parameter, c: ...
andring's user avatar
  • 393
0 votes
0 answers
59 views

Here is the pseudocode I am using to demonstrate the problem. ...
CuriousQ's user avatar
1 vote
2 answers
188 views

I have a second-order recurrence equation that I want to plot. I've used two different methods. The first uses RecurrenceTable, the second uses a traditional ...
Pascal77's user avatar
1 vote
1 answer
174 views

For each $n\in\mathbb{N}$, how do we compute sets $A_n$ and $B_n$ below: Let $A_1=[0,2/3)$. Let $B_1=(2/3,1]$. If $A_n$ is a union of intervals, then for each interval cut out the middle $1/2^{n+1}$ ...
Arbuja's user avatar
  • 81
3 votes
2 answers
104 views

I am using RSolve to solve for a function defined recursively, with two boundary conditions: First boundary condition describes the relationship between $f(1)$ and $f(0)$ Second boundary condition ...
Kuantew's user avatar
  • 131
2 votes
1 answer
125 views

Let we have simple recursive function: ...
lesobrod's user avatar
  • 2,590
1 vote
1 answer
79 views

INTRODUCTION Hi. I feel a bit embarrased asking this question as the answer may be staring me in the face and there are at least two other stackexchange articles related to it. MINIMAL WORKING EXAMPLE ...
Russell Jay Hendel's user avatar
0 votes
0 answers
119 views

I have a fairly complex equation containing many terms, I can use the NDSolve for solving the differential equation for lesser terms (6400ish). But can't do it for ...
Bravyi's user avatar
  • 21
3 votes
2 answers
337 views

I have an ordinary differential equation and want to solve it using power series as ψ[x_] = Sum[Subscript[a, n] x^n, {n, 0, ∞}] to obtain the recurrence relation ...
PhysFan's user avatar
  • 63
2 votes
1 answer
114 views

This is a follow-up to my question Root finding for holomorphic functions. I am trying to compute $10^6$ zeros of the derivative of the Riemann zeta function $\zeta(s)$ in the critical strip near ...
stopple's user avatar
  • 1,243
1 vote
0 answers
90 views

I am trying to solve a system of equations in Mathematica where the variables are recursively defined. The system represents a probability distribution, and I want to find the values of the variables ...
Resting Platypus's user avatar
2 votes
3 answers
361 views

I have come across a few different questions relating to my issue (namely this one, but the answers are not working for me. Here are my inputs; ...
ant's user avatar
  • 21
1 vote
1 answer
169 views

I don't know how my code is exceeding the recursion limit of 1024. ...
SurvivalWish's user avatar
0 votes
1 answer
126 views

I am trying to find the terms x9,x10,x11 and y6,y7,y8 and so on from the recursive relation given in the code. ...
Math_student's user avatar
1 vote
2 answers
285 views

Given a list of functions list and a vector of arguments {t, a}: ...
Tugrul Temel's user avatar
  • 6,429
0 votes
2 answers
204 views

I have the two recursive relations: ...
Math_student's user avatar
0 votes
3 answers
169 views

Mathematica has an inbuilt function BernoulliB that calculates $B_n$ for which, $$\frac{t} {\left(e^t-1\right)}=\sum_{n=0}^{\infty} \frac{B_n}{n !}t^n $$ I need to ...
Dotman's user avatar
  • 590
1 vote
0 answers
125 views

I have read the implementation of QuickSort algorithm in WL from Roman Maeder's Computer Science with Mathematica (2000). The implementation is shown below. ...
LambdaHaskell's user avatar
3 votes
1 answer
151 views

Hoping to check some recurrance relationship like this $a_1 = x$ and $a_2 = y$, with $$ a_{2n+1} = a_{2n} a_{2n-1} $$ and $$ a_{2n+2} = a_{2n+1} + 4 $$ Tried ...
CasperYC's user avatar
  • 1,672
2 votes
2 answers
157 views

I am trying to work on 1D random walk that can move to left, right or stay with probabilities $p_i$,$q_i$,$r_i$ that changes with the site $i$. I am trying to simulate this by using a recurrence ...
Hugo Andrade's user avatar
1 vote
1 answer
209 views

Consider the following system of simultaneous recursions: r[n] == s[n-1] s[n-2] == r[n-3] I am tring to solve this system (I have given a vastly simplified ...
Russell Jay Hendel's user avatar
1 vote
2 answers
206 views

I have an expression like this: 2v[j-1]-(s[j]+1)(c[j]-c[j-1]) >= v[j] I want to apply this recursively say k times. I can do one step like this: ...
Neill Clift's user avatar
5 votes
1 answer
221 views

I would like to implement the following recurrence relation, $$I_{n+1}=-\log(2)I_n-\sum_{k=1}^n(-1)^k\left(1-\frac{1}{2^k}\right)\frac{n!\zeta(k+1)}{(n-k)!}I_{n-k}$$ with initial conditions, $$I_0=\...
bob's user avatar
  • 153
3 votes
1 answer
319 views

What is the Mathematica command for the recursive formula: F[a_]:=Sum[(-1)^a Binomial[a,k] Log[2]^(a-k) F[k], {k,0,a}] where ...
Ali Olaikhan's user avatar

1
2 3 4 5
14