Total variation of a step function

What is the formula for the total variation of a step function on [a,b]? I understand how to write a formula for the total variation of a general function of bounded variation. Any ideas?

-
seems like its 2 times the size of the step (step up and step down) –  yoyo Apr 3 '11 at 0:46

Suppose that $f(x)=A$ on $[a,c]$ and $f(x)=B$ on $(c,b]$ for some $c$ in $[a,b)$. Then you can show that the total variation is $|B-A|$, the "size of the jump", because this will be the result of the sum no matter what partition you choose. (The same would be true if it were $[a,c)$ and $[c,b]$ with $c$ in $(a,b]$.) For the general case, you can refine your partitions to consider just one jump at a time. The total variation is the sum of the total variations on subintervals containing just one jump, which amounts to the sum of the sizes of the jumps.