ArticleslgStudy

science

Longest increasing subsequence

Longest increasing subsequence is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Longest increasing subsequence rather than just read about it. In short: In computer science, the longest increasing subsequence problem aims to find a subsequence of a given sequence in which the subsequence's elements are sorted in an ascending order and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous or unique.

Longest increasing subsequence — main illustration
Longest increasing subsequence — illustration

Key takeaways

  • Longest increasing subsequence belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Longest increasing subsequence to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Longest increasing subsequence from memory before moving on to harder problems.

Reference excerpt

In computer science, the longest increasing subsequence problem aims to find a subsequence of a given sequence in which the subsequence's elements are sorted in an ascending order and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous or unique. The longest increasing subsequences are studied in the context of various disciplines related to mathematics, including algorithmics, random matrix theory, representation theory, and physics. The longest increasing subsequence problem is solvable in time O ( n log ⁡ n ) , {\displaystyle O(n\log n),} where n {\displaystyle n} denotes the length of the input sequence.

Example In the first 16 terms of the binary Van der Corput sequence

0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 one of the longest increasing subsequences is

0, 2, 6, 9, 11, 15. This subsequence has length six; the input sequence has no seven-member increasing subsequences. The longest increasing subsequence in this example is not the only solution: for instance,

0, 4, 6, 9, 11, 15 0, 2, 6, 9, 13, 15 0, 4, 6, 9, 13, 15 are other increasing subsequences of equal length in the same input sequence.

Relations to other algorithmic problems The longest increasing subsequence problem is closely related to the longest common subsequence problem, which has a quadratic time dynamic programming solution: the longest increasing subsequence of a sequence S {\displaystyle S} is the longest common subsequence of S {\displaystyle S} and T , {\displaystyle T,} where T {\displaystyle T} is the result of sorting S . {\displaystyle S.} However, for the special case in which the input is a permutation of the integers 1 , 2 , … , n , {\displaystyle 1,2,\ldots ,n,} this approach can be made much more efficient, leading to time bounds of the form O ( n log ⁡ log ⁡ n ) . {\displaystyle O(n\log \log n).}

The largest clique in a permutation graph corresponds to the longest decreasing subsequence of the permutation that defines the graph (assuming the original non-permuted sequence is sorted from lowest value to highest). Similarly, the maximum independent set in a permutation graph corresponds to the longest non-decreasing subsequence. Therefore, longest increasing subsequence algorithms can be used to solve the clique problem efficiently in permutation graphs. In the Robinson–Schensted correspondence between permutations and Young tableaux, the length of the first row of the tableau corresponding to a permutation equals the length of the longest increasing subsequence of the permutation, and the length of the first column equals the length of the longest decreasing subsequence.

Efficient algorithms The algorithm outlined below solves the longest increasing subsequence problem efficiently with arrays and binary searching. It processes the sequence elements in order, maintaining the longest increasing subsequence found so far. Denote the sequence values as X [ 0 ] , X [ 1 ] , … , {\displaystyle X[0],X[1],\ldots ,} etc. Then, after processing X [ i ] , {\displaystyle X[i],} the algorithm will have stored an integer L {\displaystyle L} and values in two arrays:

L {\displaystyle L} — stores the length of the longest increasing subsequence found so far.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Longest increasing subsequence

Start with the simplest possible case. Write down what Longest increasing subsequence claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Longest increasing subsequence before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Longest increasing subsequence ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Longest increasing subsequence

In research
Longest increasing subsequence appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Longest increasing subsequence in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Longest increasing subsequence is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorics, Dynamic programming, Formal languages, so understanding it makes those chapters shorter.
In everyday life
Look for Longest increasing subsequence outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Longest increasing subsequence in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Longest increasing subsequence means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Longest increasing subsequence out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Longest increasing subsequence in simple terms?

In computer science, the longest increasing subsequence problem aims to find a subsequence of a given sequence in which the subsequence's elements are sorted in an ascending order and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous or unique.

Why does Longest increasing subsequence matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Longest increasing subsequence?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Longest increasing subsequence.

Tags

  • Combinatorics
  • Dynamic programming
  • Formal languages
  • Problems on strings

Keep exploring