# Tagged Questions

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

320 views

### Speeding up the non-negativity algorithm for multilinear function with interval probabilities?

The algorithm is a branch-and-bound algorithm that calculates the non-negativity of a multilinear function with interval probabilities. The lines 9-11 has an optimization that is explained on the ...
80 views

### Solving recursion equation with two parameters

I am trying to solve the following recursion equation, a(l,m)=l*a(l,m-1)+a(l-1,m) with initial condition; a(l,m)==0 if l=0 , a(l,m)==1 if m=1 I am trying to solve it ...
359 views

### Compile recursive function modifying global variables

How to compile recursive formula when it relies on more than a few global variables (global to the topmost compiled function)? It is unreasonable to pass on all such variables to each recursive ...
440 views

### Increasing recursion speed in Hull-White trinomial tree calculation

First timer here and have been finding these boards very useful in learning Mathematica. I'm trying to implement a numerical procedure for the Hull-White trinomial tree in Mathematica. Despite using ...
197 views

### Second order differential equation with boundary conditions solving repeatedly

I want to solve a second order differential equation in the interval[-1:1], which does not have a analytic solution, \begin{eqnarray} y''(x) &=& k \phi^2(x)y(x) \\ \phi(x) &=& ...
129 views

### Efficient Generation of Subgraphs (or, unfriend a friend a day)

NB: If you're not interested in the back-story, you could simply jump forward to the code which I'm seeking to optimize. Also, I believe this code would only work for MMA 8.0 and above. My friends ...
447 views

### Solving recursion relations using Mathematica

I want to solve the recursion relation given in equation 2.7(a/b) on page $6$ of this paper. (..the initial seed is $F_1 = G_1 = 1$ and the functions $\alpha$ and $\beta$ are defined on page $5$ in ...
96 views

### An recurrence equation that can be solved in version 7 but not in version 8

A friend of mine showed me this code sample: RSolve[{a[n] == a[n - 5] + 1, Sequence @@ Table[a[i] == 1, {i, 5}]}, a[n], n] // Timing It's solved by version 7 in ...
52 views

200 views

### RSolve doesn't solve this recurrence equation

RSolve[{1 == b ((c k[t - 1]^a - k[t])/(c k[t]^a - k[t + 1])) c a k[t]^(a - 1), k[1] == b, k[3] == a}, k[t], t] I tried to read the documentation in Help ...
39 views

### Recurrence relation for multivariate polynomials

I am trying to define a function which recursively computes a polynomial associated to every binary string: ComputePoly[s_]:=(** Recurse on the string s**) For ...
75 views

### Using Mathematica to solve a recursive system of differential equations

I believe I have a difficult problem to work on specially because I don't have any previously experience using Mathematica in this kind of situation. So I'll try to describe it as best as I can hoping ...
62 views

### Recursive computation using Piecewise

I am trying to create an array using a series of equations using Piecewise. I am stuck in one of them. I am just putting a simplified version of code as below. I ...
29 views

### Does the two function for the same input leads to same output?

The first function is y[n_]:=x[n]+0.5*x[n-1]+0.25*x[n-2] the other is y[n_]:=a*x[n+1]+b*x[n]+c*x[n-1] Does exist some ...
82 views

### Simple recursive function?

I'm new in Mathematica and need some help. I'm trying to make a recursive function but I'm not sure how to iterate through more than one item. To be more clear, take this pseudo code for example: ...
121 views

### simulate a 32-bit signed integer overflow in a recurrence function

Considering the following recurring equation: which is this factorial function: I want to find the value of x where f(x) = 0. Actually, the solution is impossible with Mathematica, and it's ...
64 views

### Different kind of numeric erros when plotting recursive functions

I have been trying to plot some numeric solutions to a Hamiltonian system. Basically I have ...
120 views

### Nested Recursion Equation

I have been trying to solve a "nested recursion equation" using Mathematica. However, when I do something like this: ...
37 views

### Scoping in recursive function leading to unexpected results

I'm trying to implement Ramer-Douglas-Peucker line simplification in Mathematica, and I'm running into an issue with recursion. My implementation of the algorithm is below: ...