Talk:String (computer science): Difference between revisions

Content deleted Content added
Reverse string: improved text
Ruud Koot (talk | contribs)
Line 104:
::: A string ''s'' = abc, composed of zero or more characters of the alphabet (here, 'a', 'b', and 'c'), is said to be the [[reverse]] of string ''t'' if ''t'' = cba. For example, if Σ = {0,1} the string 0011001 is the reverse of 1001100. A string that is the reverse of itself is also called a [[palindrome]], which includes the empty string and all strings of length 1.
::I don't see the confusion; it states that we're talking about a string of ''zero or more characters of the alphabet'', and the example of 0011001 should make it additionally clear that we're talking about the ordering of the ''characters'' of the string, not ''substrings'' of the string. If you think this is still confusing, we could instead use HELLOWORLD and DLROWOLLEH, but this requires a larger symbol alphabet ({D,E,H,L,O,R,W}), which complicates the description somewhat. — [[User:Loadmaster|Loadmaster]] ([[User talk:Loadmaster|talk]]) 18:02, 13 November 2012 (UTC)
 
::: The problem is that you're giving a very specific example but state it in such a form that it—at least at first reading—appears to be a very general definition. You're either using too much formal machinery for what is an informal statement or, conversely, make a statement that not precise enough to be a formal definition. This is how one of my formal language textbooks defines a reverse:
:::<blockquote>The '''reverse''' of a string is obtained by writing the symbols in reverse order; if ''w'' is a string as shown above, then its reverse ''w''<sup>R</sup> is<br><center>''w''<sup>R</sup> = ''a''<sub>''n''</sub>...''a''<sub>2</sub>''a''<sub>1</sub>.</center></blockquote>
::: Where the they explained "above" that ''a'', ''b'', ''c'', ... denote elements from the alphabet &Sigma; and ''u'', ''v'', ''w'', ... strings over that alphabet. —''[[User:Ruud Koot|Ruud]]'' 18:45, 13 November 2012 (UTC)