For questions about the functionality related to permutations in Mathematica.

learn more… | top users | synonyms

3
votes
1answer
66 views

The permutation of given number sequence that has specific correlation with another

I am interested in the relationship between the Pearson correlation coefficients and the permutations of two random number sequences. An initial Mathematica study is as below: ...
2
votes
1answer
58 views

Antrisymmetrized product of matrices

Let $X_{1},...,X_{N}$ be $N$ matrices. I want to compute an antisymmetrized product of $X_{i}$'s in mathematica: $X_{[a_{1}...a_{N}]} \equiv \tfrac{1}{N!}\sum_{\sigma}(-1)^{P}X_{\sigma(a_{1})}X_{\...
1
vote
2answers
102 views

Changing the order of elements in a list

I have a list of the form list1 = {1, 3, 4, 2, 5, 6} and I would like to replace each of the elements in the position of represented by the previous number in the ...
4
votes
2answers
99 views

How the solve the parameter of the conjugate permutations

As we know the definition of conjugate permutations is: $$\exists p \quad p^{-1} \alpha p=\beta$$ When I have an alpha=Cycles[{{1,4},{2,5,6,3}}] and a ...
3
votes
2answers
133 views

Interesting “Tuples” application

I want to start with: {a,b},{c,d},{e,f} and end up with: {a,c,e},{a,c,f},{a,d,e},{a,d,f},{b,c,e},{b,c,f},{b,d,e},{b,d,f} ...
5
votes
3answers
174 views

Number by permutation

I want a function that compute number of permutation in lexicographical order. E.g. ...
5
votes
4answers
96 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. $...
5
votes
1answer
95 views

list of all permuations of sublists of a nested list

I've got a certain class of lists with, say, 4 elements, that are lists themselves. E.g. {{1, 2, 3}, {4}, {5, 6}, {7}}. I'd like to find a way to generate a list ...
5
votes
0answers
46 views

Counting automorphisms that preserve a group action

Note: the math, I believe, is not the problem here. The issue is not that I get the wrong answer, just that my code does not terminate. So, if you do not feel comfortable with the problem below, I do ...
3
votes
1answer
153 views

How can I optimize the search between two lists, one that is changing length?

I'm trying to identify unique arrays by comparing two lists, one which is growing in length. The number of elements in the list grows as 2^n^2, where ...
2
votes
2answers
72 views

Permuting symbols

Suppose I have a list like {a, b, a, c}. How can I apply a "symbolic permutation" of the symbols a, ...
4
votes
3answers
132 views

Indexing all elements of permutations $S_n$

I have this Table that gives all elements of $S_n$, I would like to know how to improve efficiency. ...
7
votes
1answer
92 views

A few tuples at a time?

I want to generate $n$ by $n$ binary arrays, and then reduce the output from those arrays by performing a number of permutations and eliminating duplicates. The problem is that the number of arrays ...
1
vote
1answer
55 views

Fast arithmetic on matrix elements

I have a square matrix $U$ of dimension $L\times L$, I am interested in the following quantity $U_{1,j}U_{2,k}U_{3,l}U_{4,m}\cdots U_{L,q}$ summed over all permutations of the letter indices, e.g.,...
8
votes
6answers
2k views

Check if two lists are equal in any order

Suppose I have two lists, how can I efficiently check if the two lists are identical up to permutations of the elements? For example I would like the function to output: ...
15
votes
3answers
485 views

Generating Tuples with restrictions

I am interested in a certain subset of all tuples. Generating all with Tuples and then filtering is wasteful, and will "blow up" very quickly. For a concrete ...
8
votes
1answer
101 views

Duplicate-free results of permutations + constant list

Given a constant list const, e.g. const = {-(15/2), -(13/2), -(17/2), -(15/2), -(13/2), -(11/2)} of length ...
2
votes
3answers
106 views

Permutations and recurrence equation

First problem: I need to show all Permutations with length 4 of this elements {x, y, z, w, t} but with this condition: the element z mustn't be after element t. I ...
4
votes
1answer
249 views

Help with Permutations

I am currently trying to generate a list of permutations of length 2 of elements of a list of strings. For example: ...
1
vote
1answer
103 views

Why doesn't Compile work on the Permutations function with second arguments?

Here is a narrowed-down example, the first case works, but the second one refuses to use the compiled version: ...
14
votes
5answers
877 views

Permutations[Range[12]] produces an error instead of a list

This input: Permutations[Range[12]] Results in this (error) output: ...
6
votes
3answers
280 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 <...
0
votes
1answer
89 views

Venn diagram of all possibles combinations of 5 number

I’m trying to take 5 random integers between 1 and 100, obtain with them all the possibles operations using only each number one time for every operation. ...
3
votes
2answers
101 views

Creating all permutations of list with “alignment”

I need to find all permutations of a list satisfying a condition but I'm lost about how to do so. Given a list I want a write a function to produce all permutations such that the list is "top aligned" ...
5
votes
1answer
104 views

Finding the reduced permutations of six numbers

