<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=String</id>
		<title>String - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=String"/>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;action=history"/>
		<updated>2026-05-09T11:35:43Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1449&amp;oldid=prev</id>
		<title>Brian: alphabet size and complexity</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1449&amp;oldid=prev"/>
				<updated>2011-11-23T23:56:18Z</updated>
		
		<summary type="html">&lt;p&gt;alphabet size and complexity&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:56, 23 November 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necessary. (Since the alphabet is finite, we can always impose a total order when it would be useful to do so, such as when constructing a [[dictionary]].) An element of this the alphabet is known as a '''character'''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The size of &lt;/del&gt;the alphabet can &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;affect the asymptotic complexity of string algorithms. In particular, if &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the size of the input, and the alphabet size is bounded by a &lt;/del&gt;constant &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;independent of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;, then it is called a '''constant''' alphabet; if its size is &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt;, it is called '''integer''' alphabet; and if it is larger than this then it is called a '''general''' alphabet&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necessary. (Since the alphabet is finite, we can always impose a total order when it would be useful to do so, such as when constructing a [[dictionary]].) An element of this the alphabet is known as a '''character'''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Unless otherwise specified, we will always assume that two characters from &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;same &lt;/ins&gt;alphabet can &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;be compared for equality in &lt;/ins&gt;constant &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;time&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L29&quot; &gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===Alphabet size===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The size of the alphabet can affect the asymptotic complexity of string algorithms. In particular, if &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the size of the input, then we can classify alphabets as follows&amp;lt;ref&amp;gt;Juha Kärkkäinen and Peter Sanders. 2003. Simple linear work suffix array construction. In ''Proceedings of the 30th international conference on Automata, languages and programming'' (ICALP'03), Jos C. M. Baeten, Jan Karel Lenstra, Joachim Parrow, and Gerhard J. Woeginger (Eds.). Springer-Verlag, Berlin, Heidelberg, 943-955. Retrieved 2010-11-13 from [http://monod.uwaterloo.ca/~cs482/suffix-icalp03.pdf http://monod.uwaterloo.ca/~cs482/suffix-icalp03.pdf].&amp;lt;/ref&amp;gt;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If &amp;lt;math&amp;gt;|\Sigma| \in O(1)&amp;lt;/math&amp;gt;, that is, it is bounded above by a constant ''independent of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;'', then the alphabet is said to be '''constant'''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If the characters are integers bounded by &amp;lt;math&amp;gt;O(N^c)&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;, then the alphabet is said to be '''integer'''. (This is equivalent to saying that the characters are integers with at most &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt; digits.) Note that this implies &amp;lt;math&amp;gt;|\Sigma| \in O(N^c)&amp;lt;/math&amp;gt; and equivalently &amp;lt;math&amp;gt;\log|\Sigma| \in O(\log N)&amp;lt;/math&amp;gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* All alphabets are '''general''', even when they are neither constant nor integer.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The dividing lines may seem arbitrary, but they are placed where they are because for many algorithms a better asymptotic complexity guarantee (in terms of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;) may be achieved when the alphabet is constant rather than when it is integer, or when it is integer rather than when it is general. For example, assume that we want to construct a [[trie]] of a set of strings of total size &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; using constant space. We need to store the links from each node (of which there may be up to &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt;) to its children. These links should be indexed by character, so that we can trace down a path of characters from root to leaf when looking for a word.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* When the alphabet is constant, we can simply store the child links of each node in an array and walk each link in constant time, and a search will take &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt; time (because the trie's height cannot possibly be more than &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;), and furthermore the space complexity is &amp;lt;math&amp;gt;O(N|\Sigma|) = O(N)O(1) = O(N)&amp;lt;/math&amp;gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* When the alphabet is integer, this approach will not meet the linear space restriction. Instead, we can store the links at each node in a [[map]] (from character to [[pointer]]), which will allow us to perform the walk in &amp;lt;math&amp;gt;O(N\log|\Sigma|) = O(N\log N)&amp;lt;/math&amp;gt; time. The total extra space usage (that is, the total size of all the maps) is proportional to the total size of the maps, which, being equal to the total number of links, is &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If the alphabet is general, and we do the same, then the time taken to walk down the tree will be &amp;lt;math&amp;gt;O(N \log |\Sigma|)&amp;lt;/math&amp;gt; again; but this is no longer bounded by &amp;lt;math&amp;gt;O(N \log N)&amp;lt;/math&amp;gt;. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Treatment in programming languages==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Treatment in programming languages==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L40&quot; &gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* ''Find'' the first occurrence of a given character in a given string, or find the first occurrence of a given string as a substring of another string.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* ''Find'' the first occurrence of a given character in a given string, or find the first occurrence of a given string as a substring of another string.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* ''Compare'' two strings [[Lexicographic order|lexicographically]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* ''Compare'' two strings [[Lexicographic order|lexicographically]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==References==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;references/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1331&amp;oldid=prev</id>
		<title>Brian at 04:29, 29 May 2011</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1331&amp;oldid=prev"/>
				<updated>2011-05-29T04:29:57Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 04:29, 29 May 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necessary. (Since the alphabet is finite, we can always impose a total order when it would be useful to do so, such as when constructing a [[dictionary]].) An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necessary. (Since the alphabet is finite, we can always impose a total order when it would be useful to do so, such as when constructing a [[dictionary]].) An element of this the alphabet is known as a '''character'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. The size of the alphabet can affect the asymptotic complexity of string algorithms. In particular, if &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the size of the input, and the alphabet size is bounded by a constant independent of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;, then it is called a '''constant''' alphabet; if its size is &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt;, it is called '''integer''' alphabet; and if it is larger than this then it is called a '''general''' alphabet&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1082&amp;oldid=prev</id>
		<title>Brian at 19:21, 5 March 2011</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1082&amp;oldid=prev"/>
				<updated>2011-03-05T19:21:23Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:21, 5 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L25&quot; &gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Two strings with the same alphabet can be '''concatenated'''. To concatenate two strings is to link them together to give a new string which begins with the first and ends with the second with no overlap. Formally, the concatenation of strings &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;ST&amp;lt;/math&amp;gt; and has the following three properties:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Two strings with the same alphabet can be '''concatenated'''. To concatenate two strings is to link them together to give a new string which begins with the first and ends with the second with no overlap. Formally, the concatenation of strings &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;ST&amp;lt;/math&amp;gt; and has the following three properties:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;&amp;lt;math&amp;gt;S \sqsubset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;&amp;lt;math&amp;gt;S \sqsubset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;&amp;lt;math&amp;gt;T \sqsupset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;&amp;lt;math&amp;gt;T \sqsupset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;&amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;&amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Treatment in programming languages==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In many programming languages, strings are superficially similar to [[array]]s of characters, in that the syntax for accessing a string's characters usually match the syntax for accessing array elements. Some programming languages, such as C, go as far as to implement strings as arrays of characters. Other programming languages may have a separate library and separate set of functions for handling common string operations, such as:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* ''Insert'' one string into another at a specified position.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:* Special case: ''Concatenate'' two strings (insert a string at the beginning or the end of another).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;::* Special case: ''Append'' a string or a character (which may be considered a string of length one) to the end of an existing string.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* ''Erase'' a substring of a given string at a specified position with a specified length.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:* Special case: erasing from the end may be faster.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* ''Copy'': Return a substring of a given string at a specified location with a specified length.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* ''Find'' the first occurrence of a given character in a given string, or find the first occurrence of a given string as a substring of another string.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* ''Compare'' two strings [[Lexicographic order|lexicographically]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1077&amp;oldid=prev</id>
		<title>Brian: strings are a subset of sequences</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1077&amp;oldid=prev"/>
				<updated>2011-03-05T06:03:52Z</updated>
		
		<summary type="html">&lt;p&gt;strings are a subset of sequences&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:03, 5 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;It follows from the definition that all strings are [[sequence]]s, but not all sequences are strings.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For ease of conceptualization, we shall usually assign a ''symbol'', a graphical representation, to each character of the alphabet and, considering a string as a sequence of characters, render it as a sequence of symbols. We shall usually do so in '''boldface''', but in this section we shall use ''italics'' to avoid confusion with terms being defined, hence, ''PEG''. On other occasions we may choose to represent them with the ordered list notation, hence, [''P'',''E'',''G'']. (This form is useful when the symbols consist of more than one glyph, as can be the case when they are integers; see below.) We will often number the characters of strings, sometimes starting from zero, sometimes starting from one.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For ease of conceptualization, we shall usually assign a ''symbol'', a graphical representation, to each character of the alphabet and, considering a string as a sequence of characters, render it as a sequence of symbols. We shall usually do so in '''boldface''', but in this section we shall use ''italics'' to avoid confusion with terms being defined, hence, ''PEG''. On other occasions we may choose to represent them with the ordered list notation, hence, [''P'',''E'',''G'']. (This form is useful when the symbols consist of more than one glyph, as can be the case when they are integers; see below.) We will often number the characters of strings, sometimes starting from zero, sometimes starting from one.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1076&amp;oldid=prev</id>
		<title>Brian: note on total ordering</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1076&amp;oldid=prev"/>
				<updated>2011-03-05T06:03:08Z</updated>
		
		<summary type="html">&lt;p&gt;note on total ordering&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:03, 5 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necessary. An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necessary. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(Since the alphabet is finite, we can always impose a total order when it would be useful to do so, such as when constructing a [[dictionary]].) &lt;/ins&gt;An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1029&amp;oldid=prev</id>
		<title>Brian: sp.</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=1029&amp;oldid=prev"/>
				<updated>2011-03-02T06:48:50Z</updated>
		
		<summary type="html">&lt;p&gt;sp.&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:48, 2 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;necesary&lt;/del&gt;. An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;necessary&lt;/ins&gt;. An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the usual definition of &amp;quot;string&amp;quot; requires strings to have finite length, although arbitrarily long strings exist.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=539&amp;oldid=prev</id>
		<title>Brian at 20:23, 17 November 2010</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=539&amp;oldid=prev"/>
				<updated>2010-11-17T20:23:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:23, 17 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L16&quot; &gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of universal proteinogenic amino acids, {''A'', ''C'', ''D'', ''E'', ''F'', ''G'', ''H'', ''I'', ''K'', ''L'', ''M'', ''N'', ''P'', ''Q'', ''R'', ''S'', ''T'', ''V'', ''W'', ''Y''} (&amp;lt;math&amp;gt;|\Sigma|=20&amp;lt;/math&amp;gt;). The primary structure of a protein is represented as a string over this alphabet. This and the preceding example are important alphabets in bioinformatics.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of universal proteinogenic amino acids, {''A'', ''C'', ''D'', ''E'', ''F'', ''G'', ''H'', ''I'', ''K'', ''L'', ''M'', ''N'', ''P'', ''Q'', ''R'', ''S'', ''T'', ''V'', ''W'', ''Y''} (&amp;lt;math&amp;gt;|\Sigma|=20&amp;lt;/math&amp;gt;). The primary structure of a protein is represented as a string over this alphabet. This and the preceding example are important alphabets in bioinformatics.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''substring''' of a string &amp;lt;math&amp;gt;S = c_1 c_2 ... c_n&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;s = c_i c_{i+1} ... c_j&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;i, j \in \mathbb{N}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;i \leq j \leq n&amp;lt;/math&amp;gt;. Note that the empty string is considered a substring of all other strings. In other words, it is a series of (possibly zero) characters occurring consecutively in a string, taken in order. For example, ''the'', ''in'', ''here'', and ''therein'' are all substrings of ''therein'', as is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;; however, ''tin'' is not (the characters are not consecutive in the original string), nor is ''rine'' (the characters do not occur in order in the original string). A '''prefix''' is a substring with &amp;lt;math&amp;gt;i = 1&amp;lt;/math&amp;gt;, so that &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, ''the'', ''there'', and ''therein'' are prefixes of ''therein''. A '''suffix''' is a substring with &amp;lt;math&amp;gt;j = n&amp;lt;/math&amp;gt;, so that &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, ''in'', ''rein'', ''herein'', and ''therein'' are suffixes of ''therein''. We write &amp;lt;math&amp;gt;s \sqsubset S&amp;lt;/math&amp;gt; to indicate that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a prefix of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Likewise the notation &amp;lt;math&amp;gt;s \sqsupset S&amp;lt;/math&amp;gt; denotes that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a suffix of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. We say that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a '''proper prefix''' of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;s \sqsubset S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;s \neq S&amp;lt;/math&amp;gt;, with '''proper suffix''' defined analogously.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''substring''' of a string &amp;lt;math&amp;gt;S = c_1 c_2 ... c_n&amp;lt;/math&amp;gt; is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a string with the same alphabet as &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; &lt;/ins&gt;given by &amp;lt;math&amp;gt;s = c_i c_{i+1} ... c_j&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;i, j \in \mathbb{N}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;i \leq j \leq n&amp;lt;/math&amp;gt;. Note that the empty string is considered a substring of all other strings. In other words, it is a series of (possibly zero) characters occurring consecutively in a string, taken in order. For example, ''the'', ''in'', ''here'', and ''therein'' are all substrings of ''therein'', as is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;; however, ''tin'' is not (the characters are not consecutive in the original string), nor is ''rine'' (the characters do not occur in order in the original string). A '''prefix''' is a substring with &amp;lt;math&amp;gt;i = 1&amp;lt;/math&amp;gt;, so that &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, ''the'', ''there'', and ''therein'' are prefixes of ''therein''. A '''suffix''' is a substring with &amp;lt;math&amp;gt;j = n&amp;lt;/math&amp;gt;, so that &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, ''in'', ''rein'', ''herein'', and ''therein'' are suffixes of ''therein''. We write &amp;lt;math&amp;gt;s \sqsubset S&amp;lt;/math&amp;gt; to indicate that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a prefix of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Likewise the notation &amp;lt;math&amp;gt;s \sqsupset S&amp;lt;/math&amp;gt; denotes that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a suffix of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. We say that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a '''proper prefix''' of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;s \sqsubset S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;s \neq S&amp;lt;/math&amp;gt;, with '''proper suffix''' defined analogously.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These examples may have given the misleading impression that strings which do not represent &amp;quot;valid&amp;quot; words, such as ''ther'', are not valid strings. This is entirely untrue; ''ther'' is also a valid prefix of ''therein''. The definition of a string says nothing about the ''validity'' or ''meaning'' of a string. A '''language''' is a (possibly empty, often infinite) subset of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;; an element of a language is often called a ''word'' (although this term should be used with caution). Thus, while every element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is a valid string, not all are necessarily valid words in a language over &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;. For example, let &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; be defined as the Latin alphabet and &amp;lt;math&amp;gt;L \subseteq \Sigma^*&amp;lt;/math&amp;gt; be the language consisting of the representations of all valid English words. (Note that we have been careful to distinguish the words themselves from their representations as strings.) Then ''ther'' is certainly a valid ''string'', being an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;, but is not a valid ''word'' in &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, since it does not represent an English word.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These examples may have given the misleading impression that strings which do not represent &amp;quot;valid&amp;quot; words, such as ''ther'', are not valid strings. This is entirely untrue; ''ther'' is also a valid prefix of ''therein''. The definition of a string says nothing about the ''validity'' or ''meaning'' of a string. A '''language''' is a (possibly empty, often infinite) subset of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;; an element of a language is often called a ''word'' (although this term should be used with caution). Thus, while every element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is a valid string, not all are necessarily valid words in a language over &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;. For example, let &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; be defined as the Latin alphabet and &amp;lt;math&amp;gt;L \subseteq \Sigma^*&amp;lt;/math&amp;gt; be the language consisting of the representations of all valid English words. (Note that we have been careful to distinguish the words themselves from their representations as strings.) Then ''ther'' is certainly a valid ''string'', being an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;, but is not a valid ''word'' in &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, since it does not represent an English word.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L22&quot; &gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Thus, a string of length &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;N+1&amp;lt;/math&amp;gt; prefixes, &amp;lt;math&amp;gt;N+1&amp;lt;/math&amp;gt; suffixes, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; proper prefixes, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; proper suffixes, and &amp;lt;math&amp;gt;1+N(N+1)/2&amp;lt;/math&amp;gt; substrings. (Here we consider two substrings to be distinct if they start or end at different indices, except that the empty string is counted only once; see also [[counting distinct substrings]].)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Thus, a string of length &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;N+1&amp;lt;/math&amp;gt; prefixes, &amp;lt;math&amp;gt;N+1&amp;lt;/math&amp;gt; suffixes, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; proper prefixes, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; proper suffixes, and &amp;lt;math&amp;gt;1+N(N+1)/2&amp;lt;/math&amp;gt; substrings. (Here we consider two substrings to be distinct if they start or end at different indices, except that the empty string is counted only once; see also [[counting distinct substrings]].)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Strings &lt;/del&gt;can be '''concatenated'''. To concatenate two strings is to link them together to give a new string which begins with the first and ends with the second with no overlap. Formally, the concatenation of strings &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;ST&amp;lt;/math&amp;gt; and has the following three properties:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Two strings with the same alphabet &lt;/ins&gt;can be '''concatenated'''. To concatenate two strings is to link them together to give a new string which begins with the first and ends with the second with no overlap. Formally, the concatenation of strings &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;ST&amp;lt;/math&amp;gt; and has the following three properties:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;math&amp;gt;S \sqsubset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;math&amp;gt;S \sqsubset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;math&amp;gt;T \sqsupset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;math&amp;gt;T \sqsupset ST&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=531&amp;oldid=prev</id>
		<title>Brian at 22:15, 16 November 2010</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=531&amp;oldid=prev"/>
				<updated>2010-11-16T22:15:52Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:15, 16 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necesary. An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An '''alphabet''', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necesary. An element of this the alphabet is known as a '''character'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/del&gt;The usual definition of &amp;quot;string&amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, then, &lt;/del&gt;requires strings to have finite &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;but unbounded &lt;/del&gt;length.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A '''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;''' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a '''string''' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The '''empty string''', denoted &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; or &lt;/ins&gt;&amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;length of a string &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;|S|&amp;lt;/math&amp;gt;. (Note that the &lt;/ins&gt;usual definition of &amp;quot;string&amp;quot; requires strings to have finite length&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, although arbitrarily long strings exist&lt;/ins&gt;.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For ease of conceptualization, we shall usually assign a ''symbol'', a graphical representation, to each character of the alphabet and, considering a string as a sequence of characters, render it as a sequence of symbols. We shall usually do so in '''boldface''', but in this section we shall use ''italics'' to avoid confusion with terms being defined, hence, ''PEG''. On other occasions we may choose to represent them with the ordered list notation, hence, [''P'',''E'',''G'']. (This form is useful when the symbols consist of more than one glyph, as can be the case when they are integers; see below.) We will often number the characters of strings, sometimes starting from zero, sometimes starting from one.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For ease of conceptualization, we shall usually assign a ''symbol'', a graphical representation, to each character of the alphabet and, considering a string as a sequence of characters, render it as a sequence of symbols. We shall usually do so in '''boldface''', but in this section we shall use ''italics'' to avoid confusion with terms being defined, hence, ''PEG''. On other occasions we may choose to represent them with the ordered list notation, hence, [''P'',''E'',''G'']. (This form is useful when the symbols consist of more than one glyph, as can be the case when they are integers; see below.) We will often number the characters of strings, sometimes starting from zero, sometimes starting from one.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Examples of alphabets include:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Examples of alphabets include:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The binary alphabet, with exactly two characters (&amp;lt;math&amp;gt;|\Sigma|=2&amp;lt;/math&amp;gt;), usually denoted ''0'' and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''1&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''. In virtually all computers ever built, data are strings over the binary alphabet, and are known as bit strings.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The binary alphabet, with exactly two characters (&amp;lt;math&amp;gt;|\Sigma|=2&amp;lt;/math&amp;gt;), usually denoted ''0'' and ''1''. In virtually all computers ever built, data are strings over the binary alphabet, and are known as bit strings.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Latin alphabet, with the characters ''a'', ''A'', ''b'', ''B'', ..., ''z'', ''Z'' (&amp;lt;math&amp;gt;|\Sigma|=52&amp;lt;/math&amp;gt;). English words may be considered strings over the Latin alphabet.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Latin alphabet, with the characters ''a'', ''A'', ''b'', ''B'', ..., ''z'', ''Z'' (&amp;lt;math&amp;gt;|\Sigma|=52&amp;lt;/math&amp;gt;). English words may be considered strings over the Latin alphabet.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Unicode character set (the size of this alphabet depends somewhat on what we consider to be a valid Unicode character). Text files may be considered strings over this alphabet.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Unicode character set (the size of this alphabet depends somewhat on what we consider to be a valid Unicode character). Text files may be considered strings over this alphabet.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of integers &amp;lt;math&amp;gt;\Sigma = \{0, 1, ..., N-1\}&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;N \in \mathbb{N}&amp;lt;/math&amp;gt;, for which &amp;lt;math&amp;gt;|\Sigma| = N&amp;lt;/math&amp;gt;. Here the characters are also integers, and their corresponding symbols might have more than one glyph when &amp;lt;math&amp;gt;N &amp;gt; 10&amp;lt;/math&amp;gt;. (Recall that the definition of ''character'' is broader than the common concept of the character as the smallest, indivisible element of writing.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of integers &amp;lt;math&amp;gt;\Sigma = \{0, 1, ..., N-1\}&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;N \in \mathbb{N}&amp;lt;/math&amp;gt;, for which &amp;lt;math&amp;gt;|\Sigma| = N&amp;lt;/math&amp;gt;. Here the characters are also integers, and their corresponding symbols might have more than one glyph when &amp;lt;math&amp;gt;N &amp;gt; 10&amp;lt;/math&amp;gt;. (Recall that the definition of ''character'' is broader than the common concept of the character as the smallest, indivisible element of writing.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of nitrogenous bases in DNA, {''A'', ''C'', ''G'', ''T''}, with &amp;lt;math&amp;gt;|\Sigma|=4&amp;lt;/math&amp;gt;. Codons are considered members of &amp;lt;math&amp;gt;\Sigma^3&amp;lt;/math&amp;gt;, and DNA sequences members of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of nitrogenous bases in DNA, {''A'', ''C'', ''G'', ''T''}, with &amp;lt;math&amp;gt;|\Sigma|=4&amp;lt;/math&amp;gt;. Codons are considered members of &amp;lt;math&amp;gt;\Sigma^3&amp;lt;/math&amp;gt;, and DNA sequences members of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The set of universal proteinogenic amino acids, {''A'', ''C'', ''D'', ''E'', ''F'', ''G'', ''H'', ''I'', ''K'', ''L'', ''M'', ''N'', ''P'', ''Q'', ''R'', ''S'', ''T'', ''V'', ''W'', ''Y''} (&amp;lt;math&amp;gt;|\Sigma|=20&amp;lt;/math&amp;gt;). The primary structure of a protein is represented as a string over this alphabet. This and the preceding example are important alphabets in bioinformatics.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''substring''' of a string &amp;lt;math&amp;gt;S = c_1 c_2 ... c_n&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;s = c_i c_{i+1} ... c_j&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;i, j \in \mathbb{N}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;i \leq j \leq n&amp;lt;/math&amp;gt;. Note that the empty string is considered a substring of all other strings. In other words, it is a series of (possibly zero) characters occurring consecutively in a string, taken in order. For example, ''the'', ''in'', ''here'', and ''therein'' are all substrings of ''therein'', as is &amp;lt;math&amp;gt;\&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lambda&lt;/del&gt;&amp;lt;/math&amp;gt;; however, ''tin'' is not (the characters are not consecutive in the original string), nor is ''rine'' (the characters do not occur in order in the original string). A ''prefix'' is a substring with &amp;lt;math&amp;gt;i = 1&amp;lt;/math&amp;gt;, so &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the empty string&lt;/del&gt;, ''the'', ''there'', and ''therein'' are prefixes of &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''substring''' of a string &amp;lt;math&amp;gt;S = c_1 c_2 ... c_n&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;s = c_i c_{i+1} ... c_j&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;i, j \in \mathbb{N}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;i \leq j \leq n&amp;lt;/math&amp;gt;. Note that the empty string is considered a substring of all other strings. In other words, it is a series of (possibly zero) characters occurring consecutively in a string, taken in order. For example, ''the'', ''in'', ''here'', and ''therein'' are all substrings of ''therein'', as is &amp;lt;math&amp;gt;\&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;epsilon&lt;/ins&gt;&amp;lt;/math&amp;gt;; however, ''tin'' is not (the characters are not consecutive in the original string), nor is ''rine'' (the characters do not occur in order in the original string). A &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''prefix&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'' is a substring with &amp;lt;math&amp;gt;i = 1&amp;lt;/math&amp;gt;, so &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;that &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;&lt;/ins&gt;, ''the'', ''there'', and ''therein'' are prefixes of ''therein''. A &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''suffix&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'' is a substring with &amp;lt;math&amp;gt;j = n&amp;lt;/math&amp;gt;, so &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;that &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;&lt;/ins&gt;, ''in'', ''rein'', ''herein'', and ''therein'' are suffixes of ''therein''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. We write &amp;lt;math&amp;gt;s \sqsubset S&amp;lt;/math&amp;gt; to indicate that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a prefix of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Likewise the notation &amp;lt;math&amp;gt;s \sqsupset S&amp;lt;/math&amp;gt; denotes that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a suffix of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. We say that &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; is a '''proper prefix''' of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;s \sqsubset S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;s \neq S&amp;lt;/math&amp;gt;, with '''proper suffix''' defined analogously&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''therein''. A ''suffix'' is a substring with &amp;lt;math&amp;gt;j = n&amp;lt;/math&amp;gt;, so &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the empty string&lt;/del&gt;, ''in'', ''rein'', ''herein'', and ''therein'' are suffixes of ''therein''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These examples may have given the misleading impression that strings which do not represent &amp;quot;valid&amp;quot; words, such as ''ther'', are not valid strings. This is entirely untrue; ''ther'' is also a valid prefix of ''therein''. The definition of a string says nothing about the ''validity'' or ''meaning'' of a string. A '''language''' is a (possibly empty, often infinite) subset of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;; an element of a language is often called a ''word'' (although this term should be used with caution). Thus, while every element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is a valid string, not all are necessarily valid words in a language over &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;. For example, let &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; be defined as the Latin alphabet and &amp;lt;math&amp;gt;L \subseteq \Sigma^*&amp;lt;/math&amp;gt; be the language consisting of the representations of all valid English words. (Note that we have been careful to distinguish the words themselves from their representations as strings.) Then ''ther'' is certainly a valid ''string'', being an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;, but is not a valid ''word'' in &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, since it does not represent an English word.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These examples may have given the misleading impression that strings which do not represent &amp;quot;valid&amp;quot; words, such as ''ther'', are not valid strings. This is entirely untrue; ''ther'' is also a valid prefix of ''therein''. The definition of a string says nothing about the ''validity'' or ''meaning'' of a string. A '''language''' is a (possibly empty, often infinite) subset of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;; an element of a language is often called a ''word'' (although this term should be used with caution). Thus, while every element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is a valid string, not all are necessarily valid words in a language over &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;. For example, let &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; be defined as the Latin alphabet and &amp;lt;math&amp;gt;L \subseteq \Sigma^*&amp;lt;/math&amp;gt; be the language consisting of the representations of all valid English words. (Note that we have been careful to distinguish the words themselves from their representations as strings.) Then ''ther'' is certainly a valid ''string'', being an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;, but is not a valid ''word'' in &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, since it does not represent an English word.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Thus, a string of length &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;N+1&amp;lt;/math&amp;gt; prefixes, &amp;lt;math&amp;gt;N+1&amp;lt;/math&amp;gt; suffixes, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; proper prefixes, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; proper suffixes, and &amp;lt;math&amp;gt;1+N(N+1)/2&amp;lt;/math&amp;gt; substrings. (Here we consider two substrings to be distinct if they start or end at different indices, except that the empty string is counted only once; see also [[counting distinct substrings]].)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Strings can be '''concatenated'''. To concatenate two strings is to link them together to give a new string which begins with the first and ends with the second with no overlap. Formally, the concatenation of strings &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;ST&amp;lt;/math&amp;gt; and has the following three properties:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &amp;lt;math&amp;gt;S \sqsubset ST&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &amp;lt;math&amp;gt;T \sqsupset ST&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &amp;lt;math&amp;gt;|ST| = |S|+|T|&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;For example, concatenating ''there'' and ''in'' gives ''therein''. So do concatenating ''the'' and ''rein'', or &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and ''therein'', or ''therein'' and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. Note that in general, concatenation is not commutative.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=530&amp;oldid=prev</id>
		<title>Brian at 16:27, 16 November 2010</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=530&amp;oldid=prev"/>
				<updated>2010-11-16T16:27:21Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:27, 16 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definitions==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An ''alphabet'', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necesary. An element of this the alphabet is known as a ''character''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''alphabet&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necesary. An element of this the alphabet is known as a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''character&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A ''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;'' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a ''string'' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The ''empty string'', denoted &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Strings must &lt;/del&gt;have finite length, but &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;there &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;no limit on &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;length &lt;/del&gt;of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a string&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''string&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;''empty string&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'', denoted &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(The usual definition of &amp;quot;string&amp;quot;, then, requires strings to &lt;/ins&gt;have finite &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;but unbounded &lt;/ins&gt;length&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;For ease of conceptualization, we shall usually assign a ''symbol'', a graphical representation, to each character of the alphabet and, considering a string as a sequence of characters, render it as a sequence of symbols. We shall usually do so in '''boldface'''&lt;/ins&gt;, but &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;in this section we shall use ''italics'' to avoid confusion with terms being defined, hence, ''PEG''. On other occasions we may choose to represent them with the ordered list notation, hence, [''P'',''E'',''G'']. (This form &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;useful when &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;symbols consist &lt;/ins&gt;of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;more than one glyph, as can be the case when they are integers; see below.) We will often number the characters of strings, sometimes starting from zero, sometimes starting from one&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Examples of alphabets include:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Examples of alphabets include:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The binary alphabet, &amp;lt;math&amp;gt;\&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{0, 1\}&lt;/del&gt;&amp;lt;/math&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. There are two characters&lt;/del&gt;, usually denoted &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''0&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'' and '''1'''. In virtually all computers ever built, data are strings over the binary alphabet, and are known as bit strings.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The binary alphabet, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;with exactly two characters (&lt;/ins&gt;&amp;lt;math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|&lt;/ins&gt;\&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Sigma|=2&lt;/ins&gt;&amp;lt;/math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/ins&gt;, usually denoted ''0'' and '''1'''. In virtually all computers ever built, data are strings over the binary alphabet, and are known as bit strings.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Latin alphabet, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;consisting of &lt;/del&gt;the characters &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''a&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''A&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''b&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''B&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'', ..., &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''z&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''Z''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;. English words may be considered strings over the Latin alphabet.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Latin alphabet, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;with &lt;/ins&gt;the characters ''a'', ''A'', ''b'', ''B'', ..., ''z'', ''Z'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&amp;lt;math&amp;gt;|\Sigma|=52&amp;lt;/math&amp;gt;)&lt;/ins&gt;. English words may be considered strings over the Latin alphabet.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Unicode character set. Text files may be considered strings over this alphabet.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Unicode character set &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(the size of this alphabet depends somewhat on what we consider to be a valid Unicode character)&lt;/ins&gt;. Text files may be considered strings over this alphabet.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of integers &amp;lt;math&amp;gt;0, 1, ..., N-1&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;N \in \mathbb{N}&amp;lt;/math&amp;gt;. Here the characters are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;actually &lt;/del&gt;integers. (Recall that the definition of ''character'' is broader than the common concept of the character as the smallest, indivisible element of writing.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The set of integers &amp;lt;math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\Sigma = \{&lt;/ins&gt;0, 1, ..., N-1&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\}&lt;/ins&gt;&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;N \in \mathbb{N}&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/math&amp;gt;, for which &amp;lt;math&amp;gt;|\Sigma| = N&lt;/ins&gt;&amp;lt;/math&amp;gt;. Here the characters are &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;also &lt;/ins&gt;integers&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, and their corresponding symbols might have more than one glyph when &amp;lt;math&amp;gt;N &amp;gt; 10&amp;lt;/math&amp;gt;&lt;/ins&gt;. (Recall that the definition of ''character'' is broader than the common concept of the character as the smallest, indivisible element of writing.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* The set of nitrogenous bases in DNA, {''A'', ''C'', ''G'', ''T''}, with &amp;lt;math&amp;gt;|\Sigma|=4&amp;lt;/math&amp;gt;. Codons are considered members of &amp;lt;math&amp;gt;\Sigma^3&amp;lt;/math&amp;gt;, and DNA sequences members of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;A '''substring''' of a string &amp;lt;math&amp;gt;S = c_1 c_2 ... c_n&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;s = c_i c_{i+1} ... c_j&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;i, j \in \mathbb{N}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;i \leq j \leq n&amp;lt;/math&amp;gt;. Note that the empty string is considered a substring of all other strings. In other words, it is a series of (possibly zero) characters occurring consecutively in a string, taken in order. For example, ''the'', ''in'', ''here'', and ''therein'' are all substrings of ''therein'', as is &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;; however, ''tin'' is not (the characters are not consecutive in the original string), nor is ''rine'' (the characters do not occur in order in the original string). A ''prefix'' is a substring with &amp;lt;math&amp;gt;i = 1&amp;lt;/math&amp;gt;, so the empty string, ''the'', ''there'', and ''therein'' are prefixes of &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''therein''. A ''suffix'' is a substring with &amp;lt;math&amp;gt;j = n&amp;lt;/math&amp;gt;, so the empty string, ''in'', ''rein'', ''herein'', and ''therein'' are suffixes of ''therein''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;These examples may have given the misleading impression that strings which do not represent &amp;quot;valid&amp;quot; words, such as ''ther'', are not valid strings. This is entirely untrue; ''ther'' is also a valid prefix of ''therein''. The definition of a string says nothing about the ''validity'' or ''meaning'' of a string. A '''language''' is a (possibly empty, often infinite) subset of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;; an element of a language is often called a ''word'' (although this term should be used with caution). Thus, while every element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is a valid string, not all are necessarily valid words in a language over &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;. For example, let &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; be defined as the Latin alphabet and &amp;lt;math&amp;gt;L \subseteq \Sigma^*&amp;lt;/math&amp;gt; be the language consisting of the representations of all valid English words. (Note that we have been careful to distinguish the words themselves from their representations as strings.) Then ''ther'' is certainly a valid ''string'', being an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt;, but is not a valid ''word'' in &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, since it does not represent an English word.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=527&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;The '''string''' is one of the most fundamental objects in computer science. Strings are intimately familiar to us in the form of text and therefore it is no wonder that the theo...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=String&amp;diff=527&amp;oldid=prev"/>
				<updated>2010-11-16T07:05:48Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039; is one of the most fundamental objects in computer science. Strings are intimately familiar to us in the form of text and therefore it is no wonder that the theo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The '''string''' is one of the most fundamental objects in computer science. Strings are intimately familiar to us in the form of text and therefore it is no wonder that the theory of strings (which is to be distinguished from the field of theoretical physics known as &amp;quot;string theory&amp;quot;) is one of the most extensively studied subdisciplines of computer science.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
An ''alphabet'', usually denoted &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is a finite nonempty set (whose size is denoted &amp;lt;math&amp;gt;|\Sigma|&amp;lt;/math&amp;gt;). It is often assumed that the alphabet is totally ordered, but this is not always necesary. An element of this the alphabet is known as a ''character''.&lt;br /&gt;
&lt;br /&gt;
The set of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-tuples of &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. A ''string of length &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;'' is an element of &amp;lt;math&amp;gt;\Sigma^n&amp;lt;/math&amp;gt;. The set &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is defined &amp;lt;math&amp;gt;\Sigma^0 \cup \Sigma^1 \cup ...&amp;lt;/math&amp;gt;; an element of &amp;lt;math&amp;gt;\Sigma^*&amp;lt;/math&amp;gt; is known simply as a ''string'' over &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;. The ''empty string'', denoted &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;, is the unique element of &amp;lt;math&amp;gt;\Sigma^0&amp;lt;/math&amp;gt;. Strings must have finite length, but there is no limit on the length of a string.&lt;br /&gt;
&lt;br /&gt;
Examples of alphabets include:&lt;br /&gt;
* The binary alphabet, &amp;lt;math&amp;gt;\{0, 1\}&amp;lt;/math&amp;gt;. There are two characters, usually denoted '''0''' and '''1'''. In virtually all computers ever built, data are strings over the binary alphabet, and are known as bit strings.&lt;br /&gt;
* The Latin alphabet, consisting of the characters '''a''', '''A''', '''b''', '''B''', ..., '''z''', '''Z'''. English words may be considered strings over the Latin alphabet.&lt;br /&gt;
* The Unicode character set. Text files may be considered strings over this alphabet.&lt;br /&gt;
* The set of integers &amp;lt;math&amp;gt;0, 1, ..., N-1&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;N \in \mathbb{N}&amp;lt;/math&amp;gt;. Here the characters are actually integers. (Recall that the definition of ''character'' is broader than the common concept of the character as the smallest, indivisible element of writing.)&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>