# Questions tagged [combinatorics]

Questions on the use of Mathematica in combinatorics, including the Combinatorica add-on package.

350 questions
Filter by
Sorted by
Tagged with
1k views

### Solving word search puzzles

I am trying to create a code that can identify the following terms in a grid of letters: MATHEMATICA, STACK, EXCHANGE and USERS. ...
651 views

### How to generate all possible orderless partitions of a list according to another list?

This question is hard to describe in plain text. So I will post an example and a working code (brute force) to illustrate. For example I have a list: ...
70 views

### Cycle index of a graph automorphism group

I want the cycle index of the group of automorphisms of a (say 3 X 3) grid graph. I can produce the elements of the group with: ...
101 views

### How to extract the cycle lengths from a permutation [closed]

I want to input: Cycles[{{1, 3, 5}, {2, 4, 6}, {7,8}}] and get something like: {3,3,2}, that is, a list of the cycle lengths in ...
154 views

### How to list all binary expression trees with given leaves

If i have a list of leaf nodes and nonleaf nodes with specified arities, how can I effieciently enumerate the possible trees? For example: ...
382 views

### Any alternative way to compute IntegerPartitions?

I tried to compute IntegerPartitions[100] using mathematica on my intel core i3 system. the system hangsup everytime. Is there another way to do such a large computation?
89 views

219 views

### Refining subset relations

People who do combinatorics (like me) are often faced with the following problem: For a list of combinatorial objects (vectors, permutations graphs,etc.), we know what multi-set of values it ...
88 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 <...
2k views

### Exceeding time constraint of 300 seconds when taking coefficients of some expressions from schur polynomial [closed]

I have written a code that takes coefficients of some expressions from schur function, but it seems to take a lot of time, and Mathematica will stop after 300 seconds saying that it's over the time ...
530 views

### Random Partitions

I want to write a function RandomPartition to partition a vector of length n into p partitions of varying (random) lengths. For example with ...
4k 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 ...
378 views

### Way to generate all multisets

I have a set $\left\{\{1,2\}, \{3,4\}, \{5,6\}, \{7,8\}\right\}$ (for example) and want to generate all sets of $n$ elements with repetition but without counting the same multiset twice. So I want my ...
How can I count the numbers of $r$-cliques in a graph? In other words, the number of triangles, the number of $K_4$, the number of $K_5$ etc. I have tried for example ...