StatusX said:
I followed you up to the last paragraph. I also thought of these strings as loops, and you can generate many superstrings by starting at any point in the loop and repeating the first m-1 digits again at the end. But I can't figure out how you would add a digit at some point in the loop and be sure you wouldn't duplicate any of the m substrings it becomes a part of. Could you maybe illustrate your method with an example of how you could create a superstring with it?
I'll try to be more formal:
Let's, assume, for a moment, that given a loop
[tex]A=a_1,a_2...a_k,a_1,a_2,...a_{m-1}[/tex]
Claim:
There is either a substring
[tex]B=a_{o+1},a_{o+2}..a_{o+m-1},x[/tex]
such that: [itex]B[/itex] is not in [itex]A[/itex]
or
[itex]A[/itex] contains all of the possible substrings.
And, let's also assume that if
[tex]S=s_1,s_2,s_3...s_k[/tex]
is a 'non-repeating partial superstring', that it is always possible to append symbols to it to form a loop.
So, let's start with an arbitrary 'non-repeating partial substring' - for example [itex]0,0,...0[/itex]. Clearly, based on the second assumption it can be extended into a loop
[itex]a_1,a_2...a_l,a_1,a_3...a_{m-1}[/itex]
Now, if there is a suitable [itex]B=a_{o+1},a_{o+2}...a_{o+m-1},x[/itex]
Then
[itex]a_{o+m},a_{o+m+1}...a_{l},a_1,a_2...a_{o+1},a_{o+2}...a_{o+m-1},x[/itex]
must be a larger 'non-repeating partial superstring' that the inital one and we can repeat the process.
Otherwise, we have the minimal non-repeating loop and we are done.
Since the number of symbols in a non-repeating loop is bounded above by [itex]m^n+m-1[/itex] (or [itex]m^n[/itex] depending on how you calculate loop length) and the process increases the length of the string by one symbol each iteration, it will run at most [itex]m^n+m-1[/itex] times before terminating.
For example, let's say we're looking at legth 3, 2-symbol strings.
So, we start with [itex]0,0,0[/itex] which is already a loop.
But, we can find a 'suitable B': [itex]0,0,1[/itex]
So we have:
[tex]0,0,0,1[/tex]
[tex]0,0,0,1,1[/tex]
[tex]0,0,0,1,1,0[/tex]
[tex]0,0,0,1,1,0,1[/tex]
And, once again, there is a problem because we can't add any more symbols. At this point the only remaining B is [itex]1,1,1[/itex]
So, rotate
[tex]0,0,0,1,1,0,1 \rightarrow 0,1,0,0,0,1,1,[/tex]
and append
[tex]0,1,0,0,0,1,1,1[/tex]
And this is the string
[tex]0,1,0,0,0,1,1,1,(0,1)[/tex]