ArticleslgStudy

mathematics

Inversion (discrete mathematics)

Inversion (discrete mathematics) is a mathematics 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 Inversion (discrete mathematics) rather than just read about it. In short: In computer science and discrete mathematics, an inversion in a sequence is a pair of elements that are out of their natural order. Definitions Inversion Let π {\displaystyle \pi } be a permutation.

Inversion (discrete mathematics) — main illustration
Inversion (discrete mathematics) — illustration

Key takeaways

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

Reference excerpt

In computer science and discrete mathematics, an inversion in a sequence is a pair of elements that are out of their natural order.

Definitions

Inversion Let π {\displaystyle \pi } be a permutation. There is an inversion of π {\displaystyle \pi } between i {\displaystyle i} and j {\displaystyle j} if i < j {\displaystyle i<j} and π ( i ) > π ( j ) {\displaystyle \pi (i)>\pi (j)} . The inversion is indicated by an ordered pair containing either the places ( i , j ) {\displaystyle (i,j)} or the elements ( π ( i ) , π ( j ) ) {\displaystyle {\bigl (}\pi (i),\pi (j){\bigr )}} . The inversion set is the set of all inversions. A permutation's inversion set using place-based notation is the same as the inverse permutation's inversion set using element-based notation with the two components of each ordered pair exchanged. Likewise, a permutation's inversion set using element-based notation is the same as the inverse permutation's inversion set using place-based notation with the two components of each ordered pair exchanged. Inversions are usually defined for permutations, but may also be defined for sequences:Let S {\displaystyle S} be a sequence (or multiset permutation). If i < j {\displaystyle i<j} and S ( i ) > S ( j ) {\displaystyle S(i)>S(j)} , either the pair of places ( i , j ) {\displaystyle (i,j)} or the pair of elements ( S ( i ) , S ( j ) ) {\displaystyle {\bigl (}S(i),S(j){\bigr )}} is called an inversion of S {\displaystyle S} . For sequences, inversions according to the element-based definition are not unique, because different pairs of places may have the same pair of values.

Inversion number The inversion number i n v ( X ) {\displaystyle {\mathtt {inv}}(X)} of a sequence X = ⟨ x 1 , … , x n ⟩ {\displaystyle X=\langle x_{1},\dots ,x_{n}\rangle } , is the cardinality of the inversion set. It is a common measure of sortedness (sometimes called presortedness) of a permutation or sequence. The inversion number is between 0 and n ( n − 1 ) 2 {\displaystyle {\frac {n(n-1)}{2}}} inclusive. A permutation and its inverse have the same inversion number. For example i n v ( ⟨ 1 , 2 , … , n ⟩ ) = 0 {\displaystyle {\mathtt {inv}}(\langle 1,2,\dots ,n\rangle )=0} since the sequence is ordered. Also, when n = 2 m {\displaystyle n=2m} is even, i n v ( ⟨ m + 1 , m + 2 , … , 2 m , 1 , 2 , … , m ⟩ ) = m 2 {\displaystyle {\mathtt {inv}}(\langle m+1,m+2,\dots ,2m,1,2,\dots ,m\rangle )=m^{2}} (because each pair ( 1 ≤ i ≤ m < j ≤ 2 m ) {\displaystyle (1\leq i\leq m<j\leq 2m)} is an inversion). This last example shows that a set that is intuitively "nearly sorted" can still have a quadratic number of inversions. The inversion number is the number of crossings in the arrow diagram of the permutation, the permutation's Kendall tau distance from the identity permutation, and the sum of each of the inversion related vectors defined below. Other measures of sortedness include the minimum number of elements that can be deleted from the sequence to yield a fully sorted sequence, the number and lengths of sorted "runs" within the sequence, the Spearman footrule (sum of distances of each element from its sorted position), and the smallest number of exchanges needed to sort the sequence. Standard comparison sorting algorithms can be adapted to compute the inversion number in time O(n log n).

… excerpt ends here. Continue reading the full article.

Illustrations

Inversion (discrete mathematics): Permutation with one of its inversions highlighted.
An inversion may be denoted by the pair of places (2, 4) or the pair of elements (5, 2).
The inversions of this permutation using element-based notation are: (3, 1), (3, 2), (5, 1), (5, 2), and (5,4).
Permutation with one of its inversions highlighted. An inversion may be denoted by the pair of places (2, 4) or the pair of elements (5, 2). The inversions of this permutation using element-based notation are: (3, 1), (3, 2), (5, 1), (5, 2), and (5,4).
Inversion (discrete mathematics): Rothe diagram
Rothe diagram
Inversion (discrete mathematics): The six possible inversions of a 4-element permutation
The six possible inversions of a 4-element permutation
Inversion (discrete mathematics): Permutohedron of the symmetric group S4
Permutohedron of the symmetric group S4

Worked examples

Example 1 — a first encounter with Inversion (discrete mathematics)

Start with the simplest possible case. Write down what Inversion (discrete mathematics) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, 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 Inversion (discrete mathematics) 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 Inversion (discrete mathematics) 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 Inversion (discrete mathematics)

In research
Inversion (discrete mathematics) appears in mathematics 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 Inversion (discrete mathematics) 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
Inversion (discrete mathematics) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorics, Discrete mathematics, Order theory, so understanding it makes those chapters shorter.
In everyday life
Look for Inversion (discrete mathematics) 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.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Inversion (discrete mathematics)” →

Affiliate

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

How to study Inversion (discrete mathematics) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Inversion (discrete mathematics) 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 Inversion (discrete mathematics) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Inversion (discrete mathematics) in simple terms?

In computer science and discrete mathematics, an inversion in a sequence is a pair of elements that are out of their natural order. Definitions Inversion Let π {\displaystyle \pi } be a permutation.

Why does Inversion (discrete mathematics) matter?

Because it connects several mathematics 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 Inversion (discrete mathematics)?

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 Inversion (discrete mathematics).

Tags

  • Combinatorics
  • Discrete mathematics
  • Order theory
  • Permutations
  • Sorting algorithms
  • String metrics

Keep exploring