I am having some trouble prooving the following summation formula. As a and b are constants I got the constant part out of the sum and tried to split the summation (such that sum of a to b is the same as sum of 1 to b minus sum of 1 to a plus a for example), but it always ends up with an expression that never simplifies to this result. I also spent a lot of time looking for the formula for this summation and somehow cannot manage to find exactly this:
$$\sum_{i=a}^b i \cdot \frac{1}{b-a+1} = \frac{a+b}{2}$$
How do we get from left to right here? Or even simpler, what is the formula for just this sum?
$$\sum_{i=a}^b i$$
sum(1 to b) minus sum(1 to a) plus 1using then(n+1)/2formula. I don't get why that did not work though. – evilmandarine Jun 23 '23 at 22:04