<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Subsequence</id>
	<title>Subsequence - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Subsequence"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Subsequence&amp;action=history"/>
	<updated>2026-06-23T22:55:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Subsequence&amp;diff=160892&amp;oldid=prev</id>
		<title>134.60.67.135: /* Theorems */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Subsequence&amp;diff=160892&amp;oldid=prev"/>
		<updated>2025-07-01T09:57:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Theorems&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Mathematical binary relation}}&lt;br /&gt;
{{Multiple issues|&lt;br /&gt;
{{more footnotes|date=November 2018}}&lt;br /&gt;
{{more citations needed|date=November 2018}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In [[mathematics]], a &amp;#039;&amp;#039;&amp;#039;subsequence&amp;#039;&amp;#039;&amp;#039; of a given [[sequence]] is a sequence that can be derived from the given sequence by deleting some or no elements without changing the order of the remaining elements. For example, the sequence &amp;lt;math&amp;gt;\langle A,B,D \rangle&amp;lt;/math&amp;gt; is a subsequence of &amp;lt;math&amp;gt;\langle A,B,C,D,E,F \rangle&amp;lt;/math&amp;gt; obtained after removal of elements &amp;lt;math&amp;gt;C,&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;E,&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F.&amp;lt;/math&amp;gt; The relation of one sequence being the subsequence of another is a [[partial order]].&lt;br /&gt;
&lt;br /&gt;
Subsequences can contain consecutive elements which were not consecutive in the original sequence. A subsequence which consists of a consecutive run of elements from the original sequence, such as &amp;lt;math&amp;gt;\langle B,C,D \rangle,&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;\langle A,B,C,D,E,F \rangle,&amp;lt;/math&amp;gt; is a [[substring]]. The substring is a refinement of the subsequence.&lt;br /&gt;
&lt;br /&gt;
The list of all subsequences for the word &amp;quot;&amp;#039;&amp;#039;&amp;#039;apple&amp;#039;&amp;#039;&amp;#039;&amp;quot; would be &amp;quot;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ap&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;al&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ae&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;app&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;apl&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ape&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ale&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;appl&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;appe&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;aple&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;apple&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;p&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;pp&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;pl&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;pe&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ppl&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ppe&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;ple&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;pple&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;l&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;le&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;e&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;quot; ([[empty string]]).&lt;br /&gt;
&lt;br /&gt;
== Common subsequence ==&lt;br /&gt;
&lt;br /&gt;
Given two sequences &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Y,&amp;lt;/math&amp;gt; a sequence &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is said to be a &amp;#039;&amp;#039;common subsequence&amp;#039;&amp;#039; of &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Y,&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is a subsequence of both &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Y.&amp;lt;/math&amp;gt;  For example, if&lt;br /&gt;
&amp;lt;math display=block&amp;gt;X = \langle A,C,B,D,E,G,C,E,D,B,G \rangle \qquad \text{ and}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math display=block&amp;gt;Y = \langle B,E,G,J,C,F,E,K,B \rangle \qquad \text{ and}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math display=block&amp;gt;Z = \langle B,E,E \rangle.&amp;lt;/math&amp;gt;&lt;br /&gt;
then &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is said to be a common subsequence of &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Y.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would {{em|not}} be the &amp;#039;&amp;#039;[[Longest-common subsequence problem|longest common subsequence]]&amp;#039;&amp;#039;, since &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; only has length 3, and the common subsequence &amp;lt;math&amp;gt;\langle B,E,E,B \rangle&amp;lt;/math&amp;gt; has length&amp;amp;nbsp;4. The longest common subsequence of &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\langle B,E,G,C,E,B \rangle.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
Subsequences have applications to [[computer science]],&amp;lt;ref name=&amp;quot;substrVsSubseq&amp;quot;&amp;gt;In computer science, &amp;#039;&amp;#039;[[string (computer science)|string]]&amp;#039;&amp;#039; is often used as a synonym for &amp;#039;&amp;#039;sequence&amp;#039;&amp;#039;, but it is important to note that &amp;#039;&amp;#039;[[substring]]&amp;#039;&amp;#039; and &amp;#039;&amp;#039;subsequence&amp;#039;&amp;#039; are not synonyms. Substrings are &amp;#039;&amp;#039;consecutive&amp;#039;&amp;#039; parts of a string, while subsequences need not be. This means that a substring of a string is always a subsequence of the string, but a subsequence of a string is not always a substring of the string, see: {{cite book | last = Gusfield | first = Dan | orig-year = 1997 | year = 1999 | title = Algorithms on Strings, Trees and Sequences: Computer Science and Computational Biology | publisher = Cambridge University Press | location = USA | isbn = 0-521-58519-8 | pages = 4}}&amp;lt;/ref&amp;gt; especially in the discipline of [[bioinformatics]], where computers are used to compare, analyze, and store [[DNA]], [[RNA]], and [[protein]] sequences.&lt;br /&gt;
&lt;br /&gt;
Take two sequences of DNA containing 37 elements, say:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;samp&amp;gt;SEQ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = ACGGTGTCGTGCTATGCTGATGCTGACTTATATGCTA&amp;lt;/samp&amp;gt;&lt;br /&gt;
:&amp;lt;samp&amp;gt;SEQ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = CGTTCGGCTATCGTACGTTCTATTCTATGATTTCTAA&amp;lt;/samp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The longest common subsequence of sequences 1 and 2 is:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;samp&amp;gt;LCS&amp;lt;sub&amp;gt;(SEQ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;,SEQ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;lt;/sub&amp;gt; = &amp;#039;&amp;#039;&amp;#039;CGTTCGGCTATGCTTCTACTTATTCTA&amp;#039;&amp;#039;&amp;#039;&amp;lt;/samp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by highlighting the 27 elements of the longest common subsequence into the initial sequences:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;samp&amp;gt;SEQ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = A&amp;#039;&amp;#039;&amp;#039;{{font color|red|CG}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|T}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|TCG}}&amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;{{font color|red|GCTATGCT}}&amp;#039;&amp;#039;&amp;#039;GA&amp;#039;&amp;#039;&amp;#039;{{font color|red|T}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|CT}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|ACTTAT}}&amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;{{font color|red|T}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|CTA}}&amp;#039;&amp;#039;&amp;#039;&amp;lt;/samp&amp;gt;&lt;br /&gt;
:&amp;lt;samp&amp;gt;SEQ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = &amp;#039;&amp;#039;&amp;#039;{{font color|red|CGTTCGGCTAT}}&amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;{{font color|red|G}}&amp;#039;&amp;#039;&amp;#039;TA&amp;#039;&amp;#039;&amp;#039;{{font color|red|C}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|TTCTA}}&amp;#039;&amp;#039;&amp;#039;TT&amp;#039;&amp;#039;&amp;#039;{{font color|red|CT}}&amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;{{font color|red|T}}&amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;{{font color|red|ATT}}&amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;{{font color|red|CTA}}&amp;#039;&amp;#039;&amp;#039;A&amp;lt;/samp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another way to show this is to &amp;#039;&amp;#039;align&amp;#039;&amp;#039; the two sequences, that is, to position elements of the longest common subsequence in a same column (indicated by the vertical bar) and to introduce a special character (here, a dash) for padding of arisen empty subsequences:&lt;br /&gt;
:&amp;lt;samp&amp;gt;SEQ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = ACGGTGTCGTGCTAT-G--C-TGATGCTGA--CT-T-ATATG-CTA-&amp;lt;/samp&amp;gt;&lt;br /&gt;
:&amp;lt;samp&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;|&amp;amp;nbsp;||&amp;amp;nbsp;|||&amp;amp;nbsp;|||||&amp;amp;nbsp;|&amp;amp;nbsp;&amp;amp;nbsp;|&amp;amp;nbsp;|&amp;amp;nbsp;&amp;amp;nbsp;|&amp;amp;nbsp;||&amp;amp;nbsp;|&amp;amp;nbsp;&amp;amp;nbsp;||&amp;amp;nbsp;|&amp;amp;nbsp;||&amp;amp;nbsp;|&amp;amp;nbsp;&amp;amp;nbsp;||| &amp;lt;/samp&amp;gt;&lt;br /&gt;
:&amp;lt;samp&amp;gt;SEQ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = -C-GT-TCG-GCTATCGTACGT--T-CT-ATTCTATGAT-T-TCTAA&amp;lt;/samp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Subsequences are used to determine how similar the two strands of DNA are, using the DNA bases: [[adenine]], [[guanine]], [[cytosine]] and [[thymine]].&lt;br /&gt;
&lt;br /&gt;
== Theorems ==&lt;br /&gt;
&lt;br /&gt;
* Every infinite sequence of [[real number]]s has an infinite [[Monotone sequence|monotone]] subsequence. (This is a lemma used in the [[Bolzano–Weierstrass theorem#Proof|proof of the Bolzano–Weierstrass theorem]].)&lt;br /&gt;
* Every infinite [[bounded sequence]] in &amp;lt;math&amp;gt;\R^n&amp;lt;/math&amp;gt; has a [[Limit of a sequence|convergent]] subsequence. (This is the [[Bolzano–Weierstrass theorem]].)&lt;br /&gt;
* For all [[integer]]s &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;s,&amp;lt;/math&amp;gt; every finite sequence of length at least &amp;lt;math&amp;gt;(r - 1)(s - 1) + 1&amp;lt;/math&amp;gt; contains a monotonically increasing subsequence of length&amp;amp;nbsp;&amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; {{em|or}} a monotonically decreasing subsequence of length&amp;amp;nbsp;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;. (This is the [[Erdős–Szekeres theorem]].)&lt;br /&gt;
* A metric space &amp;lt;math&amp;gt;(X,d)&amp;lt;/math&amp;gt; is compact if every sequence in &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; has a convergent subsequence whose limit is in &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* {{annotated link|Subsequential limit}}&lt;br /&gt;
* {{annotated link|Limit superior and limit inferior}}&lt;br /&gt;
* {{annotated link|Longest increasing subsequence problem}}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
{{reflist}}&lt;br /&gt;
{{reflist|group=note}}&lt;br /&gt;
&lt;br /&gt;
{{PlanetMath attribution|id=3300|title=subsequence}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Elementary mathematics]]&lt;br /&gt;
[[Category:Sequences and series]]&lt;/div&gt;</summary>
		<author><name>134.60.67.135</name></author>
	</entry>
</feed>