Sigma notation: number columns with sum > 0 of binary matrix

347 Views Asked by At

I'm trying to formulate a Sigma notation formula which would yield the count (sum) of columns which themselves have a non-zero sum.

$\begin{bmatrix} 1 & 0 & 0 & 0 & 0\\ 1 & 1 & 0 & 0 & 1\\ 0 & 0 & 0 & 0 & 1 \end{bmatrix}$

In this above example the result would be $3$. Is it possible to write this down as sigma notation?

2

There are 2 best solutions below

0
On BEST ANSWER

Ok, I think I figured it out also. I think by making use of the Iverson Brakets it would be something like this:

Given the matrix of size $n$ rows and $m$ columns:

$$\displaystyle{\sum_{j=1}^m\left[\sum_{i=1}^nx_i,_j>0\right]}$$

2
On

Let $A=\begin{bmatrix}A_1\dots A_n\end{bmatrix}$ the $(m,n)$-matrix whose columns are the vectors $A_1,\dots,A_n$ of ${\mathbb R}^m$.

If $f$ is the function whose value $f(v)$ is $1$ when the sum of all components of $v$ is positive and $0$ otherwise, then the count you are looking for is $$\displaystyle{\sum_{j=1}^nf(A_j)}$$

There are several options to describe $f$. One possibility is $\displaystyle{f(v)=G(\sum_{i=1}^m v_i)}$ where $G$ is the function defined by $G(x)=1$ when $x>0$ and $G(x)=0$ otherwise (hence, it is the indicatrix function of $(0,\infty)$). You can simplify the expression of $\displaystyle{\sum_{i=1}^m v_i}$ into the dot product $v\cdot {\mathbb 1}$ where $\mathbb 1=(1,\dots,1)$.