Template:Short description Template:Multiple issues
In mathematics, a subsequence 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 <math>\langle A,B,D \rangle</math> is a subsequence of <math>\langle A,B,C,D,E,F \rangle</math> obtained after removal of elements <math>C,</math> <math>E,</math> and <math>F.</math> The relation of one sequence being the subsequence of another is a partial order.
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 <math>\langle B,C,D \rangle,</math> from <math>\langle A,B,C,D,E,F \rangle,</math> is a substring. The substring is a refinement of the subsequence.
The list of all subsequences for the word "apple" would be "a", "ap", "al", "ae", "app", "apl", "ape", "ale", "appl", "appe", "aple", "apple", "p", "pp", "pl", "pe", "ppl", "ppe", "ple", "pple", "l", "le", "e", "" (empty string).
Common subsequenceEdit
Given two sequences <math>X</math> and <math>Y,</math> a sequence <math>Z</math> is said to be a common subsequence of <math>X</math> and <math>Y,</math> if <math>Z</math> is a subsequence of both <math>X</math> and <math>Y.</math> For example, if <math display=block>X = \langle A,C,B,D,E,G,C,E,D,B,G \rangle \qquad \text{ and}</math> <math display=block>Y = \langle B,E,G,J,C,F,E,K,B \rangle \qquad \text{ and}</math> <math display=block>Z = \langle B,E,E \rangle.</math> then <math>Z</math> is said to be a common subsequence of <math>X</math> and <math>Y.</math>
This would Template:Em be the longest common subsequence, since <math>Z</math> only has length 3, and the common subsequence <math>\langle B,E,E,B \rangle</math> has length 4. The longest common subsequence of <math>X</math> and <math>Y</math> is <math>\langle B,E,G,C,E,B \rangle.</math>
ApplicationsEdit
Subsequences have applications to computer science,<ref name="substrVsSubseq">In computer science, string is often used as a synonym for sequence, but it is important to note that substring and subsequence are not synonyms. Substrings are consecutive 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: Template:Cite book</ref> especially in the discipline of bioinformatics, where computers are used to compare, analyze, and store DNA, RNA, and protein sequences.
Take two sequences of DNA containing 37 elements, say:
- SEQ1 = ACGGTGTCGTGCTATGCTGATGCTGACTTATATGCTA
- SEQ2 = CGTTCGGCTATCGTACGTTCTATTCTATGATTTCTAA
The longest common subsequence of sequences 1 and 2 is:
- LCS(SEQ1,SEQ2) = CGTTCGGCTATGCTTCTACTTATTCTA
This can be illustrated by highlighting the 27 elements of the longest common subsequence into the initial sequences:
- SEQ1 = ATemplate:Font colorGTemplate:Font colorGTemplate:Font colorTTemplate:Font colorGATemplate:Font colorGTemplate:Font colorGTemplate:Font colorATemplate:Font colorGTemplate:Font color
- SEQ2 = Template:Font colorCTemplate:Font colorTATemplate:Font colorGTemplate:Font colorTTTemplate:Font colorATemplate:Font colorGTemplate:Font colorTTemplate:Font colorA
Another way to show this is to align 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:
- SEQ1 = ACGGTGTCGTGCTAT-G--C-TGATGCTGA--CT-T-ATATG-CTA-
- | || ||| ||||| | | | | || | || | || | |||
- SEQ2 = -C-GT-TCG-GCTATCGTACGT--T-CT-ATTCTATGAT-T-TCTAA
Subsequences are used to determine how similar the two strands of DNA are, using the DNA bases: adenine, guanine, cytosine and thymine.
TheoremsEdit
- Every infinite sequence of real numbers has an infinite monotone subsequence (This is a lemma used in the proof of the Bolzano–Weierstrass theorem).
- Every infinite bounded sequence in <math>\R^n</math> has a convergent subsequence (This is the Bolzano–Weierstrass theorem).
- For all integers <math>r</math> and <math>s,</math> every finite sequence of length at least <math>(r - 1)(s - 1) + 1</math> contains a monotonically increasing subsequence of length <math>r</math> Template:Em a monotonically decreasing subsequence of length <math>s</math> (This is the Erdős–Szekeres theorem).
- A metric space <math>(X,d)</math> is compact if every sequence in <math>X</math> has a convergent subsequence whose limit is in <math>X</math>.
See alsoEdit
NotesEdit
Template:Reflist Template:Reflist
{{#if: | This article incorporates material from the following PlanetMath articles, which are licensed under the Creative Commons Attribution/Share-Alike License: {{#if: | subsequence | {{#if: 3300 | subsequence | [{{{sourceurl}}} subsequence] }} }}, {{#if: | {{{title2}}} | {{#if: | {{{title2}}} | [{{{sourceurl2}}} {{{title2}}}] }} }}{{#if: | , {{#if: | {{{title3}}} | {{#if: | {{{title3}}} | [{{{sourceurl3}}} {{{title3}}}] }} }} }}{{#if: | , {{#if: | {{{title4}}} | {{#if: | {{{title4}}} | [{{{sourceurl4}}} {{{title4}}}] }} }} }}{{#if: | , {{#if: | {{{title5}}} | {{#if: | {{{title5}}} | [{{{sourceurl5}}} {{{title5}}}] }} }} }}{{#if: | , {{#if: | {{{title6}}} | {{#if: | {{{title6}}} | [{{{sourceurl6}}} {{{title6}}}] }} }} }}{{#if: | , {{#if: | {{{title7}}} | {{#if: | {{{title7}}} | [{{{sourceurl7}}} {{{title7}}}] }} }} }}{{#if: | , {{#if: | {{{title8}}} | {{#if: | {{{title8}}} | [{{{sourceurl8}}} {{{title8}}}] }} }} }}{{#if: | , {{#if: | {{{title9}}} | {{#if: | {{{title9}}} | [{{{sourceurl9}}} {{{title9}}}] }} }} }}. | This article incorporates material from {{#if: | subsequence | subsequence}} on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License. }}