i want to know how can i find g(12), is there a way beside trial and error way ? i know i can find g(n) that differ 1 bit from 1110 since it satisfy d(g(n), g(n+1))=1 such as 1010,1111,0110,1100 but this clearly not a good way to solve this problem , is there pattern?
-
1I think that's the best way to solve it. It's clearly a lot faster than staring at that list, hoping for a pattern to emerge. – Arthur May 15 '19 at 06:10
-
Thankyou so much!!! – fiksx May 15 '19 at 06:57
-
But is it coincidence that all of the possible bit already on the list(?) I mean with trial and error I can’t find g(13),g(14) and so on because I don’t know is it true or not by only find different in 1 bit – fiksx May 15 '19 at 07:00
-
Look up Gray code. – Jyrki Lahtonen May 26 '19 at 03:58
-
Anyway, the solution method you applied is the only one available when we aren't given any more information. What do you think is wrong with it? – Jyrki Lahtonen May 26 '19 at 04:03
1 Answers
There is only one possible choice for $g(12)$, and that is most easily found through exhaustive search. But the numbers are produced in a systematic manner (I found the system by drawing two squares with the corners and their coordinates representing the bit strings, and looking at the path taken through them by the sequence $g$):
The rightmost two bits and the leftmost two bits both follow the pattern $$ 00\to01\to11\to10 $$ After the rightmost bits have completed this pattern once, the leftmost two bits advance once, and then the rightmost bits follow this pattern in reverse. Rinse and repeat.
So while there is only one valid choice for $g(12)$, I guess that the table continues $$ \begin{array}{|c|c|} \hline 12 & 1010\\ 13 & 1011\\ 14 & 1001\\ 15 & 1000\\ \hline \end{array} $$ But no matter whether I'm right or not, after choosing between $g(13) = 1011$ and $g(13) = 1000$, $g(14)$ must be $1001$ and $g(15)$ is the one you didn't choose for $g(13)$.
- 199,419

