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
A=a_1,a_2...a_k,a_1,a_2,...a_{m-1}
Claim:
There is either a substring
B=a_{o+1},a_{o+2}..a_{o+m-1},x
such that: B is not in A
or
A contains all of the possible substrings.
And, let's also assume that if
S=s_1,s_2,s_3...s_k
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 0,0,...0. Clearly, based on the second assumption it can be extended into a loop
a_1,a_2...a_l,a_1,a_3...a_{m-1}
Now, if there is a suitable B=a_{o+1},a_{o+2}...a_{o+m-1},x
Then
a_{o+m},a_{o+m+1}...a_{l},a_1,a_2...a_{o+1},a_{o+2}...a_{o+m-1},x
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 m^n+m-1 (or m^n 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 m^n+m-1 times before terminating.
For example, let's say we're looking at legth 3, 2-symbol strings.
So, we start with 0,0,0 which is already a loop.
But, we can find a 'suitable B': 0,0,1
So we have:
0,0,0,1
0,0,0,1,1
0,0,0,1,1,0
0,0,0,1,1,0,1
And, once again, there is a problem because we can't add any more symbols. At this point the only remaining B is 1,1,1
So, rotate
0,0,0,1,1,0,1 \rightarrow 0,1,0,0,0,1,1,
and append
0,1,0,0,0,1,1,1
And this is the string
0,1,0,0,0,1,1,1,(0,1)