Show that the permutation \([n, n-1, \ldots, 2,1]\) has \(n(n-1)\) inversions.

Short Answer

Expert verified
The permutation [n, n-1, ..., 2,1] has \( n(n-1) \) inversions. The proof is based on understanding the concept of inversions in a permutation and applying a general formula for the sum of an arithmetic series.

Step by step solution

01

Understanding the concept

To understand the concept of inversions, consider a simple case, a permutation of 4: [4,3,2,1]. This permutation has 6 inversions: (4,3), (4,2), (4,1), (3,2), (3,1), (2,1). This is equal to 1+2+3=6. If you would do this for 5, you would get 10, which is 1+2+3+4=10. In each case, you can see that you add all the numbers up to (n-1). This is equivalent to calculating the sum of an arithmetic series.
02

Formulating a general inversion rule

Given this pattern, you can formulate a rule for the inversions of a descending permutation of length n. The number of inversions equals the sum of the numbers from 1 till (n-1). This sum is calculated by the formula for an arithmetic series:\[ S = \frac{n(a_1 + a_l)}{2} \]Where \( n \) is the number of terms (which is n-1 in our case), \( a_1 \) is the first term (which is 1 in our case), and \( a_l \) is the last term (which is n-1 in our case).
03

Applying the rule

Apply the formula to calculate the number of inversions: \[ Inversions = \frac{(n-1)(1 + (n-1))}{2} \]Simplify the formula: \[ \frac{(n-1)(n)}{2} \]When you multiply it by 2, you get \( n(n-1) \) which is what asked.
04

Conclude the Proof

Therefore, it has been shown that the permutation [n, n-1, ..., 2,1] has \( n(n-1) \) inversions. This proof is valid for any natural number \( n \) and due to the mathematical induction principle it's valid also for subsequent numbers.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free