Let N be the size of a binary string. Now make set of all binary strings of size N, from 00...00 to 11...11, in increasing order from smaller to larger. Now let's make another set of same elements, but in a different order. In what order? To do this, we take the function X(n), and it does following - it takes a binary string and returns a natural number from 1 to 2^N. I honestly don't know how it should calculate it, but it should do something like following: build a binary tree(?) of comparisons, first compare halves of string with each other. then quarters, and I don't know if we should compare each with each or if 1 to 2, and 3 to 4 comparisons will suffice. then one eights, etc. at end compare neighbouring ones, here each with each is definitely unnecessary. Then we translate these comparisons into values with weights, for example, the strings that have repeats of halves should be lower than those that have repeats of quarters, and those that have no repeats of either quarters or halves should be higher, closer to beginning, to the number 1. Then we do something-something on these values and BOOM! we get natural number, it is also an ordinal number. For example, if N=8, then the string 11111111 should have number 256, it same everywhere no matter how you look, string 00000000 should have number 255, string 11111110 should have number 254 and so on. Your work is to figure out what to put here Instead of (BOOM!)
At first I thought that I could just do away with fact that you can represent the string as a number of combinations of ones from string length, and all combinations where number of ones is close to half the length, just put it in front of set, but then I thought that for example the string 00001111 with this approach will stand higher, closer to 1, than the string 00101001, and this is a fatal flaw.
At first I thought that I could just do away with fact that you can represent the string as a number of combinations of ones from string length, and all combinations where number of ones is close to half the length, just put it in front of set, but then I thought that for example the string 00001111 with this approach will stand higher, closer to 1, than the string 00101001, and this is a fatal flaw.