Is there a mathematical symbol that tells you at which index the sign in the sum should change

72 Views Asked by At

Let's say I want to write the following sum in a more compact way

$$a=z_1+z_2+\dots +z_{n/2}-z_{n/2+1}-z_{n/2+2}-\dots -z_{n}$$

Is there some kind of syntax to write that in a more compact way... Something like $$a=\sum _i ^{n}z_i$$ but with some operator that would change sign from + to - at $i=n/2$ ?

3

There are 3 best solutions below

2
On BEST ANSWER

The clearest would in my opinion be $$ a = \sum_{i=1}^{n/2} z_i - \sum_{i=n/2+1}^n z_i $$

But if you insist on using only one summation sign, you can employ the Iverson bracket: $$ a = \sum_{i=1}^n (-1)^{[i>n/2]}z_i $$

This is not quite so standard notation that you can expect random readers to understand it without you explaining it before you use it, though.

You can also use something like the signum function $$ a = \sum_{i=1}^n \operatorname{sgn}(\tfrac n2+\tfrac12-i)z_i $$ though that gets closer to the realm of obfuscation in my opinion.

0
On

$$\sum \limits_{i = 1}^n z_i \cdot (1 - 2 I\{2i > n\})$$

0
On

What about the formula $a=\sum_{i=1}^n (-1)^{\lfloor \frac{2i-1}{n}\rfloor}z_i$ ?

Here $\lfloor *\rfloor$ denotes the floor function, and note that $\lfloor \frac{2i-1}{n}\rfloor$ is equal to $0$ for $i=1,2,\ldots,n/2$, and it is equal to $1$ for $i=n/2+1,\ldots,n$.