Skip to content Skip to sidebar Skip to footer

What Do You Get When You Add Up All the Numbers From 1 to 100 Consecutively

In that location'south a popular story that Gauss, mathematician extraordinaire, had a lazy teacher. The so-called educator wanted to keep the kids busy then he could take a nap; he asked the class to add the numbers 1 to 100.

Gauss approached with his answer: 5050. So soon? The teacher suspected a cheat, but no. Manual addition was for suckers, and Gauss found a formula to sidestep the problem:

\displaystyle{\text{Sum from 1 to n} = \frac{n(n+1)}{2}}

\displaystyle{\text{Sum from 1 to 100} = \frac{100(100+1)}{2} = (50)(101) = 5050}

Permit'south share a few explanations of this event and really understand it intuitively. For these examples we'll add 1 to 10, and then see how it applies for ane to 100 (or 1 to any number).

Technique 1: Pair Numbers

Pairing numbers is a mutual approach to this problem. Instead of writing all the numbers in a single column, let's wrap the numbers effectually, similar this:

          ane  2  iii  4  v ten nine  8  vii  6                  

An interesting pattern emerges: the sum of each cavalcade is 11. As the top row increases, the bottom row decreases, so the sum stays the same.

Because 1 is paired with 10 (our n), we can say that each column has (due north+1). And how many pairs do we accept? Well, we have 2 equal rows, nosotros must take n/2 pairs.

\displaystyle{\text{Number of pairs * Sum of each pair} = (\frac{n}{2})(n+1) = \frac{n(n+1)}{2}}

which is the formula above.

Wait — what about an odd number of items?

Ah, I'm glad y'all brought it up. What if nosotros are adding up the numbers ane to ix? We don't have an even number of items to pair upwardly. Many explanations will just give the explanation above and get out information technology at that. I won't.

Let's add the numbers 1 to 9, but instead of starting from 1, let'southward count from 0 instead:

          0  i  2  3  iv 9  8  7  six  5                  

By counting from 0, nosotros get an "extra item" (10 in full) so nosotros can have an even number of rows. Even so, our formula volition look a chip different.

Detect that each column has a sum of n (not north+1, like before), since 0 and 9 are grouped. And instead of having exactly n items in 2 rows (for n/2 pairs total), nosotros have northward + 1 items in ii rows (for (northward + one)/2 pairs total). If you lot plug these numbers in you get:

\displaystyle{\text{Number of pairs * Sum of each pair} = (\frac{n + 1}{2})(n) = \frac{n(n+1)}{2}}

which is the same formula as before. It always bugged me that the same formula worked for both odd and even numbers – won't you lot become a fraction? Yes, you get the same formula, simply for dissimilar reasons.

Technique 2: Utilise Two Rows

The above method works, merely y'all handle odd and even numbers differently. Isn't at that place a better style? Yep.

Instead of looping the numbers effectually, let'southward write them in ii rows:

          1  2  3  4  5  half-dozen  vii  viii  9  10 10 nine  eight  seven  six  five  4  three  2  ane                  

Notice that nosotros have 10 pairs, and each pair adds up to ten+1.

The total of all the numbers above is

\displaystyle{\text{Total = pairs * sum of each pair} = n(n + 1)}

Just we only want the sum of one row, non both. So we separate the formula above by two and get:

\displaystyle{\frac{n(n + 1)}{2}}

At present this is cool (as cool equally rows of numbers can be). It works for an odd or even number of items the same!

Technique 3: Make a Rectangle

I recently stumbled upon some other explanation, a fresh approach to the old pairing explanation. Dissimilar explanations piece of work better for dissimilar people, and I tend to like this 1 meliorate.

Instead of writing out numbers, pretend we have beans. We want to add 1 bean to ii beans to 3 beans… all the style up to five beans.

          x x 10 x x 10 x ten x x x ten x 10 x                  

Certain, nosotros could go to 10 or 100 beans, but with 5 you get the idea. How do we count the number of beans in our pyramid?

