View Single Post
Old 2009-01-16, 08:53   #1
only_human
 
only_human's Avatar
 
"Gang aft agley"
Sep 2002

2·1,877 Posts
Default 2-d binary representation

This isn't quite mathematics but is a bit pretty.
  • write a binary number
  • pick another binary number and write it vertically starting with every "1" in the first number
  • every space not explicitly written in this rectangle contains a 0
The pattern written in this representation will have a total value equal to the product of the row value times the column value.

Taking a number, e.g. 23 in base ten is "10111" in binary and and using it both horizontally and vertically creates this:
Code:
10111
00000
10111
10111
10111
These bits add up to 23 squared when added using the positional values for each "1" as listed below.

The positional values in this represent:
Code:
28 27 26 25 24
27 26 25 24 23
26 25 24 23 22
25 24 23 22 21
24 23 22 21 20
The most significant bit is in the top left corner. The least significant bit is in the bottom right corner. This is faithful to ordinary binary representation in that any bit to the left (or up) is more significant than any bit to the right (or below). I think of writing binary numbers this way as a canonical representation because the rows can be generated from a traditional binary multiply routine (without doing any adding and with trailing 0s that are only implicitly here by position) and also because it is a valid Boolean truth table:
Code:
& 10111
1 10111
0 00000
1 10111
1 10111
1 10111
These 2-d canonical representations are products of 2 factors found along rows and columns. When the factors are equal, the result is a representation of a square. I started to think about this representation as an attempt develop a little intuition about numbers. These 2-d patterns can be quickly be drawn. They can be extended into 3-d representations easily enough with three factors directly readable on the edges of length, width, and height.

With regards to squares (values that total up to n2 -- not merely square sized portions on paper), the pattern on its' edges is also found on its' main diagonal (top-left to bottom-right diagonal); once a square is drawn, smaller valid squares are contained within it on the the top-left to bottom-right diagonal if they include either the most significant bit or the least significant bit and contain a "1" in the opposite corner. These smaller squares, like the original square, consistently have a single pattern in all non-zero rows and columns. Alas, if one of these smaller squares is directly erased, what is left behind is no longer a canonical representation of a product.

What does all this twiddling around allow me to see? Initially not much; however it lets me draw a rectangle around a random bunch of 1s and 0s and ask myself if it can be rearranged into a canonical representation of a product. Looking at the positional representation, several locations have the same value. Two "1"s in a less significant valued position can be moved up or left if they are combined into a single "1", etc. Also, the maximum value containable is equal to the product of maximum value containable along its' edges (one edge per dimension of course)

Last fiddled with by only_human on 2009-01-16 at 09:17 Reason: note: correct ambiguity about squares
only_human is offline   Reply With Quote