Dancing With Bits

BitDancerFollowing on from my recent mathematical investigations into infinities and prime numbers, I’ve branched out into playing with irrational numbers such as the square root of 2, e, and π – numbers whose fractional part is infinite – attempting to create new methods of detecting any hidden patterns in them.

So far, I haven’t had much luck, but then it’s early days and I didn’t expect to discover anything so quickly – and at my first attempt. However, I have come up with some fascinating results showing both the tremendous ‘chaos’ achievable from simple strings of binary digits, and an enormous amount of unexpected and complex symmetry too.

When I decided to look into irrational numbers the first big decision I made was to ignore base 10 or any other base higher than 2 because, it seemed to me, that binary is the fundamental base, and if any patterns are to be found they are mostly likely to be discovered in that base. I could be wrong, though, but I asked myself why would the universe choose to hide its wonders only within a base 10 number system? Well, you have to draw the line somewhere, but maybe later on I can start moving up the bases and seeing if anything different emerges.

BitDancerAnyway, with that choice made I then set about converting a range of irrational numbers to binary, and started thinking about how I was going look for patterns in them. Obviously, the way numbers that follow a decimal (or binary) point work, is that each sequential digit is a factor of the base smaller than the previous one

In decimal the digits after the point are 10ths, then 100ths, then 1000ths and so forth, while in binary they are halfs, quarters, eighths, and so on. Therefore, to examine these sequences of numbers for patterns in any meaningful way, the relationships of scale between each binary digit (bit) to the ones before and after it needed to be taken into account.

But with fractional numbers scaling down in size so quickly, any visualization would rapidly dwindle down in size, so I needed to find another way of giving a relationship to the numbers, and decided to construct a model in which each bit is linked to the next by a line, and I would use different movement values to represent scale. However, because all lines would otherwise be the same length, there would be little indication of bit values themselves (or at the most, lines of only two different lengths for the digits 0 and 1). So I chose to make the lines longer whenever strings of two or more of a bit appeared in sequence – the longer the sequence, the longer the line.

BitDancerThen, to indicate how the lines relate to each other, I chose to rotate each subsequent line by a small amount relative to the previous one. And to avoid the resulting model overly wrapping around on itself, I made every alternate rotation go in the reverse direction. And that is essentially what you will see when you run the program.

If you examine the output closely, you’ll see that the model comprises a long chain of lines connected at ‘hinges’, each rotated a little bit more than the previous one, and with each subsequent line alternating between using a clockwise or counter-clockwise direction for rotation.

To make things even more interesting, I chose to animate the result by placing the model in a loop, in which the rotation amount slowly changes over time. The reason for this is that one particular degree of rotation might show more of a pattern than another. Plus, to test my theory that there may be patterns yet undiscovered, it would be necessary to test all the possible angles of rotation anyway.

BitDancerA few additional tweaks later, such as adding in a camera viewpoint that tracks the model, zooming in and out to keep as much of the animation in full frame view as possible (with a moving and zooming background too), line thickness and alpha transparency depth cues, and finally some keyboard controls, and the program was complete.

Sadly, though, it seems that the four irrational numbers I have so-far tested (π, e, the golden ratio, and the square root of 2) have not yet yielded any discernible patterns (up to 512 bits), other than amazingly complex and beautiful examples of ‘chaos’ in action.

Anyway, to see what would happen if a pattern were found, I performed a final tweak to the program that made it able to create strings of binary from repeated random sub-strings. The results blew my mind with the symmetry that emerged, in what I can only describe as an ever-changing ‘dance’ (as you can see), that even displays 3D effects (with no 3D algorithms).

BitDancer - displaying PiSo now it looks as if, by using this technique, if there are any patterns in irrational numbers, they could well be detectable via this process, although not the first 512 bits of the ones I have tested so far. However, by adding more and more bits, patterns may emerge further down these numbers.

I have versions of the program that go up to 250,000 bits. They run quite slowly, and I haven’t seen anything noteworthy as yet. But who knows whether even further along, the numbers may exhibit interesting effects. Or maybe a pattern might be discovered if every other bit were tested, or every third, or bits were selected via a logarithmic progression, and so on. If there is a pattern anywhere, I believe this process may be the type of program that could detect it, even if it turns out necessary to start running up the bases to do so.

In the meantime, BitDancer, the program I created for this is a fascinating mathematical toy that can create a myriad of amazing effects. I hope you get a chance to play with it – and spend a few minutes examining the different types of patterns possible by pressing the keys shown.

BitDancer – Playing with Bitstrings


  • Caleb

    This really interesting, thanks for sharing. I too am fascinated with primes and irrational patterns, though my attempts at evaluating them are much more elementary. I’m hoping a major breakthrough is found in my lifetime. Keep up the good work!