Well, the sum is conspicuously one + 2 + iii + 4 + five. But let's look at it a unlike way. Permit'south say nosotros mirror our pyramid (I'll use "o" for the mirrored beans), and then topple it over:

          10                 o      x o o o o o x x             o o      x 10 o o o o x x x         o o o  =>  x ten 10 o o o x ten x ten     o o o o      x x x ten o o ten 10 x x x o o o o o      ten x x x x o                  

Cool, huh? In example you lot're wondering whether it "really" lines up, it does. Accept a expect at the bottom row of the regular pyramid, with v′x (and 1 o). The next row of the pyramid has i less x (4 total) and 1 more o (2 total) to fill the gap. But like the pairing, ane side is increasing, and the other is decreasing.

Now for the caption: How many beans do we have total? Well, that'south just the area of the rectangle.

Nosotros accept north rows (we didn't alter the number of rows in the pyramid), and our collection is (due north + one) units broad, since i "o" is paired up with all the "x"s.

\displaystyle{\text{Area} = \text{height} \cdot \text{width} = n(n+1)}

Detect that this time, we don't care about due north being odd or even – the total surface area formula works out only fine. If north is odd, we'll have an even number of items (north+ane) in each row.

Merely of grade, we don't want the total area (the number of 10'southward and o'due south), we just want the number of x's. Since we doubled the x'southward to get the o's, the x'southward by themselves are just half of the total area:

\displaystyle{\text{Number of x's} = \frac{Area}{2} = \frac{n(n + 1)}{2}}

And we're back to our original formula. Again, the number of 10'south in the pyramid = i + 2 + 3 + iv + 5, or the sum from 1 to north.

Technique iv: Boilerplate it out

We all know that

boilerplate = sum / number of items

which we tin can rewrite to

sum = boilerplate * number of items

So let's figure out the sum. If we have 100 numbers (1…100), so we clearly take 100 items. That was easy.

To get the boilerplate, notice that the numbers are all equally distributed. For every large number, there's a small number on the other end. Let's wait at a modest set:

          1 ii 3                  

The boilerplate is two. ii is already in the middle, and 1 and iii "cancel out" and so their average is two.

For an fifty-fifty number of items

          i 2 3 4                  

the average is betwixt 2 and iii – it's ii.5. Even though nosotros have a partial average, this is ok — since we accept an even number of items, when we multiply the average by the count that ugly fraction volition disappear.

Notice in both cases, 1 is on one side of the average and Northward is equally far abroad on the other. And then, we can say the average of the entire gear up is actually only the average of one and n: (1 + n)/2.

Putting this into our formula

\displaystyle{\text{sum = average * count } = \frac{(1 + n)}{2} \cdot n = \frac{n(n + 1)}{2}}

And voila! Nosotros have a fourth way of thinking about our formula.

So why is this useful?

Iii reasons:

1) Calculation upwardly numbers quickly can be useful for estimation. Notice that the formula expands to this:

\displaystyle{\frac{n(n+1)}{2} = \frac{n^2}{2} + \frac{n}{2} }

Let's say you want to add the numbers from 1 to g: suppose you get 1 additional visitor to your site each day – how many full visitors volition yous have after yard days? Since thou squared = ane million, we become million / 2 + m/two = 500,500.

2) This concept of calculation numbers one to Northward shows upward in other places, like figuring out the probability for the birthday paradox. Having a house grasp of this formula will help your understanding in many areas.

iii) Well-nigh importantly, this instance shows there are many means to understand a formula. Maybe you similar the pairing method, maybe you prefer the rectangle technique, or mayhap at that place's another caption that works for yous. Don't give up when yous don't understand — try to find another explanation that works. Happy math.

By the fashion, there are more details about the history of this story and the technique Gauss may have used.

Variations

Instead of ane to northward, how about 5 to n?

Showtime with the regular formula (one + 2 + 3 + … + north = northward * (n + 1) / 2) and subtract off the function y'all don't want (1 + 2 + iii + 4 = 4 * (four + 1) / two = 10).

          Sum for 5 + 6 + 7 + 8 + … n = [n * (n + 1) / ii] – x                  

And for any starting number a:

          Sum from a to northward = [northward * (due north + i) / 2] – [(a - 1) * a / 2]                  

We want to get rid of every number from 1 up to a – ane.

How almost even numbers, similar 2 + 4 + 6 + 8 + … + n?

Just double the regular formula. To add evens from 2 to 50, find ane + 2 + iii + 4 … + 25 and double it:

          Sum of ii + 4 + 6 + … + n = 2 * (1 + 2 + 3 + … + due north/two) = 2 * north/ii * (n/2 + ane) / 2 = n/ii * (n/2 + 1)                  

So, to become the evens from two to l you'd do 25 * (25 + 1) = 650

How about odd numbers, like 1 + 3 + 5 + 7 + … + n?

That'southward the same as the even formula, except each number is 1 less than its counterpart (we have 1 instead of ii, 3 instead of 4, and then on). We get the next biggest even number (n + 1) and have off the actress (n + 1)/2 "-1″ items:

          Sum of ane + 3 + 5 + 7 +  … + northward = [(n + 1)/2 * ((n + 1)/2 + one)] – [(northward + 1) / 2]                  

To add 1 + iii + 5 + … 13, get the next biggest even (north + ane = 14) and practise

          [fourteen/2 * (14/ii + 1)] – vii = 7 * viii – 7 = 56 – 7 = 49                  

Combinations: evens and offset

Let's say you desire the evens from 50 + 52 + 54 + 56 + … 100. Find all the evens

          2 + 4 + 6 + … + 100 = 50 * 51                  

and subtract off the ones you don't desire

          2 + iv + 6 + … 48 = 24 * 25                  

Then, the sum from 50 + 52 + … 100 = (l * 51) – (24 * 25) = 1950

Phew! Hope this helps.

Cherry nerds: y'all tin can bank check this using

          (50..100).select {|x| x % 2 == 0 }.inject(:+) 1950                  

Javascript geeks, do this:

          [...Assortment(51).keys()].map(ten => x + l).filter(x => x % 2 == 0).reduce((x, y) => x + y) 1950  // Note: In that location are 51 numbers from 50-100, inclusive. Fencepost!                  

Other Posts In This Series

  1. Techniques for Adding the Numbers ane to 100
  2. Rethinking Arithmetic: A Visual Guide
  3. Quick Insight: Intuitive Meaning of Division
  4. Quick Insight: Subtracting Negative Numbers
  5. Surprising Patterns in the Square Numbers (ane, 4, ix, 16…)
  6. Fun With Modular Arithmetics
  7. Learning How to Count (Avoiding The Fencepost Problem)
  8. A Quirky Introduction To Number Systems
  9. Some other Look at Prime Numbers
  10. Intuition For The Golden Ratio
  11. Different Interpretations for the Number Zip

chesserthethe.blogspot.com

Source: https://betterexplained.com/articles/techniques-for-adding-the-numbers-1-to-100/

Post a Comment for "What Do You Get When You Add Up All the Numbers From 1 to 100 Consecutively"