# How would I express conditional summation.

I was hoping the experts here could help me out. I need to express conditional summation. Let me give you guys an example. Suppose I have a timeline like this:

Each value on the time-line in the above image represents a value in hours and the red box around the values shows that an event had occurred at that time. This is all well and good however i need a way to modify the above expression so that it considers only those values that have a red box around them and ignores the rest for example:

Correction in the image (its suppose to be 5-3 sorry about that)

Any suggestions on how i could do that would be appreciated or how the expression should look like...

-
Define another function, say f(t) = 1 when t has a box around it; 0 otherwise. – The Chaz 2.0 Apr 16 '12 at 18:31
@TheChaz Could you explain that a bit in detail – Rajeshwar Apr 16 '12 at 18:50
Sorry I was on my phone... Why not just take $(8 - 3)$, the difference of the first and last numbers with boxes around them? – The Chaz 2.0 Apr 16 '12 at 19:06
@TheChaz hmm.. That definitely makes sense.. I'll look into and get back here.. – Rajeshwar Apr 16 '12 at 19:29

Let $S$ be the set of numbers with red boxes around them.
Then you want something like $\displaystyle\sum_{a\in S} t_a - t_{a+1}$
This sort of symbol is well-defined for finite sets. Also, $\displaystyle\sum_{i=1}^n$ could be rewritten as $\displaystyle\sum_{i\in N}$ where $N=\{0,\dots,n\}$