Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8563257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:55:13+00:00 2026-06-11T16:55:13+00:00

I am trying to understand the worst case analysis of Insertion sort and I

  • 0

I am trying to understand the worst case analysis of Insertion sort and I have a problem with the math involved on slide 21 (ppt).

I understand the first formula:

Σ(j=1 to n) j=n(n+1)/2

But these I’m struggling with:

  1. Why is there a - 1 at the end?
    Σ(j=2 to n) j=n(n+1)/2-1
  2. Also, I don’t understand this one:
    Σ(j=2 to n)(j-1) = n(n-1)/2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:55:14+00:00Added an answer on June 11, 2026 at 4:55 pm

    It’s Gauss’ trick to sum numbers from 1 to n:

    trick of gauss

    First formula

    However, the sum you want to compute starts at 2, not 1, that is why you have to subtract the first term (i.e. 1) from the formula:

    enter image description here

    Second formula

    Essentially, you compute the sum from 1 until (n-1). If you substitute n in Gauss’ trick with n-1, you receive the second formula they use.

    You can also see this with an index transformation:

    enter image description here

    As you can see, I have adjusted the boundaries of the sum: Both the upper and lower bounds of the sum have been decreased by 1. Effectively, this deceases all terms in the sum by 1, to correct this, you have to add 1 to the term under the Σ: (j-1) + 1 = j.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying understand ViewModels deeper and I have read many articles and blogs
Trying to understand the math of this code snippet. A token is provided which
I am having the worlds worst time trying to understand how to save anything
I'm having trouble getting DownloadProgressChangedEventHandler to fire. I understand that, worst case, the event
im trying to understand the framework structure in CodeIgniter and i have just started
Trying to understand the new async/await pattern, I have one question which I can't
Hi! I'm trying to implement an alpha-beta search, but i first want to understand
I am trying to understand what the following line of the worst-ever-seen C code
Trying to understand the Android framework model. I have an application that needs to
Trying to understand what's the correct way of implementing OpenID authentication with Spring Security.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.