Block’n’Role

How low can you go? When it comes to standard bases in mathematics, you can’t go lower than 2. But base 2, or binary, is unsurpassable for simplicity and beauty. With only two digits, 1 and 0, you can capture any integer you like:

• 0, 1, 2, 3, 4, 5... -> 0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101101, 101110, 101111, 110000, 110001, 110010, 110011, 110100, 110101, 110110, 110111, 111000, 111001, 111010, 111011, 111100, 111101, 111110, 111111...


Here are a few famous decimal numbers in binary:

• 23 = 10111 in binary
• 666 = 1010011010 in binary
• 1492 = 10111010100 in binary
• 2001 = 11111010001 in binary

As you can see, there’s a problem with binary for human beings. It takes up a lot of space and doesn’t look very distinctive. But that’s easy to solve by converting binary into octal (base 8) or hexadecimal (base 16). One digit in octal is worth three digits in binary and one digit in hexadecimal is worth four digits in binary. So the conversion back and forth is very easy:

• 23 = 10111 → (010,111) → 27 in octal
• 23 = 10111 → (0001,0111) → 17 in hexadecimal
• 666 = 1010011010 → (001,010,011,010) → 1232 in octal
• 666 = 1010011010 → (0010,1001,1010) → 29A in hexademical
• 1492 = 10111010100 → (010,111,010,100) → 2724 in octal
• 1492 = 10111010100 → (0101,1101,0100) → 5D4 in hexademical
• 2001 = 11111010001 → (011,111,010,001) → 3721 in octal
• 2001 = 11111010001 → (0111,1101,0001) → 7D1 in hexademical

But there’s another way to compress a binary number: count the lengths of the runs of 1 and 0. For example, 23 = 10111 and 10111 → one 1, one 0, three 1s → (1,1,3) → 113. That’s not much of a compression, but it usually gets better as the numbers get bigger:

• 2001 = 11111010001 → (5,1,1,3,1) → 51131

From the compressed form you can easily re-create the binary number:

• 51131 → (5,1,1,3,1) → (11111,0,1,000,1) → 11111010001

This block-compression doesn’t work with any other standard base. For example, the compressed form (1,2) in ternary, or base 3, is ambiguous:

• (1,2) → (1,00) → 100 in base 3 = 09 in decimal
• (1,2) → (1,22) → 122 in base 3 = 17 in decimal
• (1,2) → (2,00) → 200 in base 3 = 18 in decimal
• (1,2) → (2,11) → 211 in base 3 = 22 in decimal

The higher the base, the bigger the ambiguity. But ambiguity exists with binary block-compressions too. Look at 51131 ← 11111010001 = 2001 in decimal. Out of context, 51131 is infinitely ambiguous. It could represent a number in any base higher than 5:

• 51131 in base 06 = 006751 in base 10
• 51131 in base 07 = 012419 in base 10
• 51131 in base 08 = 021081 in base 10
• 51131 in base 09 = 033643 in base 10
• 51131 in base 10 = 051131 in base 10
• 51131 in base 11 = 074691 in base 10
• 51131 in base 12 = 105589 in base 10
• 51131 in base 13 = 145211 in base 10
• 51131 in base 14 = 195063 in base 10
• 51131 in base 15 = 256771 in base 10
• 51131 in base 16 = 332081 in base 10
• 51131 in base 17 = 422859 in base 10
• 51131 in base 18 = 531091 in base 10
• 51131 in base 19 = 658883 in base 10
• 51131 in base 20 = 808461 in base 10...

But that ambiguity raises an interesting question. Does the binary block-compression of n ever match the digits of n in another base? Yes, it does:

• 23 = 10111 in base 2 → (1,1,3) and 113 in base 4 = 10111 in base 2 = 23 in base 10

113 in base 4 = 1*4^2 + 1*4 + 3*4^0 = 16+4+3 = 23. You could call this “Block’n’Role”, because the blocks of 1 and 0 allow a binary number to retain its identity but take on a different role, that is, represent a number in a different base. Here’s a list of binary block-numbers that match the digits of n in another base:

• 10111 → (1,1,3) = 113 in base 4 (n=23)
• 11001 → (2,2,1) = 221 in base 3 (n=25)
• 101100 → (1,1,2,2) = 1122 in base 3 (n=44)
• 111001 → (3,2,1) = 321 in base 4 (n=57)
• 1011111 → (1,1,5) = 115 in base 9 (n=95)
• 1100001 → (2,4,1) = 241 in base 6 (n=97)
• 11100001 → (3,4,1) = 341 in base 8 (n=225)
• 100110000 → (1,2,2,4) = 1224 in base 6 (n=304)
• 101110111 → (1,1,3,1,3) = 11313 in base 4 (n=375)
• 111111001 → (6,2,1) = 621 in base 9 (n=505)
• 1110010111 → (3,2,1,1,3) = 32113 in base 4 (n=919)
• 10000011111 → (1,5,5) = 155 in base 30 (n=1055)
• 11111100001 → (6,4,1) = 641 in base 18 (n=2017)
• 1011101110111 → (1,1,3,1,3,1,3) = 1131313 in base 4 (n=6007)
• 11100101110111 → (3,2,1,1,3,1,3) = 3211313 in base 4 (n=14711)
• 10111011101110111 → (1,1,3,1,3,1,3,1,3) = 113131313 in base 4 (n=96119)
• 111001011101110111 → (3,2,1,1,3,1,3,1,3) = 321131313 in base 4 (n=235383)
• 100000111111111000001 → (1,5,9,5,1) = 15951 in base 31 (n=1081281)
• 101110111011101110111 → 11313131313 in b4 = 1537911
• 1110010111011101110111 → 32113131313 in b4 = 3766135
• 1011101110111011101110111 → 1131313131313 in b4 = 24606583
• 11100101110111011101110111 → 3211313131313 in b4 = 60258167
• 10111011101110111011101110111 → 113131313131313 in b4 = 393705335
• 111001011101110111011101110111 → 321131313131313 in b4 = 964130679

