8

Is there an analytic expression for a number of items inside a triangular matrix (with and without items on diagonal)?

I tried to solve this with a combinatorial analysis using this "representation" of the problem:

( _, _ ) = ( n, m )

where:

  • "n" is the matrix row index,
  • "m" is the matrix column index. m = { 0, 1, 2, ... n }

but I don't have any further idea (I do not understand combinatorial analysis very well)

PatrykB
  • 239

1 Answers1

22

Well, I guess you simply want the number of triangular matrix entries in an $N\times N$ matrix. . So without the diagonal it is $N(N-1)/2$ and including the diagonal it is $N(N+1)/2$.

Using your notation, matrix indices are usually indexed starting with 1, so you get the results via $$ \sum_{n=1}^N \sum _{m=n+1}^N 1 = N(N-1)/2 $$ and $$ \sum_{n=1}^N \sum _{m=n}^N 1 = N(N+1)/2 $$

Andreas
  • 15,175