Skip to main content

All 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 ...
Per Alexandersson's user avatar
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. ...
QuantumDot's user avatar
  • 19.7k
6 votes
3 answers
607 views

Programming challenge: restricted Permutations

I need to generate the set of all inequivalent permutations for a collection of objects of the form {symbol, integer}. Here is an example collection from which I ...
QuantumDot's user avatar
  • 19.7k
17 votes
7 answers
1k views

Permutations of nested parentheses (Dyck words)

How would I construct a function that outputs Dyck Words? e.g. - there are 14 words in $\mathcal{D}_{8}$: ...
martin's user avatar
  • 8,778
5 votes
3 answers
336 views

Number by permutation

I want a function that compute number of permutation in lexicographical order. E.g. ...
Mykola Pochekai's user avatar
5 votes
4 answers
305 views

Multi-index variable depending on signature of permutation of indices

I do have some multi-indexed variable, e.g. like this \begin{align*}f_{123} &= 1\\f_{345} &= 1/2\end{align*} where $f$ is antisymmetric under permutation of any pair of indices, i.e. e.g. $...
Lukas's user avatar
  • 2,712
7 votes
3 answers
737 views

How to get "Signature" of each element of "Permutation" output

I need to sum over all possible permutations, multiplied by the Signature of each permutation of a given list of symbols. But, I don't know how to determine the <...
QuantumDot's user avatar
  • 19.7k
13 votes
4 answers
575 views

Equivalent Nested Loop Structure (combinations_with_replacement)

Consider the following examples: ...
expression's user avatar
  • 5,662