Skip to main content

Questions tagged [permutation]

For questions about the functionality related to permutations in Mathematica.

3 votes
1 answer
91 views

Sort the arguments of a function using replace

I want to sort the arguments of a function f while multiplying with the signature of the permutation, i.e. f is totally antisymmetric function. My idea was something like ...
6 votes
6 answers
265 views

How to efficiently find all element combination including a certain element in the list

I have the following list : alist={{5, 6, 7}, {7, 6, 8}, {5, 7, 25}, {7, 8, 26}, {7, 26, 25}, {5, 4, 6}, {4, 12, 6}, {6, 12, 13}, {6, 13, 8}} I want to find all ...
1 vote
1 answer
99 views

Can I improve my code to extract permutation cycles from a (n,2) matrix?

I've written a routine to extract permutation cycles from a (n,2) matrix, each row giving the format $a\to b$ which represents the first two elements in some $k$ cycle. If $a\to a$, it's a $1$-cycle. ...
2 votes
2 answers
368 views

Group table for permutation group

I have got a permutation group: $(\{(e,((1, 4),(2,6),(3,5)),((1, 6),(2,5),(3,4)),((1, 5),(2,4),(3,6)),((1, 3,2),(4,6,5)),((1,2,3),(4,5,6)),((1, 4),(2,5),(3,6)),((1, 3),(4,6)),((2, 3),(5,6)),((1, 2),(...
2 votes
5 answers
82 views

Generate a list of the product of combinated terms in groups of 2

Here is what I have: j1=2 Do[Print[w[m1, n1] = ToExpression["w" <> ToString[m1] <> ToString[n1]]], {m1, 1, j1}, {n1, 1, j1}] That's what I got:...
12 votes
5 answers
420 views

StringContainsQ, but anywhere in order

I am trying to find a string within a string, but "anywhere", so long as it is in the right order. For example StringContainsQ["aabbc","ac"] returns ...
8 votes
6 answers
299 views

Construct a list from another list

Given a list, lst, of length 2n, I want to construct a new one that results from the exchange of the fist half of lst with the ...
9 votes
9 answers
932 views

Shuffling two lists into each other

Given a subset s of Range[n] and two lists a and b, with ...
7 votes
9 answers
614 views

Rearrange triple sublists

Given a set of triple lists (all contain element 9!) tripel = {{5, 10, 9}, {4, 9, 3}, {3, 9, 8}, {4, 5, 9}, {9, 10, 8}} I would ...
5 votes
1 answer
161 views

Find permutation that satisfies conditions

Suppose you what to find a permutation of integers {1, 2, ..., 13} that satisfy some rules. Rules can be found in variable rules....
5 votes
6 answers
694 views

String permutation

I have a string "abcd". Is there any way in Mathematica such that when I apply some exchange operator $P^{ab}$ it gives me string "bacd"? Edit: After reading answers I felt like I ...
2 votes
1 answer
94 views

Pattern Matching and Permutations

I am working with some math students on some problems involving permutations. My Mathematica knowledge is limited and I'm hoping to get some help. Two sample problems: a)how many ways can the ...
1 vote
1 answer
93 views

Elements of a group that send one element to another

If I have a permutation group, say $S_{10}$, how do I get all the permutations that send the set {1, 2, 3} to {5, 6, 7}? I know ...
17 votes
12 answers
4k views

Fastest way to generate {{a,a},{a,b},{a,c},{b,b},{b,c},{c,c}} from {a,b,c}

What is the fastest way to generate {{a,a},{a,b},{a,c},{b,b},{b,c},{c,c}} from l={a,b,c}? I've tried ...
1 vote
2 answers
118 views

How to determine if two colorings of a graph are the same?

A coloring of a graph $G$ with vertex set $V$ is the partitioning of $V$ into so-called color classes so that no two vertices of the same class are adjacent. A $k$-coloring contains exactly $k$ color ...

15 30 50 per page
1
2 3 4 5
19