Combinatorics can be a bit weird sometimes: the number of ways to arrange N Tetris pieces into a 2-by-2N rectangle is the Nth Fibonacci number squared.
Remote
ruud de rooij
@ruuddotorg@hachyderm.io
mastodon 4.7.3310 Followers
192 Following
11 Posts
Joined November 23, 2022
Open post
17
0
2
0
Open post
The 32 distinct ways to build a 2x2x3 tower out of 1x1x2 blocks.
11
0
3
0
Open post
There are 2025 distinct ways to choose the letters of the word WONDERFUL from the grid, so that each letter is in a unique row and column.
Have a WONDERFUL 2025!
3
0
2
0
Open post
@rich@mastodon.gamedev.place Thank you!
Usually when I have an idea, I check oeis.org for details. For example, this particular case is described in https://oeis.org/A006253.
That gives me an idea of the complexity (and how many results I should expect) and usually an idea for the algorithm.
The actual algorithm varies based on the problem, though there are common approaches (e.g. things based on Catalan numbers usually use a recursive algorithm, versus this one which was just brute-force).
Hope this helps!
1
0
0
0