The list of block-nums is incomplete, because I’ve skipped some trivial examples where, for all powers 2^p > 2^2, the block-num is “1P” in base b = (2^p – p). For example:

• 2^3 = 08 = 1000 in base 2 → (1,3) and 13 in base 5 = 8, where 5 = 2^3-3 = 8-3
• 2^4 = 16 = 10000 in base 2 → (1,4) and 14 in base 12 = 16, where 12 = 2^4-4 = 16-4
• 2^5 = 32 = 100000 in base 2 → (1,5) and 15 in base 27 = 32, where 27 = 2^5-5 = 32-5
• 2^6 = 64 = 1000000 in base 2 → (1,6) and 16 in base 58 = 64, where 58 = 2^6-6 = 64-6

And note that the block-num matches in base 4 continue for ever, because the pairs 113… and 321… generate their successors using simple formulae in base 4:

• 113... * 100 + 13
• 321... * 100 + 13

For example, 113 and 321 are the first pair of matches:

• 10111 → (1,1,3) = 113 in base 4 (n=23)
• 111001 → (3,2,1) = 321 in base 4 (n=57)

In base 4, 113 * 100 + 13 = 11313 and 321 * 100 + 13 = 32113:

• 101110111 → (1,1,3,1,3) = 11313 in base 4 (n=375)
• 1110010111 → (3,2,1,1,3) = 32113 in base 4 (n=919)

Next, 11313 * 100 + 13 = 1131313 and 32113 * 100 + 13 = 3211313:

• 1011101110111 → (1,1,3,1,3,1,3) = 1131313 in base 4 (n=6007)
• 11100101110111 → (3,2,1,1,3,1,3) = 3211313 in base 4 (n=14711)

And so on.

Advertisements

Weight-Botchers

Suppose you have a balance scale and four weights of 1 unit, 2 units, 4 units and 8 units. How many different weights can you match? If you know binary arithmetic, it’s easy to see that you can match any weight up to fifteen units inclusive. With the object in the left-hand pan of the scale and the weights in the right-hand pan, these are the matches:

01 = 1
02 = 2
03 = 2+1
04 = 4
05 = 4+1
06 = 4+2
07 = 4+2+1
08 = 8
09 = 8+1
10 = 8+2
11 = 8+2+1
12 = 8+4
13 = 8+4+1
14 = 8+4+2
15 = 8+4+2+1

Balance scale


The weights that sum to n match the 1s in the digits of n in binary.

01 = 0001 in binary
02 = 0010 = 2
03 = 0011 = 2+1
04 = 0100 = 4
05 = 0101 = 4+1
06 = 0110 = 4+2
07 = 0111 = 4+2+1
08 = 1000 = 8
09 = 1001 = 8+1
10 = 1010 = 8+2
11 = 1011 = 8+2+1
12 = 1100 = 8+4
13 = 1101 = 8+4+1
14 = 1110 = 8+4+2
15 = 1111 = 8+4+2+1

But there’s another set of four weights that will match anything from 1 unit to 40 units. Instead of using powers of 2, you use powers of 3: 1, 3, 9, 27. But how would you match an object weighing 2 units using these weights? Simple. You put the object in the left-hand scale, the 3-weight in the right-hand scale, and then add the 1-weight to the left-hand scale. In other words, 2 = 3-1. Similarly, 5 = 9-3-1, 6 = 9-3 and 7 = 9-3+1. When the power of 3 is positive, it’s in the right-hand pan; when it’s negative, it’s in the left-hand pan.

This system is actually based on base 3 or ternary, which uses three digits, 0, 1 and 2. However, the relationship between ternary numbers and the sums of positive and negative powers of 3 is more complicated than the relationship between binary numbers and sums of purely positive powers of 2. See if you can work out how to derive the sums in the middle from the ternary numbers on the right:

01 = 1 = 1 in ternary
02 = 3-1 = 2
03 = 3 = 10
04 = 3+1 = 11
05 = 9-3-1 = 12
06 = 9-3 = 20
07 = 9-3+1 = 21
08 = 9-1 = 22
09 = 9 = 100
10 = 9+1 = 101
11 = 9+3-1 = 102
12 = 9+3 = 110
13 = 9+3+1 = 111
14 = 27-9-3-1 = 112
15 = 27-9-3 = 120
16 = 27-9-3+1 = 121
17 = 27-9-1 = 122
18 = 27-9 = 200
19 = 27-9+1 = 201
20 = 27-9+3-1 = 202
21 = 27-9+3 = 210
22 = 27-9+3+1 = 211
23 = 27-3-1 = 212
24 = 27-3 = 220
25 = 27-3+1 = 221
26 = 27-1 = 222
27 = 27 = 1000
28 = 27+1 = 1001
29 = 27+3-1 = 1002
30 = 27+3 = 1010
31 = 27+3+1 = 1011
32 = 27+9-3-1 = 1012
33 = 27+9-3 = 1020
34 = 27+9-3+1 = 1021
35 = 27+9-1 = 1022
36 = 27+9 = 1100
37 = 27+9+1 = 1101
38 = 27+9+3-1 = 1102
39 = 27+9+3 = 1110
40 = 27+9+3+1 = 1111