I am trying to use Mathematica to find the following set of permutations: $$\sum_{\rho\in \tilde{S}_{n+2}} {\rm sgn}(\rho)\eta^{\mu_{\rho_{(1)}}\mu_{\rho_{(2)}}} $$ where $$ \tilde{S}_{n+2}:=\{\rho\...
10
votes
1answer
309 views

Using Compile to speed up Function with PermutationProduct [closed]

I have the following fairly simple routine dot involving PermutationProduct that I wish to speed up using ...
6
votes
2answers
198 views

Challenge: Creating Compilable Permutations Function

As Mathematica's implemented Permutations function is not compilable I tried to write my very own Permutations implementation, called ...
5
votes
1answer
75 views

What does the Combinatorica function: NumberOfPermutationsByType return?

I am using Mathematica 9. If I input: NumberOfPermutationsByType[{2, 2, 1, 1}] Mathematica returns 1/8. I was expecting <...
4
votes
1answer
134 views

Permute list of strings

Say I have a list of strings like slist={"apple","123","Car"} What I want is a list of all permutations of slist. The result ...
2
votes
0answers
35 views

How do I specify the size of the domain of action in the function CycleIndexPolynomial? [closed]

If I input CycleIndexPolynomial[{1, 2, 3, 4, 5}, Table[Subscript[x, i], {i, 1, 5}]] Mathematica returns 1; I was hoping for $x_1^5$. If I input ...
0
votes
1answer
184 views

How to get all possible combinations of this list? [closed]

I'm trying to get all possible combinations of {0,-1} for a certain length. So let's say I want length 2. Then I want my output to be ...
4
votes
1answer
69 views

How can I “permute” an ordered pair over all the permutations of say $S_4$?

I want to make an action table of the symmetric group (say $S_4$) acting on the set of unordered pairs of distinct vertices of a square. I have the list of such pairs: ...
2
votes
0answers
41 views

Differences in AbsoluteTiming for similar codes

Consider the two following codes with the same SeedRandom (which ensures the same set of random numbers) but different use of the ...
11
votes
6answers
461 views

Performing Computations on Sets

I would like to find a permutation of $\quad S=\{\frac{1}{10}, \frac{1}{2}, \frac{4}{7}, \frac{3}{5}, \frac{2}{3} \}\quad$ that maximizes the sum of theses elements raised to unique powers: $\;\{0,1,2,...
5
votes
1answer
107 views

How to get a new list by exchanging some elements?

Let's begin with a simple example. Now, we have a list, list0=Range[4]; k1 and k2 are some elements of the list0. If |k1-k2|==2, then the elements k1 and k2 can ...
3
votes
3answers
187 views

Permutations of 0's and 1's in a lower-triangular matrix

For a given $n \ge 5$ create every $n$-by-$n$ matrix containing exactly four $1$'s strictly below the diagonal and $0$'s elsewhere.
3
votes
2answers
94 views

How can I filter a permutation list depending of a pattern? [closed]

I've created a permutation list Grid[Permutations[{a, e, q, r, t, u}], Frame -> All] and only want to see rows where the 5th element is a "t". I tried to do ...
13
votes
2answers
554 views

What is the fastest way to get the nth distinct permutation of a list?

What is the fastest way to write a function nthPermutation[xs_List, n_Integer] which is equivalent to Permutations[xs][[n]] but ...
2
votes
2answers
167 views

How to find the palindromic number I'm looking for?

I'm looking for a number which is the same when you read it reverse like 101 or 878. I have to get all numbers from 10 to 1000. There are 99 numbers. {11,...,99,101,...,191,...,202,...,292,...,909,......
6
votes
2answers
128 views

Nested permutations

I would like to compute all "nested permutations" (not sure if it's the right term) of a list consisting of simple elements (numbers, strings) and simple sublists (level 1 lists of simple elements). ...
5
votes
3answers
190 views

How to find the right permutation, which fits to the problem?

I'm new here and I hope I can find some help. I'm from Germany, so sorry for my English. I look for a number, whose digits are all different. It isn't known how many digits it has. But there is a rule:...
0
votes
1answer
218 views

Set conditions at a permutation

I need to find all permutations of 3 elements from {a,b,c,d,e} with this condition: These must include element d maximum once, ...
3
votes
4answers
236 views

How to merge permutations obtained from Solve on multiple variables?

When I compute the following expression to find integer solutions of the equation (x^2 + y^2 + z^2 == 14^2) ...
0
votes
0answers
32 views

I have trouble in sorting a matrix in wolfram mathematica [duplicate]

I have an array of five elements, I have to make permutations of 3 elements. I have my code: A = {1, 2, 3, 4, 5}; n = Permutations[A, {3}]; Now I have to sort ...
0
votes
1answer
97 views

Permutation with a condition [duplicate]

I need to create a set A={“a”, “b”, “c”, “d” “e”} and print all the permutations of the set with lenght 3 that satisfy the condition:element "a" has to be ahead of "c" and "d" has to occur atleas once....
3
votes
3answers
214 views

Permutations on elements a>b && b>c

A={1, 2, 3, 4, 5} Permutations[A, {3}] I need to print all permutations where the first number is bigger than the second and the second number is bigger than the ...
5
votes
2answers
249 views

How to define even permutations correctly?

I define even permutations as following, but there may be some error. I use it in two different way and get different output. ...
2
votes
3answers
185 views

How can I get from a list of characters representing a permutation to graphics showing the cycles?

I am trying to graphically represent cycles in various permutations of the alphabet, and have a question in two parts. I have ...
0
votes
2answers
174 views

Want to compute the permutations of {1, 2, …, 11} with only 3 GB of memory [duplicate]

There is another way to calculate Permutations [{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}] without triggering an error, I have 3 GB of RAM with WIN 7 Edit: This ...