Hey Guys,
I just need some clarification on a rather simple question; it goes like this: What is the sum of all the positive integers up to 100, inclusive?
The answer I got was the same as the solution in the book: 5050; however, I arrived at my answer differently and would like to know if my understanding of the concept is flawed. The book gives the following explanation on how to arrive at the answer:
There are 100 integers from 1 to 100, inclusive: (100-1) + 1. (Remember to add one before you are done.) The number exactly in the middle is 50.5. (You can find the middle term by averaging the first and last term of the set.) Therefore, multiply 100 * 50.5 to find the sum of all the integers in the set: 100 * 50.5 = 5050.
Here was my reasoning: There are actually 101 integers up to 100 inclusive of 0 (right?). So, (100-0)+1 = 101 yields the count; (0+100)/2 = 50 yields the average; and, finally, 50*101 = 5050 gives the sum. I also thought my method was correct since an even amount of consecutive integers do not have an average (that is an integer). You might say it doesn't matter since I arrived at the correct answer, but I would like to know if my whole thought process was correct. Anyone who has any valuable input feel free to lend me a hand. Thank you.
Regards,
Yardy83