To begin understanding the sums, consider those ternary numbers containing only 1s and 0s, like n = 1011[3], which equals 31 in decimal. The sum of powers is straightforward, because all of them are positive and they’re easy to work out from the digits of n in ternary: 1011 = 1*3^3 + 0*3^2 + 1*3^1 + 1*3^0 = 27+3+1. Now consider n = 222[3] = 26 in decimal. Just as a decimal number consisting entirely of 9s is always 1 less than a power of 10, so a ternary number consisting entirely of 2s is always 1 less than a power of three:

999 = 1000 - 1 = 10^3 - 1 (decimal)
222 = 1000[3] - 1 (ternary) = 26 = 27-1 = 3^3 - 1 (decimal)

If a ternary number contains only 2s and is d digits long, it will be equal to 3^d – 1. But what about numbers containing a mixture of 2s, 1s and 0s? Well, all ternary numbers containing at least one 2 will have a negative power of 3 in the sum. You can work out the sum by using the following algorithm. Suppose the number is five digits long and the rightmost digit is digit #1 and the leftmost is digit #5:

01. i = 1, sum = 0, extra = 0, posi = true.
02. if posi = false, goto step 07.
03. if digit #i = 0, sum = sum + 0.
04. if digit #i = 1, sum = sum + 3^(i-1).
05. if digit #i = 2, sum = sum - 3^(i-1), extra = 3^5, posi = false.
06. goto step 10.
07. if digit #i = 0, sum = sum + 3^(i-1), extra = 0, posi = true.
08. if digit #i = 1, sum = sum - 3^(i-1).
09. if digit #i = 2, sum = sum + 0.
10. i = i+1. if i <= 5, goto step 2.
11. print sum + extra.

As the number of weights grows, the advantages of base 3 get bigger:

With 02 weights, base 3 reaches 04 and base 2 reaches 3: 04-3 = 1.
With 03 weights, base 3 reaches 13 and base 2 reaches 7: 13-7 = 6.
With 04 weights, 000040 - 0015 = 000025
With 05 weights, 000121 - 0031 = 000090
With 06 weights, 000364 - 0063 = 000301
With 07 weights, 001093 - 0127 = 000966
With 08 weights, 003280 - 0255 = 003025
With 09 weights, 009841 - 0511 = 009330
With 10 weights, 029524 - 1023 = 028501
With 11 weights, 088573 - 2047 = 086526
With 12 weights, 265720 - 4095 = 261625...

But what about base 4, or quaternary? With four weights of 1, 4, 16 and 64, representing powers of 4 from 4^0 to 4^3, you should be able to weigh objects from 1 to 85 units using sums of positive and negative powers. In fact, some weights can’t be matched. As you can see below, if n in base 4 contains a 2, it can’t be represented as a sum of positive and negative powers of 4. Nor can certain other numbers:

1 = 1 ← 1
2 has no sum = 2
3 = 4-1 ← 3
4 = 4 ← 10 in base 4
5 = 4+1 ← 11 in base 4
6 has no sum = 12 in base 4
7 has no sum = 13
8 has no sum = 20
9 has no sum = 21
10 has no sum = 22
11 = 16-4-1 ← 23
12 = 16-4 ← 30
13 = 16-4+1 ← 31
14 has no sum = 32
15 = 16-1 ← 33
16 = 16 ← 100
17 = 16+1 ← 101
18 has no sum = 102
19 = 16+4-1 ← 103
20 = 16+4 ← 110
21 = 16+4+1 ← 111
22 has no sum = 112
23 has no sum = 113
24 has no sum = 120
25 has no sum = 121
26 has no sum = 122
27 has no sum = 123
[...]

With a more complicated balance scale, it’s possible to use weights representing powers of base 4 and base 5 (use two pans on each arm of the scale instead of one, placing the extra pan at the midpoint of the arm). But with a standard balance scale, base 3 is the champion. However, there is a way to do slightly better than standard base 3. You do it by botching the weights. Suppose you have four weights of 1, 4, 10 and 28 (representing 1, 3+1, 9+1 and 27+1). There are some weights n you can’t match, but because you can match n-1 and n+1, you know what these unmatchable weights are. Accordingly, while weights of 1, 3, 9 and 27 can measure objects up to 40 units, weights of 1, 4, 10 and 28 can measure objects up to 43 units:

1 = 1 ← 1
2 has no sum = 2
3 = 4-1 ← 10 in base 3
4 = 4 ← 11 in base 3
5 = 4+1 ← 12 in base 3
6 = 10-4 ← 20
7 = 10-4+1 ← 21
8 has no sum = 22
9 = 10-1 ← 100
10 = 10 ← 101
11 = 10+1 ← 102
12 has no sum = 110
13 = 10+4-1 ← 111
14 = 10+4 ← 112
15 = 10+4+1 ← 120
16 has no sum = 121
17 = 28-10-1 ← 122
18 = 28-10 ← 200
19 = 28-10+1 ← 201
20 has no sum = 202
21 = 28-10+4-1 ← 210
22 = 28-10+4 ← 211
23 = 28-4-1 ← 212
24 = 28-4 ← 220
25 = 28-4+1 ← 221
26 has no sum = 222
27 = 28-1 ← 1000
28 = 28 ← 1001
29 = 28+1 ← 1002
30 has no sum = 1010
31 = 28+4-1 ← 1011
32 = 28+4 ← 1012
33 = 28+4+1 ← 1020
34 = 28+10-4 ← 1021
35 = 28+10-4+1 ← 1022
36 has no sum = 1100
37 = 28+10-1 ← 1101
38 = 28+10 ← 1102
39 = 28+10+1 ← 1110
40 = has no sum = 1111*
41 = 28+10+4-1 ← 1112
42 = 28+10+4 ← 1120
43 = 28+10+4+1 ← 1121


