1

I'm studying computer science, but my maths is a little lacking, and my course material isn't being explicit about how things are calculated (they expect you to just know).

Given a sequence such as:

(n − 1) + (n − 2) + ⋯ + 1

That results in the formula (if that's even the correct term?):

½n^2 − ½n

So:

(n − 1) + (n − 2) + ⋯ + 1 = ½n^2 − ½n

How do I work out what that formula(?) is?

What is that type of maths called?

I'm at a real loss... Without having any direction, it's nearly impossible to Google for a solution.

UPDATE:

So if I only had:

(n − 1) + (n − 2) + ⋯ + 1

How would I work out what the formula would be?

Jack_Hu
  • 111
  • 2
  • 2
    Welcome to Mathematics Stack Exchange. This is an example of arithmetic series – J. W. Tanner Jan 08 '20 at 14:46
  • Thanks for the quick response. I'm not really interested in what the number sequence is, more how the formula is derived? So, why 1/2n^2 - 1/2n is the answer, and what process was taken to discover it..... I can work out the sequence, and how it will end, but I'm at a loss how to convert that sequence in to something like 1/2n^2 - 1/2n.... That's the process I'm trying to identify to study further. – Jack_Hu Jan 08 '20 at 14:47
  • 1
    Here is the proof of the formula for sum of sequence $1 + 2 + \cdots + n$. Simply subtract $n$ from the formula to get the sum for sequence $1 + 2 + \cdots + n - 1$. – an4s Jan 08 '20 at 14:47
  • @J.W.Tanner - Would I be right in thinking that: https://www.youtube.com/watch?v=Uy_L8tnihDM - Is showing how to work through this? – Jack_Hu Jan 08 '20 at 15:19
  • 1
    Yes, your example is a special case where the first term and the difference between terms are $1$ – J. W. Tanner Jan 08 '20 at 15:22
  • My understanding is for these sorts of problems you have to just guess the formula. There's no systematic way to derive it. – Matt Samuel Jan 08 '20 at 19:01

1 Answers1

0

Hint. You could use the following trick to obtain the formula: \begin{matrix} (n − 1) &+& (n − 2) &+& \dotsm &+& 1 \\ 1 &+& 2 &+&\dotsm &+& (n − 1) \\ \hline n &+& n &+& \dotsm &+& n \end{matrix}

J.-E. Pin
  • 40,163