How to prove that a string, s
is made up of n > 1
subsequences occurring some arbitrary number of times using concatenation and stripping first and last character?
E.g s = xyzxyz
, subsequence is xyz
and it occurs 2 times. The solution is to concatenate the same string e.g. xyzxyzxyzxyz
and then strip the first and last character to get yzxyzxyzxy
, then you find s
(xyzxyz
) inside that.
Other examples:
- The word
Table
does not have a subsequence so the above method will give:Table||Table
->TableTable
->ableTabl
-> which does not contain Table so Table does not contain a subsequence - The word
mmebmmebmmeb
-> has to return true with the above method because it containsmmeb
repeated 3 times. So,mmebmmebmmeb || mmebmmebmmeb
->mmebmmebmmebmmebmmebmmeb
-> (strip first and last)mebmmebmmebmmebmmebmme
which containsmmebmmebmmeb
(meb**mmebmmebmmeb**mmebmme
)
My thought was to assume that there is at least one character in s
that will invalidate the occurrence of a subsequence. E.g. instead of xyzxyzxyz
(xyz
occurring three times) we have xyzxyzxya
where a
is the wrong char. Now we assume that in yzxyzxyaxyzxyzxy
(after concatenation and stripping first and last) that the string s
does exist which should be a contradiction - but I am stuck.
Could someone give me a formal mathematical proof?
Looked at this for ideas: How to prove that the reversal of the concatenation of two strings is the concatenation of the reversals?
MattIsGreat
is one copy ofxMattIsGreatx
with the first and last character removed. If we're not allowed $n=1$, then the thing you're trying to prove is false, sinceMattIsGreat
can't be written as two or more copies of anything. $\endgroup$MattIsGreat
is a substring ofattIsGreatMattIsGreatMattIsGrea
. I thought you wanted $s$ to be $t^n$ minus the first and last chars, not just a substring of it. $\endgroup$