All Questions
Tagged with recursion list-manipulation
63
questions
1
vote
2
answers
180
views
Sorting a list of functions by exploiting the recursive structure
Given a list of functions list and a vector of arguments {t, a}:
...
5
votes
2
answers
177
views
How to implement If criteria for the NestList-Function
I have a function which bisects a list in two parts recursively. Unfortunately I have to select a number of iterations for the NesList-function which is just an ...
0
votes
3
answers
596
views
Python recursive bisection algorithm to Mathematica
I've been sitting on this problem for a while and i am kind of stuck. I am pretty new to Mathematica and have been trying to implement a recusive Algorithm, which splits/bisects a list of items in ...
0
votes
0
answers
154
views
How can I speed up this pdf path integration calculation with a slow recursive function with 40^4 summed terms in each iteration?
I am writing a path integration code for a numerical approximation to a probability density function.
I essentially take some initial continuous probability density function p0 and then perform a ...
3
votes
0
answers
108
views
Sowing Once into Each of Many Lists – Any Better than Append?
In general
I know to try to use Reap and Sow over Append or AppendTo due to superior performance. However, Reap and Sow are notorious for being difficult to understand how to use and how they work ...
0
votes
1
answer
147
views
Add list of vectors to list of vectors recursively
This question relates to Add a vector to a list of vectors whereas here I want to add list of vectors to list of vectors recursively.
Given:
...
3
votes
2
answers
129
views
Join sublists on condition
I have a nested list of integers and want to join any sublist matching a condition to its left neighbouring sublist, iteratively. Conveniently, the joining condition is whether the length of the list ...
5
votes
3
answers
250
views
Obtaining numerical value from Recurrence Table
I'm trying to analyze the following sequence of numbers:
$$a_1 = 2 \quad \text{ s.t } \quad a_n = 4\sum_{i=1}^{n}a_i
$$
I wrote the following code for creating a
Recurrence Table for this sequence of ...
0
votes
1
answer
206
views
Cycle detection with Mathematica
Suppose we have cellular automaton on a network. For simplicity, we will use matrix notation.
...
5
votes
6
answers
163
views
Create a list that always ends with two 1's but starts with a variable amount of 0's
I want to create a variable list like this:
{0, 0, ..., 0, 0, 1, 1}
This list would grow list this, starting with no 0's, but then gaining more 0's to the left the ...
2
votes
3
answers
241
views
Re-writing code chunk using While loop
I can't seem to wrap my head around the syntax for how to rewrite this chunk of code I have using a while loop, and would appreciate some help. I'm going through a list and am grouping the values into ...
2
votes
1
answer
46
views
Results of recursion grouped in list [closed]
I made a recursion where I should plot resulting points. When I do Print[point1], it just gives me result:
...
4
votes
6
answers
341
views
Adding non adjacent elements in a list
I've been stuck on a simple problem for a while. Let's say you have a list of any length:
{a,b,c}
How do you recursively add the first and last element of the list ...
5
votes
2
answers
979
views
Using Table Recursively
I wonder if it's possible to create a list with Table from entries of the list itself. That is, as I'm creating the list, I append a new element as a function of ...
7
votes
1
answer
342
views
Trying to find a better way to implement a recursive depth first search
I'm trying to implementa recursive depth first search. It works and the result is below:
...