# Tagged Questions

For questions about the functionality related to permutations in Mathematica.

103 views

### Cyclic and Non-cyclic Permutations

Mathematica has a built in function to generate all permutations of a given list of elements; Permutations I can't find an equivalent function to generate cyclic ...
3 views

### Is this equation true? [migrated]

As the question states, does this equation hold true? $\sum_{j=0}^n \sum_{E \in {n \choose j}} (-1)^{|E|}(n-|E|)! = \sum_{j=0}^n(-1)^j(n-j)!{n \choose j}$ From what I understand, this holds true at ...
84 views

### Generating all permutations of labels in an expression

I have some very long and complex expressions which involve a set of $n$ variables, and I want to be able to permute the labels of the variables. I will give a simple example, instead of my awful ...
61 views

96 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 ...
47 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 ...
154 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 ...
133 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. ...
94 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 ...
495 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 ...
102 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 ...
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, ...
93 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. ...
103 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" ...
56 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.,...
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\...
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 <...
133 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: ...
135 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 ...
212 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 ...
71 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 ...
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 ...
95 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 ...
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.
170 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,......
129 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:...
33 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 ...
99 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....
217 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 ...
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 ...
224 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, ...
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 ...
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 ...
566 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 ...
120 views

### How do I create a logical permutation expression automatically

How can I create a permutation automatically with logical expressions ? For example (2 logical variables): ...
241 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) ...
232 views

### Sort two lists at the same time, based on another

I am new to using Mathematica and I can not find a solution to what I am wanting to do. I want to take a list such as: x = {1,2,3,4,5,6,7,8} and a second list (...
123 views

### Finding permuations in a specific order

I would like to find the following permutations, but need an elegant way of computing it. Ideally I would like to have a variable determine the highest number in the last element and find all ...
157 views

### Generating permutations of at most 'n' elements, and where a specific subset of elements always appears

I often run into a situation where I'd like to generate a set of permutations with at most $n$ elements (here $n = 5$): ...