*N.B. 40 = 82-28-10-4, i.e. has a sum when another botched weight, 82 = 3^4+1, is used.

Mice Thrice

Twice before on Overlord-in-terms-of-Core-Issues-around-Maximal-Engagement-with-Key-Notions-of-the-Über-Feral, I’ve interrogated issues around pursuit curves. Imagine four mice or four beetles each sitting on one corner of a square and looking towards the centre of the square. If each mouse or beetle begins to run towards the mouse or beetle to its left, it will follow a curving path that takes it to the centre of the square, like this:

vertices = 4, pursuit = +1


The paths followed by the mice or beetles are pursuit curves. If you arrange eight mice clockwise around a square, with a mouse on each corner and a mouse midway along each side, you get a different set of pursuit curves:

v = 4 + 1 on the side, p = +1


Here each mouse is pursuing the mouse two places to its left:

v = 4+s1, p = +2


And here each mouse is pursuing the mouse three places to its left:

v = 4+s1, p = +3


Now try a different arrangement of the mice. In the square below, the mice are arranged clockwise in rows from the bottom right-hand corner. That is, mouse #1 begins on the bottom left-hand corner, mouse #2 begins between that corner and the centre, mouse #3 begins on the bottom left-hand corner, and so on. When each mice runs towards the mouse three places away, these pursuit curves appear:

v = 4 + 1 internally, p = +3


Here are some more:

v = 4 + i1, p = +5


v = 4 + i2, p = +1


v = 4 + i2, p = +2


So far, all the mice have eventually run to the centre of the square, but that doesn’t happen here:

v = 4 + i2, p = 4


Here are more pursuit curves for the v4+i2 mice, using an animated gif:

v = 4 + i2, p = various (animated — open in new tab for clearer image)


And here are more pursuit curves that don’t end in the centre of the square:

v = 4 + i4, p = 4


v = 4 + i4, p = 8


v = 4 + i4, p = 12


v = 4 + i4, p = 16


But the v4+i4 pursuit curves more usually look like this:

v = 4 + i4, p = 7


Now try adapting the rules so that mice don’t run directly towards another mouse, but towards the point midway between two other mice. In this square, the odd- and even-numbered mice follow different rules. Mice #1, #3, #5 and #7 run towards the point midway between the mice one and two places away, while ice #2, #4, #6 and #8 run towards the point midway between the mice two and seven places away:

v = 4 + s1, p(1,3,5,7) = 1,2, p(2,4,6,8) = 2,7


I think the curves are very elegant. Here’s a slight variation:

v = 4 + s1, p1 = 1,3, p2 = 2,7


Now try solid curves:

v = 4 + s1, p1 = 1,3, p2 = 2,7 (red)


v = 4 + s1, p1 = 1,3, p2 = 2,7 (yellow-and-blue)


And some variants:

v = 4 + s1, p1 = 1,7, p2 = 1,2


v = 4 + s1, p1 = 2,3, p2 = 2,5


v = 4 + s1, p1 = 5,6, p2 = 1,3


v = 4 + s1, p1 = 5,6, p2 = 1,4


v = 4 + s1, p1 = 5,6, p2 = 1,6


Elsewhere other-posted:

Polymorphous Pursuit
Persecution Complex

Horn Again

Pre-previously on Overlord-in-terms-of-Core-Issues-around-Maximal-Engagement-with-Key-Notions-of-the-Über-Feral, I interrogated issues around this shape, the horned triangle:

unicorn_reptile_static

Horned Triangle (more details)


Now I want to look at the tricorn (from Latin tri-, “three”, + -corn, “horn”). It’s like a horned triangle, but has three horns instead of one:

Tricorn, or three-horned triangle


These are the stages that make up the tricorn:

Tricorn (stages)


Tricorn (animated)


And there’s no need to stop at triangles. Here is a four-horned square, or quadricorn:

Quadricorn


Quadricorn (animated)


Quadricorn (coloured)


And a five-horned pentagon, or quinticorn:

Quinticorn, or five-horned pentagon


Quinticorn (anim)


Quinticorn (col)


And below are some variants on the shapes above. First, the reversed tricorn:

Reversed Tricorn


Reversed Tricorn (anim)


Reversed Tricorn (col)


The nested tricorn:

Nested Tricorn (anim)


Nested Tricorn (col)


Nested Tricorn (red-green)


Nested Tricorn (variant col)


The nested quadricorn:

Nested Quadricorn (anim)


Nested Quadricorn


