# Tagged Questions

For questions about the functionality related to permutations in Mathematica.

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: ...
58 views

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 ...
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 ...
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 ...
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, ...
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. ...
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 ...
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.,...
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: ...
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 ...
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 ...
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 ...
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: ...
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: ...
877 views

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

This input: Permutations[Range[12]] Results in this (error) output: ...
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 <...
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. ...
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" ...
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\...
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 ...
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 ...
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 <...
132 views

### Seeking a way to generate sequential partitions of a list using built in or Combinatorica functions [duplicate]

This code generates all "sequential partitions" of a list: ...
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 ...
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 ...
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 ...
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: ...
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 ...
461 views

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 ...
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 ...
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,......
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). ...
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:...
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, ...
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) ...
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 ...
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....
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 ...
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. ...