All Questions
Tagged with recursion programming
31
questions
0
votes
0
answers
44
views
TagSetDelay the Plus[ ] function for direcy use with Datasets
I am trying to define a particular behavior of the function Plus[] when the arguments are $n$ Dataset, with $n\geq 3$.
(The goal is to mimic the behavior of Plus[] with Datasets instead of numbers)
...
5
votes
3
answers
809
views
Writing a program that divide numbers until I hit a one digit number
Well, I have the following question:
How can I write a program such that an input number $n$ is divided by the number $k$ as long as the resulting number does not have one digit, if the resulting ...
3
votes
1
answer
298
views
Help coding an Abelian Sandpile
I'm attempting to code an abelian sandpile. I thought a good way to go about it would be utilizing recursion, which I've never tried in MMA before. The code currently runs but doesn't seem to work (it ...
5
votes
4
answers
415
views
Programming a recursive formula into Mathematica and find the nth position in the sequence
Well, I have the following recursive formula (where $\text{n}$ gives the position in the sequence):
$$\text{P}_\text{n}=\alpha\cdot\text{P}_{\text{n}-1}+\text{P}_{\text{n}-2}\tag1$$
For arbitrary $\...
0
votes
1
answer
100
views
How can I use Compile to implement recurrence?
I am trying to make the code for the following recurrence. Here wjoin[[i]] is used for calling values from a data set and a is a ...
2
votes
1
answer
142
views
a recursive function using memoization
I have looked at a lot of these cases, e.g. Can one identify the design patterns of Mathematica? and the included ones.
My trimmed example, here establishing the 'initial conditions' (where the ...
1
vote
1
answer
39
views
How to perform a set of commands specific amout of time?
I have 3 lines of code that does the Collatz Conjecture in mathematica. the code is the following:
...
1
vote
0
answers
67
views
ConditionalExpression still resulting from Assuming a Module's local variables
I have a memoizing, recursive function whose MWE looks like this (the two fake inputs/ICs are from 'K' and 'Bfun2', the latter just a quick way to check the results coming out of the Residue.:
...
3
votes
1
answer
167
views
Taking a long time to produce output
In the following, I want to know b[1000],
but it is taking a very long time even for b[30].
Please help
...
0
votes
1
answer
83
views
Multivariate recursion with entire negative line as initial domain [closed]
I am trying to write a recursion program with all the negative value n<=0 as the initial domain, where f[n] is 0. The following simplified code is successful to ...
4
votes
3
answers
2k
views
Recursion - Concentric Circles
I'm trying to develop my Wolfram programming skills and set myself an exercise of creating concentric circles using a recursive delayed function:
...
3
votes
0
answers
576
views
Epsilon algorithm to accelerate sum's convergence in a functional approach
I am trying to learn to use Mathematica in an efficient way. Thus, I decided to spend some time on functional programming. I would like to implement the so-called epsilon algorithm, that is used to ...
5
votes
2
answers
460
views
How to plot a bifurcation diagram of a system of recursive formulas in terms of two variables
My group partner and I are having trouble plotting a bifurcation plot of two recursive functions.
Our functions are as follows:
...
2
votes
2
answers
254
views
How could I rewrite my code in professional style?
I reduced my question to the lowest possible for having your ideas:
...
1
vote
1
answer
238
views
Which data tabulation concept is best suited for discrete dynamic programming problems (e.g. for optimum series of account withdrawals)?
A bank account has starting balance, which shall be completely withdrawn in n steps, such that the sum of benefits of withdrawals is maximum. Remaining balance yield interest between steps such that ...