Tämä asiakirja on saatavilla myös suomeksi. Dieses Dokument ist auch auf Deutsch erhältlich.

Marko Mäkelä’s software projects: Regular Bedspreads

In the Easter of 2003, when my wife was expecting our first child, she and my mother-in-law were crocheting a variegated bedsheet from spare woolen threads. Because it looked too random to me, I decided to design some colour patterns for the smallest possible number of distinct colours.

[6-colour bedspread]The original sheet comprised squares of three colours each. I wanted to create a bedsheet consisting of all different squares fulfilling some simple rule. First, I required the colours in a square to be distinct. Since the order of colours in the square matters, one can choose three colours from a palette of n in n×(n-1)×(n-2) ways. For n=6, we get 120 different squares, which can be arranged in a 12×10 matrix.

[5-colour bedspread]The next natural step was to see if the number of colours can be reduced further. I noticed that 120=5×4×3×2×1. This is a strong hint that five colours might be enough to generate 120 distinct squares. In fact, from that equation it is obvious that there are 120 distinct squares, each consisting of 4 (or 5) colours out of the 5-colour palette. It took some fiddling to get a nice pattern out of the squares.

[4-colour cushion cover]In the Easter of 2008, my wife wanted to knit cushion covers from the wool that was left over from the bedspreads. From four colours, we can obtain 24=4×3×2×1 different 3-colour (or 4-colour) squares, or 4×3 squares on both sides of a cushion.

The generating programs, written in plain C, output the images in NetPBM PPM format. Feel free to examine or download the C source code of the generator of the 6-colour bedsheet, the generator of the 5-colour bedsheet and the generator of the 4-colour cushion cover.