Questions tagged [combinatorics]
Questions on the use of Mathematica in combinatorics, including the Combinatorica add-on package.
553 questions
7
votes
3
answers
579
views
Map all possible choices from a set of functions onto a list of arguments
I have a list of functions and a list of arguments:
funcs = {f,g,h}
args = {a,b,c}
I'd like to map one function from funcs to ...
0
votes
0
answers
15
views
Fibonacci word generator and Density of Fibonacci subwords
Reference: arXiv:2505.00602
Reproduce Table I
...
0
votes
1
answer
135
views
Accelerate Mathematica code computing visibility polynomial of one graph
Let $G$ be a graph of order $n$. Then the visibility polynomial, $\mathcal{V}(G)$, of $G$ is defined as
$$
\\
\mathcal{V}(G)=\sum_{i\geq 0} r_i x^{i}
\\
$$
where $r_i$ denote the number of mutual-...
0
votes
1
answer
111
views
Mathematica demonstration: Frozen-corner enumeration of (ASMs) Alternating Sign Matrices [closed]
Besides the Mathematica code provided in arXiv:2509.14006, I made some complement to it.
...
5
votes
3
answers
549
views
Compute the integer hull of a polyhedral set in Mathematica
Computing the integer hull of a polyhedral set creates the smallest convex set (polytope) containing all the integer points within the original polyhedral set.
(? The two convex hulls have the same ...
1
vote
0
answers
108
views
What algorithm(s) does `DeBruijnSequence` use?
A DeBruijnSequence of order $n$ on a list of length $k$ is a cyclic sequence of length in which every possible block of length $n$ taken from the list occurs ...
1
vote
0
answers
42
views
8
votes
2
answers
798
views
How to accelerate the Mathematica code about Baxter permutations?
A Baxter permutation is one permutation $\sigma \in S_n$ which satisfies the following generalized pattern avoidance property:
There are no indices $i<j<k$ such that $\sigma(j+1)<\sigma(i)&...
2
votes
0
answers
258
views
How to calculate Kazhdan-Lusztig Polynomials of Coxeter groups using Mathematica? [closed]
How to calculate Kazhdan-Lusztig Polynomials using Mathematica?
References:
TABLES OF KAZHDAN-LUSZTIG POLYNOMIALS
Kazhdan-Lusztig Polynomials - Combinatorics
kazhdan-Lusztig-polynomial-calculator (of ...
4
votes
0
answers
221
views
Generating random Hamiltonian cycle
I need random Hamiltonian cycles in directed graphs. I guess for me it would be OK to mean by that choosing uniformly randomly from the set of all Hamiltonian cycles. ...
4
votes
1
answer
249
views
Modeling Non-Uniform Host Bias in Generalized Monty Hall ($N=4$): Why Does Switching Yield ~50% Win Rate?
I've been exploring a generalization of the Monty Hall problem with $N=4$ doors, where the host exhibits a non-uniform bias when opening doors (e.g., favoring primes). My goal is to model how such ...
0
votes
1
answer
105
views
Permutations of the Hertzsprung's problem [closed]
How can I list all the permutations for each $n$ of the Hertzsprung's problem?
9
votes
2
answers
704
views
Chess Piece Movement and Pathfinding in Grids
In an $ n \times n $ grid, we define: The chess piece starts from the initial square and can only move up, down, left, or right to adjacent squares in each move. It cannot move outside the $ n \times ...
2
votes
3
answers
176
views
Rotations in lists with a fixed element
In general, I have this initial data:
n = 8;
a = Range[0, n - 1];
b = RandomChoice[a];
c = RandomSample[a];
d = Partition[c, 2];
where ...
1
vote
1
answer
241
views
Code optimization using Mod[] function
I wrote this code:
...