All Questions
Tagged with permutation code-review
5
questions
5
votes
3
answers
228
views
Permutation avoidance function
It is common for me to see if a permutation of 1,2,...,n, avoids some fixed permutation pattern. For example, the permutation [1,4,2,3,5]
contains the pattern 1,3,2, as the elements [1,4,3] appear in ...
4
votes
1
answer
127
views
Binary permutation list code in Mathematica
Given some natural number $N$, I am interested in the set of all binary permutations of length $N$ (with the intention of storing in lists depending on how many $1$'s appear in each permutation). My ...
4
votes
2
answers
178
views
4X4 matrix of distinct cubed integers with identical row and column sums
I wrote the following code:
...
1
vote
0
answers
430
views
Sum over cyclic permutation of indices
To define the Schouten bracket I need to be able to sum over a cyclic permutation of the indices:
$$ [\Phi,\Xi]_S=\mathfrak S_{i,j,k} \left(\Phi^{is}\partial_s\Xi^{jk}+ \Xi^{is}\partial_s\Phi^{jk}\...
4
votes
2
answers
98
views
Improve quality of my code to generating list
I need to write a function that constructs a set of certain permutations of a list of an even number of entries. Below, you can see my program that gives the correct result.
...