# Questions tagged [combinatorics]

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

446 questions
Filter by
Sorted by
Tagged with
53 views

### Triangulation of Point Configuration

I was going through the documentation of Mathematica but couldn't find any built-in function that can find all possible triangulations for a given set of points. For example, if I have the following ...
133 views

...
62 views

### Matroids in Mathematica?

I can't seem to find a "standard" way to implement/manipulate matroids in Mathematica. (They do not seem to be included in Combinatorica, for instance, and googling has turned up nothing.) ...
127 views

### Find different combinations of 3 lists with given constraints

My inputs are 3 lists of unequal length: A={a,b,c,d} B={i,j,k} C={v,w,x,y,z} And I want to find the combine set X which looks like ...
53 views

### Enumerate all possible subsets such that all are of the same length which is maximum and each contains non-repeating elements?

Given a list lists: ...
47 views

### Extract only a few coefficients of the multiple of extremely many polynomials

I want to extract some informations, say the coefficients of $x^{500}$ and $x^{1000}$ terms (numerical values are acceptable), of the multiple of ...
300 views

### Partition a nested list such that no repeated elements in every subsets?

I have a large list and for simplicity, let's take the simple list as an example: lists = {{1, 2}, {1, 6}, {2, 3}, {2, 5}, {3, 4}, {3, 6}, {4, 5}, {5, 6}} I would ...
43 views

### How do I generate a random permutation of a (long [millions-length]) list of symbols? [closed]

I have a list of length twelve: p = {t[1, 1], t[1, 2], t[1, 3], t[1, 4], t[2, 2], t[2, 3], t[2, 4], t[1, 5], t[3, 3], t[3, 4], t[1, 6], t[4, 4]} and a set of ...
51 views

### Construct all possible 3-letter words from A,B. Repetition of letters is allowed [closed]

I have two letters A and B. I need to construct all possible 3-letter words. Repetition of letters is allowed. I know that the answer to this problem is 2^3=8. But ...
120 views

### Fast enumeration of all perfect matchings in complete graph

I have a code that generates the list with all possible Perfect Matchings (PM) of a fully connected graph. Each edge of the graph is mono or bi-colored with up to ...
274 views

286 views

### Construct a permutation tree plot

How to construct a tree like this? I was looking CompleteKaryTree initially, there are some similarities overall, but it's still different. ...
110 views

### List manipulation: Find duplicates with respect to symmetry in sublists

I have the following list ...
97 views

### Find all possible configurations of a finite dipole system

I have a system which is composed of the following blocks $$[-,+],[+,+],[+,-],[-,-]$$ I can compose a system of $n$ blocks with the only rule that the edges act as a dipole. for example [-,+][-,+][-,...
620 views

### Programming a bishop's move on a grid

I am simplifying the question i need too work with, any advice on how to proceed for each step would be appreciated(no answers) I have a square grid of size a by b, inside the cell is an object that ...
61 views

### XOR combination between the bits of a string

Given an integer n, we can construct $2^n$ strings of length n. We can take the first element for each of these strings and create a list. In total 'n' such lists are possible. But now I need to ...
127 views

### Randomsample without repetition [closed]

I'm looking for a simple way to generate random samples of lists of integers such that each time I sample I'm sure it chooses a new random sample. This is closely related to Picking random items out ...
95 views

### Compute all trees on a given label set

Given a set of labels {a_1,...,a_n} (with some labels possibly appearing multiple times) I would like to efficiently compute all trees with n leaves labelled {a_1,...,a_n} and 2n-2 nodes. This is ...
41 views

### Climbing/Descending the Multidimensional Integer Ladder

This is basically a follow-up to Climbing/Descending the Integer Ladder, but in multiple dimensions. It's basically just an index counting problem, but combinatoric blow-up makes it interesting. In ...
75 views

### Overlay Graph3D with Graphics, with aligned coordinates

I have a Graph3D object representing a 3D lattice path ...
345 views

### How to perform a reduced knapsack problem

I have a problem statement that seems to be a reduced version of the knapsack problem, but I don't know how do it in Mathematica. The problem is as follows: Given a set, S, of integers (e.g {a,b,c,...}...
88 views

### using DeleteCases with CoprimeQ

first let me show what I have working correctly f = Permutations[Range, {3}] Riffle[f, Apply[CoprimeQ, f, {1}]] now I would like to automate the deletion of a ...
503 views

A fun combinatoric puzzle that's popped up in my work that I think would be cute to have a Mathematica solution to, if anyone wants to give it a go. It's basically a ladder climbing/descending problem ...
82 views

### Number of partitions of an integer with a fixed number of parts

Is there an easy way in Mathematica to find the number of partitions of $n$ into $k$ parts? Or equivalently, the number of partitions of $n$ with largest part equal to $k$? I realize the function ...
83 views

### Solving 190 equations from a list of 2x20 elements [closed]

I have a list of 20 pairs of elements, say {{x1, y1}, {x2, y2}, ...}, and I want to solve the following equation for a constant c...