It is okay to have a conditions in a summation limit that depend on the current value of another summation

171 Views Asked by At

this is one of those things that I know how to do in a programming environment but not sure how it translates into mathematics. I'm trying to express a sum so that it is easily visible that certain elements can be seen to be equal. Here is the original sum:

$$ s=\sum_{\alpha = 0}^{3}\sum_{\beta = 0}^{3}M_{\alpha \beta}(\Delta x ^ \alpha)(\Delta x ^ \beta) $$

where the greek characters are indices not exponents. Here is my reformulated version:

$$ s = \sum_{\alpha=0}^{3} M_{\alpha\alpha}(\Delta x^\alpha)^2 + \sum_{\alpha=0}^{3}\sum_{\beta = \alpha + 1}^{3} (M_{\alpha\beta} + M_{\beta\alpha}) (\Delta x^\alpha)(\Delta x^\beta) $$

This would make sense in something like a for loop where the order of summation is clear, but I'm not really sure how to express it in the context of the summation symbols. As a specific question, could someone tell me if this is mathematically valid?

1

There are 1 best solutions below

2
On BEST ANSWER

Note: It's perfectly valid to treat finite sums in the same way as for-loops in programs. You can multiple sums reshuffle in the same way as you may reorganise nested for-loops.

Two hints:

  • You mention that certain elements are equal. This is not obvious. If an element is $$M_{\alpha \beta}(\Delta x ^ \alpha)(\Delta x ^ \beta),\qquad 0\leq \alpha,\beta\leq 3$$ no two of them have to be equal. Maybe you mean symmetrical with respect to indices instead.

  • The reformulated expression

\begin{align*} s =\sum_{\alpha=0}^{3} M_{\alpha\alpha}(\Delta x^\alpha)^2 + \sum_{\alpha=0}^{3}\sum_{\beta = \alpha + 1}^{3} (M_{\alpha\beta} + M_{\beta\alpha}) (\Delta x^\alpha)(\Delta x^\beta)\tag{1} \end{align*} is correct, but we can see that the double sum in (1) with $\alpha=3$ gives an inner sum equal to zero $$\sum_{\beta = \mathbb{4}}^{3} (M_{\alpha\beta} + M_{\beta\alpha}) (\Delta x^\alpha)(\Delta x^\beta)=0$$ since it is an empty sum. This corresponds precisely to a nested for-loop and a setting of the outer index variable so that the inner for-loop is not executed. \begin{array}{l} \text{sum} \leftarrow 0\\ \text{for } \alpha \text{ in } (0:3) \,\{\\ \qquad\text{for }\beta \text{ in } ((\alpha+1):3) \,\{\\ \qquad \qquad\text{sum} \leftarrow \text{sum}+(M_{\alpha\beta} + M_{\beta\alpha}) (\Delta x^\alpha)(\Delta x^\beta)\\ \qquad\}\\ \} \end{array}

You may observe that the inner loop is not executed when $\alpha=3$.

Therefore you would presumably change the outer for-loop to iterate from $(0:2)$ and in the same way you could simplify the reformulated expression to

\begin{align*} s =\sum_{\alpha=0}^{3} M_{\alpha\alpha}(\Delta x^\alpha)^2 + \sum_{\alpha=0}^{\mathbb{2}}\sum_{\beta = \alpha + 1}^{3} (M_{\alpha\beta} + M_{\beta\alpha}) (\Delta x^\alpha)(\Delta x^\beta) \end{align*}