2
$\begingroup$

I would like to check my understanding of an Iversonian equation presented shortly before 2.33 (page 37 in paper book) of Concrete Mathematics (Graham, Knuth, Patashnik). They discuss deriving a simple formula for finding the sum of all elements on or above the main diagonal of an array. The book says:

Our goal is to find a simple formula for

$$ S_◹ = \sum_{1 \le j \le k \le n} a_ja_k $$

I get that part however I am unsure of the Iversonian equation:

$$ [1 \le j \le k \le n] + [1 \le k \le j \le n] = [1 \le j,k \le n] + [1 \le j=k \le n] $$

Why is it not simply:

$$ [1 \le j \le k \le n] + [1 \le k \le j \le n] = [1 \le j,k \le n] $$

I think this is because, in the process of doing the LHS $[1 \le j \le k \le n] + [1 \le k \le j \le n]$ we count the diagonal twice. Hence adding it on again on the RHS of that Iversonian equation.

$\endgroup$
2
  • $\begingroup$ This question has arisen a few times on MSE; you might try looking at a site-specific google. $\endgroup$ Commented Nov 12, 2023 at 1:05
  • $\begingroup$ Thank you, I will review that and use the site-specific Google search in the future. $\endgroup$ Commented Nov 13, 2023 at 3:20

1 Answer 1

0
$\begingroup$

Your assumption is correct. We have \begin{align*} &\color{blue}{[1 \le j \le k \le n] + [1 \le k \le j \le n] }\\ &\qquad=\left([1 \le j < k \le n] +[1 \le j = k \le n]\right)\\ &\qquad\qquad + \left([1 \le k < j \le n] + [1 \le k = j \le n]\right)\\ &\qquad=\left([1 \le j < k \le n] +[1 \le j = k \le n] + [1 \le k < j \le n] \right)\\ &\qquad\qquad + [1 \le k = j \le n]\\ &\qquad\color{blue}{=[1 \le j, k \le n]+[1 \le j = k \le n]} \end{align*} according to the claim.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .