Skip to main content

Questions tagged [combinatorics]

For challenges involving combinatorics.

9 votes
2 answers
343 views

In this code-golf challenge, you will count the number of ways of putting together pieces of a building toy which consists of slotted squares that interlock with one another, shown below. In ...
Peter Kagey's user avatar
  • 8,165
9 votes
1 answer
384 views

In this code-golf challenge, you will work with a construction that was used by the ancient Greeks: the straightedge-and-compass construction. In particular, you will count how many different ...
Peter Kagey's user avatar
  • 8,165
4 votes
1 answer
288 views

I like writing answers using Brainfuck, since this language basically simulates a Turing machine, and it is pretty challenging to find the shortest answer for any problem, since there are a lot of ...
Weird Glyphs's user avatar
16 votes
17 answers
1k views

OEIS A135404 gives the number of Gessel walks \$g(n)\$ of length \$2n\$. A Gessel walk is a walk on the square lattice starting and ending at the origin with possible steps (1,0), (-1,0), (1,1), (-1,-...
Parcly Taxel's user avatar
  • 4,749
12 votes
7 answers
2k views

Do Not Find the Fox is a non-game where you repeat the following up to 16 times: Pick an empty square in a 4×4 grid Draw a tile from a bag – there are 5 Fs, 6 Os and 5 Xs at first – and place it in ...
Parcly Taxel's user avatar
  • 4,749
7 votes
9 answers
1k views

Part 2 is available here Card-Jitsu was a mini card-game based on Rock, Paper, Scissors available on the children MMO game Club Penguin. I first wrote a challenge where you needed to implement a clone ...
Weird Glyphs's user avatar
16 votes
12 answers
993 views

Given an alphabet size, \$n>0\$, and an occurrence limit, \$k>0\$, produce the number, \$a(n, k)\$, of strings that may be constructed from the \$n\$ letters in the alphabet which have no more ...
Jonathan Allan's user avatar
15 votes
9 answers
1k views

Given a positive integer \$n\$, a partition of \$n\$ is an ascending sequence of numbers that sum to \$n\$. Given two partitions \$a\$ and \$b\$, \$a\$ is a refinement of \$b\$ iff \$b\$ can be ...
Wheat Wizard's user avatar
  • 103k
13 votes
13 answers
2k views

The easiest way to understand this task is to look at this graph, which you can change interactively. It defines a sequence n -> a(n) like this: a(0) = 0; thereafter a(n) is the least integer (in ...
Sophia Antipolis's user avatar
14 votes
11 answers
1k views

A Rota-Baxter word, \$w\$, is a string made of the symbols a, (, and ) such that the ...
Wheat Wizard's user avatar
  • 103k
8 votes
6 answers
1k views

Let N = [0,1,2,...n-1] be the initial segment of the natural numbers of length n, then all permutations of N can be sorted lexicographically, starting with the identity. The index into this sorted ...
Sophia Antipolis's user avatar
2 votes
11 answers
824 views

Narrative We are standing at the foot of a mountain. To find the best route when climbing the mountain, let's consider all possible routes. On our route, there is no point lower than our starting ...
Sophia Antipolis's user avatar
11 votes
6 answers
1k views

Suppose you find yourself in a house of mirrors! You stand in the corner, and you trace how your image reflects off of mirror A, followed by mirror B, followed by mirror C, followed by mirror A. But ...
Peter Kagey's user avatar
  • 8,165
15 votes
10 answers
2k views

Narrative Recently, I visited Nice (a French city on the Mediterranean coast) and saw a curious tourist wandering through the city. His walk started at the center of the 'Promenade des Anglais'. He ...
Sophia Antipolis's user avatar
12 votes
6 answers
2k views

Consider binary strings (reading from left to right) starting with a '1' as ponds of lily pads. A '1' signifies a frog sitting on the lily pad, and a '0' represents an empty lily pad. Here, we see a ...
Sophia Antipolis's user avatar

15 30 50 per page
1
2 3 4 5
27