Nested Quadricorn (col #1)


Nested Quadricorn (col #2)


Finally (and ferally), the pentagonal octopus or pentapus:

Pentapus (anim)


Pentapus


Pentapus #2


Pentapus #3


Pentapus #4


Pentapus #5


Pentapus #6


Pentapus (col anim)


Elsewhere other-engageable:

The Art Grows Onda — the horned triangle and Katsushika Hokusai’s painting The Great Wave off Kanagawa (c. 1830)

Fink Frakt

Pre-previously on Overlord-In-Terms-of-Issues-Around-Engagement-with-the-Über-Feral, I’ve looked at various ways of creating fractals by restricting the moves of a point jumping towards the vertices of a polygon. For example, the point can be banned from jumping towards the same vertex twice in a row. This time, I want to look at fractals created not by restriction, but by compulsion. If the point jumps towards vertex v and then tries to jump towards vertex v again, it will be forced to jump towards vertex v+1 instead, and so on.

You could call vv+1 a forced increment or finc. So these are finc fractals. In some cases, restriction and compulsion create the same fractals, but I’ve found some new fractals using compulsion. Consider the fractal created by the rule v[-2]+1, v[-1] → +0,+1, where the subscripts refer to the history of jumps: v[-2] is the jump-before-last, v[-1] is the last jump. If the new vertex, v[0], chosen is the same as v[-2]+1 (e.g., v[0] = 2 = v[-2]+1 = 1+1), then the forced increment is 0, i.e., the point is allowed to choose that jump. However, if v[0] = v[-1], then the forced increment is 1 and the point must jump towards v[-1]+1.

Here is the fractal in question:

v[-2]+1, v[-1] → +0,+1 (black-and-white)


v[-2]+1, v[-1] → +0,+1 (colour)


1,0 → +0,+1 (animated)


1,0 → +1,+0 (bw)


1,0 → +1,+0 (col)


1,0 → +1,+0 (anim)


1,0 → +1,+1 (bw)


1,0 → +1,+1 (col)


1,0 → +1,+1 (animated)


0,1 → +2,+1 (anim)


0,1 → +3,+1


1,0 → +0,+1


1,0 → +1,+0


1,1 → +0,+1


1,1 → +1,+2


1,1 → +1,+3


1,1 → +2,+1


1,2 → +0,+3


1,3 → +0,+1


2,2 → +0,+1


But suppose the history of jumps records not actual jumps, but the jumps the point wanted to make instead. In some cases, the jump made will be the same as the jump originally chosen, but in other cases it won’t. Here are some fractals using this method:

0 → +2


0 → +3


2 → +1


2 → +2


Leave and Let Dice

Imagine a game with six players, numbered #1 to #6, and one six-sided die. Someone rolls the die and the player who matches the number wins the game. That is, if the die rolls 1, player #1 wins; if the die rolls 2, player #2 wins; and so on. With a fair die, this is a fair game, because each player has exactly a 1/6 chance of winning. You could call it a simultaneous game, because all players are playing at once. It has one rule:

• If the die rolls n, then player #n wins.

Now try a different game with six players and one die. Player #1 rolls the die. If he gets 1, he wins the game. If not, then he leaves the game and player #2 rolls the die. If he gets 2, he wins the game. If not, then he leaves the game and player #3 rolls the die. And so on. You could call this a sequential game, because the players are playing in sequence. It has two rules:

• If player #n rolls n on the die, then he wins.
• If player #n doesn’t roll n, then player n+1 rolls the die.

Is it a fair game? No, definitely not. Player #1 has the best chance of winning. 1/6 or 16.6% of the time he rolls 1 and wins the game. 5/6 of the time, he rolls 2, 3, 4, 5 or 6 and passes the die to player #2. Now player #2 has a 1/6 chance of rolling a 2 and winning. But he has the opportunity to roll the die only 5/6 of the time, so his chance of winning the game is 1/6 * 5/6 = 5/36 = 13.8%. However, if player #2 rolls a 1, 3, 4, 5 or 6, then he loses and player #3 rolls the die. But player #3 has that opportunity only 5/6 * 5/6 = 25/36 of the time. So his chance of winning is 1/6 * 25/36 = 11.57%. And so on.

To put it another way, if the six players play 46656 = 6^6 games under the sequential rules, then on average:

• Player #1 wins 7776 games
• Player #2 wins 6480 games
• Player #3 wins 5400 games
• Player #4 wins 4500 games
• Player #5 wins 3750 games
• Player #6 wins 3125 games
• 15625 games end without a winner.

In other words, player #1 is 20% more likely to win than player #2, 44% more likely than player #3, 72.8% more likely than player #4, 107% more likely than player #5, and 148.8% more likely than player #6. Furthermore, player #2 is 20% more likely to win than player #3, 44% more likely than player #4, 72.8% more likely than player #5, and so on.

But there is a simple way to make the sequential game perfectly fair, so long as it’s played with a fair die. At least, I’ve thought of a simple way, but there might be more than one.




To make the sequential game fair, you add an extra rule:

1. If player #n rolls n on the die, he wins the game.
2. If player #n rolls a number greater than n, he loses and the die passes to player n+1.
3. If player #n rolls a number less than n, then he rolls again.

Let’s run through a possible game to see that it’s fair. Player #1 rolls first. He has a 1/6 chance of rolling a 1 and winning the game. However, 5/6 of the time he loses and passes the die to player #2. If player #2 rolls a 1, he rolls again. In other words, player #2 is effectively playing with a five-sided die, because all rolls of 1 are ignored. Therefore, he has a 1/5 chance of winning the game at that stage.

But hold on: a 1/5 chance of winning is better than a 1/6 chance, which is what player #1 had. So how is the game fair? Well, note the qualifying phrase at the end of the previous paragraph: at that stage. The game doesn’t always reach that stage, because if player #1 rolls a 1, the game is over. Player #2 rolls only if player doesn’t roll 1, which is 5/6 of the time. Therefore player #2’s chance of winning is really 1/5 * 5/6 = 5/30 = 1/6.

However, 4/5 of the time player #2 rolls a 3, 4, 5 or 6 and the die passes to player #3. If player #3 rolls a 1 or 2, he rolls again. In other words, player #3 is effectively playing with a four-sided die, because all rolls of 1 and 2 are ignored. Therefore, he has a 1/4 chance of winning the game at that stage.

A 1/4 chance of winning is better than a 1/5 chance and a 1/6 chance, but the same reasoning applies as before. Player #3 rolls the die only 5/6 * 4/5 = 20/30 = 2/3 of the time, so his chance of winning is really 1/4 * 2/3 = 2/12 = 1/6.

However, 3/4 of the time player #2 rolls a 4, 5 or 6 and the die passes to player #4. If player #4 rolls a 1, 2 or 3, he rolls again. In other words, player #4 is effectively playing with a three-sided die, because all rolls of 1, 2 and 3 are ignored. Therefore, he has a 1/3 chance of winning the game at that stage. 1/3 > 1/4 > 1/5 > 1/6, but the same reasoning applies as before. Player #4 rolls the die only 5/6 * 4/5 * 3/4 = 60/120 = 1/2 of the time, so his chance of winning is really 1/3 * 1/2 = 1/6.

And so on. If the die reaches player #5 and he gets a 1, 2, 3 or 4, then he rolls again. He is effectively rolling with a two-sided die, so his chance of winning is 1/2 * 5/6 * 4/5 * 3/4 * 2/3 = 120/720 = 1/6. If player #5 rolls a 6, he loses and the die passes to player #6. But there’s no need for player #6 to roll the die, because he’s bound to win. He rolls again if he gets a 1, 2, 3, 4 or 5, so eventually he must get a 6 and win the game. If player #5 loses, then player #6 automatically wins.

It’s obvious that this form of the game will get slower as more players drop out, because later players will be rolling again more often. To speed the game up, you can refine the rules like this:

1. If Player #1 rolls a 1, he wins the game. Otherwise…
2. If player #2 rolls a 2, he wins the game. If he rolls a 1, he rolls again. Otherwise…
3. Player #3 rolls twice and adds his scores. If the total is 3, 4 or 5, he wins the game. Otherwise…
4. Player #4 rolls once. If he gets 1 or 2, he wins the game. Otherwise…
5. Player #5 rolls once. If he gets 1, 2 or 3, he wins the game. Otherwise…
6. Player #6 wins the game.

Only player #2 might have to roll more than twice. Player #3 has to roll twice because he needs a way to get a 1/4 chance of winning. If you roll two dice, there are:

• Two ways of getting a total of 3: roll #1 is 1 and roll #2 is 2, or vice versa.
• Three ways of getting a total of 4 = 1+3, 3+1, 2+2.
• Four ways of getting 5 = 1+4, 4+1, 2+3, 3+2.

This means player #3 has 2 + 3 + 4 = 9 ways of winning. But there are thirty-six ways of rolling one die twice. Therefore player #3 has a 9/36 = 1/4 chance of winning. Here are the thirty-six ways of rolling one die twice, with asterisks marking the winning totals for player #3:

01. (1,1)
02. (1,2)*
03. (2,1)*
04. (1,3)*
05. (3,1)*
06. (1,4)*
07. (4,1)*
08. (1,5)
09. (5,1)
10. (1,6)
11. (6,1)
12. (2,2)*
13. (2,3)*
14. (3,2)*
15. (2,4)
16. (4,2)
17. (2,5)
18. (5,2)
19. (2,6)
20. (6,2)
21. (3,3)
22. (3,4)
23. (4,3)
24. (3,5)
25. (5,3)
26. (3,6)
27. (6,3)
28. (4,4)
29. (4,5)
30. (5,4)
31. (4,6)
32. (6,4)
33. (5,5)
34. (5,6)
35. (6,5)
36. (6,6)

Fract-Hills

The Farey sequence is a fascinating sequence of fractions that divides the interval between 0/1 and 1/1 into smaller and smaller parts. To find the Farey fraction a[i] / b[i], you simply find the mediant of the Farey fractions on either side:

• a[i] / b[i] = (a[i-1] + a[i+1]) / (b[i-1] + b[i+1])

Then, if necessary, you reduce the numerator and denominator to their simplest possible terms. So the sequence starts like this:

• 0/1, 1/1

To create the next stage, find the mediant of the two fractions above: (0+1) / (1+1) = 1/2

• 0/1, 1/2, 1/1

For the next stage, there are two mediants to find: (0+1) / (1+2) = 1/3, (1+1) / (2+3) = 2/3

• 0/1, 1/3, 1/2, 2/3, 1/1

Note that 1/2 is the mediant of 1/3 and 2/3, that is, 1/2 = (1+2) / (3+3) = 3/6 = 1/2. The next stage is this:

• 0/1, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 1/1

Now 1/2 is the mediant of 2/5 and 3/5, that is, 1/2 = (2+3) / (5+5) = 5/10 = 1/2. Further stages go like this:

• 0/1, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 1/1

• 0/1, 1/6, 1/5, 2/9, 1/4, 3/11, 2/7, 3/10, 1/3, 4/11, 3/8, 5/13, 2/5, 5/12, 3/7, 4/9, 1/2, 5/9, 4/7, 7/12, 3/5, 8/13, 5/8, 7/11, 2/3, 7/10, 5/7, 8/11, 3/4, 7/9, 4/5, 5/6, 1/1

• 0/1, 1/7, 1/6, 2/11, 1/5, 3/14, 2/9, 3/13, 1/4, 4/15, 3/11, 5/18, 2/7, 5/17, 3/10, 4/13, 1/3, 5/14, 4/11, 7/19, 3/8, 8/21, 5/13, 7/18, 2/5, 7/17, 5/12, 8/19, 3/7, 7/16, 4/9, 5/11, 1/2, 6/11, 5/9, 9/16, 4/7, 11/19, 7/12, 10/17, 3/5, 11/18, 8/13, 13/21, 5/8, 12/19, 7/11, 9/14, 2/3, 9/13, 7/10, 12/17, 5/7, 13/18, 8/11, 11/15, 3/4, 10/13, 7/9, 11/14, 4/5, 9/11, 5/6, 6/7, 1/1

The Farey sequence is actually a fractal, as you can see more easily when it’s represented as an image:

Farey fractal stage #1, representing 0/1, 1/2, 1/1

Farey fractal stage #2, representing 0/1, 1/3, 1/2, 2/3, 1/1

Farey fractal stage #3, representing 0/1, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 1/1

Farey fractal stage #4, representing 0/1, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 1/1

Farey fractal stage #5

Farey fractal stage #6

Farey fractal stage #7

Farey fractal stage #8

Farey fractal stage #9

Farey fractal stage #10

Farey fractal (animated)

That looks like the slope of a hill to me, so you could call it a Farey fract-hill. But Farey fract-hills or Farey fractals aren’t confined to the unit interval, 0/1 to 1/1. Here are Farey fractals for the intervals 0/1 to n/1, n = 1..10:

Farey fractal for interval 0/1 to 1/1

Farey fractal for interval 0/1 to 2/1, beginning 0/1, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 1/1, 5/4, 4/3, 7/5, 3/2, 8/5, 5/3, 7/4, 2/1

Farey fractal for interval 0/1 to 3/1, beginning 0/1, 1/3, 1/2, 2/3, 1/1, 5/4, 4/3, 7/5, 3/2, 8/5, 5/3, 7/4, 2/1, 7/3, 5/2, 8/3, 3/1

Farey fractal for interval 0/1 to 4/1, beginning
0/1, 1/3, 1/2, 2/3, 1/1, 4/3, 3/2, 5/3, 2/1, 7/3, 5/2, 8/3, 3/1, 10/3, 7/2, 11/3, 4/1

Farey fractal for interval 0/1 to 5/1, beginning 0/1, 1/1, 5/4, 10/7, 5/3, 7/4, 2/1, 7/3, 5/2, 8/3, 3/1, 13/4, 10/3, 25/7, 15/4, 4/1, 5/1

Farey fractal for interval 0/1 to 6/1, beginning 0/1, 1/2, 1/1, 4/3, 3/2, 5/3, 2/1, 5/2, 3/1, 7/2, 4/1, 13/3, 9/2, 14/3, 5/1, 11/2, 6/1

Farey fractal for interval 0/1 to 7/1, beginning 0/1, 7/5, 7/4, 2/1, 7/3, 21/8, 14/5, 3/1, 7/2, 4/1, 21/5, 35/8, 14/3, 5/1, 21/4, 28/5, 7/1

Farey fractal for interval 0/1 to 8/1, beginning 0/1, 1/2, 1/1, 3/2, 2/1, 5/2, 3/1, 7/2, 4/1, 9/2, 5/1, 11/2, 6/1, 13/2, 7/1, 15/2, 8/1

Farey fractal for interval 0/1 to 9/1, beginning 0/1, 1/1, 3/2, 2/1, 3/1, 7/2, 4/1, 13/3, 9/2, 14/3, 5/1, 11/2, 6/1, 7/1, 15/2, 8/1, 9/1

Farey fractal for interval 0/1 to 10/1, beginning 0/1, 5/4, 5/3, 2/1, 5/2, 3/1, 10/3, 15/4, 5/1, 25/4, 20/3, 7/1, 15/2, 8/1, 25/3, 35/4, 10/1

The shape of the slope is determined by the factorization of n:

n = 12 = 2^2 * 3

n = 16 = 2^4

n = 18 = 2 * 3^2

n = 20 = 2^2 * 5

n = 25 = 5^2

n = 27 = 3^3

n = 32 = 2^5

n = 33 = 3 * 11

n = 42 = 2 * 3 * 7

n = 64 = 2^6

n = 65 = 5 * 13

n = 70 = 2 * 5 * 7

n = 77 = 7 * 11

n = 81 = 3^4

n = 96 = 2^5 * 3

n = 99 = 3^2 * 11

n = 100 = 2^2 * 5^2

Farey fractal-hills, n = various

Jumping Jehosophracts!

As I’ve shown pre-previously on Overlord-in-terms-of-issues-around-the-Über-Feral, you can create interesting fractals by placing restrictions on a point jumping inside a fractal towards a randomly chosen vertex. For example, the point can be banned from jumping towards the same vertex twice in a row, and so on.

But you can use other restrictions. For example, suppose that the point can jump only once or twice towards any vertex, that is, (j = 1,2). It can then jump towards the same vertex again, but not the same number of times as it previously jumped. So if it jumps once, it has to jump twice next time; and vice versa. If you use this rule on a pentagon, this fractal appears:

v = 5, j = 1,2 (black-and-white)


v = 5, j = 1,2 (colour)


If the point can also jump towards the centre of the pentagon, this fractal appears:

v = 5, j = 1,2 (with centre)


And if the point can also jump towards the midpoints of the sides:

v = 5, j = 1,2 (with midpoints)


v = 5, j = 1,2 (with midpoints and centre)


And here the point can jump 1, 2 or 3 times, but not once in a row, twice in a row or thrice in a row:

v = 5, j = 1,2,3


v = 5, j = 1,2,3 (with centre)


Here the point remembers its previous two moves, rather than just its previous move:

v = 5, j = 1,2,3, hist = 2 (black-and-white)


v = 5, j = 1,2,3, hist = 2


v = 5, j = 1,2,3, hist = 2 (with center)


v = 5, j = 1,2,3, hist = 2 (with midpoints)


v = 5, j = 1,2,3, hist = 2 (with midpoints and centre)


And here are hexagons using the same rules:

v = 6, j = 1,2 (black-and-white)


v = 6, j = 1,2


v = 6, j = 1,2 (with centre)


And octagons:

v = 8, j = 1,2


v = 8, j = 1,2 (with centre)


v = 8, j = 1,2,3, hist = 2


v = 8, j = 1,2,3, hist = 2


v = 8, j = 1,2,3,4 hist = 3


v = 8, j = 1,2,3,4 hist = 3 (with center)


The Hex Fractor

Pre-previously on Overlord-in-terms-of-issues-around-the-Über-Feral, I looked at the fractals created when various restrictions are placed on a point jumping at random half-way towards the vertices of a square. For example, the point can be banned from jumping towards the same vertex twice in a row or towards the vertex to the left of the vertex it has just jumped towards, and so on.

Today I want to look at what happens to a similar point moving inside pentagons and hexagons. If the point can’t jump twice towards the same vertex of a pentagon, this is the fractal that appears:

Ban second jump towards same vertex (v + 0)


Ban second jump towards same vertex (color)


If the point can’t jump towards the vertex immediately to the left of the one it’s just jumped towards, this is the fractal that appears:

Ban jump towards v + 1


Ban jump towards v + 1 (color)


And this is the fractal when the ban is on the vertex two places to the left:

Ban jump towards v + 2


Ban jump towards v + 2 (color)


You can also ban more than one vertex:

Ban jump towards v + 0,1


Ban jump towards v + 1,2


Ban jump towards v + 1,4


Ban jump towards v + 1,4 (color)


Ban jump towards v + 2,3


And here are fractals created in similar ways inside hexagons:

Ban jump towards v + 0,1


Ban jump towards v + 0,3


Ban jump towards v + 0,1,2


Ban jump towards v + 0,1,2 (color)


Ban jump towards v + 0,1,4


Ban jump towards v + 0,1,5


Ban jump towards v + 0,2,4


Ban jump towards v + 0,2,4 (color)


Ban jump towards v + 1,2,3


Ban jump towards v + 1,2,3 (color)


Ban jump towards v + 1,2,4


Ban jump towards v + 1,2,4, (color)


Ban jump towards v + 1,3,5


Ban jump towards v + 1,3,5 (color)


Ban jump towards v + 1,2


Ban jump towards v + 1,2


Ban jump towards v + 1,3


Ban jump towards v + 1,3 (color)


Ban jump towards v + 1,5


Ban jump towards v + 1,5 (color)


Ban jump towards v + 2,3


Ban jump towards v + 2,3 (color)


Ban jump towards v + 2,4


Ban jump towards v + 2,4 (color)


Elsewhere other-accessible:

Square Routes Re-Verticed

Square Routes Re-Verticed

Start with a point in the middle of a square. Allow it to make a series of, say, eight jumps towards the vertices of the square, but with one restriction: it can’t jump towards the same vertex twice in a row. When the point has made the eight jumps, mark its position. If you do this for every possible route, the result will look like this:

Ban jump towards same vertex


And here’s a different restriction: the point can’t jump towards the vertex immediately to the left of the vertex it has just jumped towards:

Ban jump towards v + 1


And here it can’t jump towards the vertex diagonally opposite the vertex it has just jumped towards:

Ban jump towards v + 2


Now allow the point to jump not just towards the vertices, but towards points midway between the vertices. And expand and reverse the restrictions: instead of not allowing a jump towards v + i1, v + i2…, only allow a jump towards v + i1, v + i2… Some interesting shapes appear:

Jump must be towards v, v + 1 or v + 2 (one point between vertices)


v, v + 1 or v + 6


v, v + 2 or v + 3


v, v + 2 or v + 4


v, v + 2 or v + 6


v, v + 3 or v + 4


v, v + 3 or v + 5


v, v + 2 or v + 7


v + 1, v + 4 or v + 7


v, v + 1 or v + 6 (two points between vertices)


v, v + 2 or v + 4


v, v + 2 or v + 6


v, v + 2 or v + 9


v, v + 3 or v + 6


v, v + 3 or v + 8


v, v + 4 or v + 8


v, v + 5 or v + 7


v , v + 6 or v + 11


v + 1, v + 5 or v + 6


v + 1, v + 2 or v + 10


v + 1, v + 6 or v + 10


v + 1, v + 6 or v + 11


v + 2, v + 6 or v + 10


Elsewhere other-posted:

Square Routes
Square Routes Revisited
Square Routes Re-Revisited
Square Routes Re-Re-Revisited