0

Given a matrix $\mathbf{X}\in\{0,1\}^{N\times M}$, what is the set notation I should use to define this: the set of all $n\in\{1,\ldots,N\}$ such that there exists at least $m\in\{1,\ldots,M\}$ where $\mathbf{X}_{n,m}=1$.

I write it as: $$\{n:\mathbf{X}_{n,m}=1,m\in\{1,\ldots,M\}\}, (1)$$ but it seems that would find all $n\in\{1,\ldots,N\}$ such that $\mathbf{X}_{n,m}=1$ for all $m\in\{1,\ldots,M\}$, which only finds the rows that have all ones.

If I write it as: $$\{n:\exists m\in\{1,\ldots,M\} : \mathbf{X}_{n,m}=1\},(2)$$ it seems ok but I used two ``such that'' in the defined set, which is ugly and maybe wrong.

Example: $N=3$, $M=4$, and

$$\mathbf{X}=\begin{pmatrix}1 & 1 & 0 & 0\\ 0 & 0 & 0 & 0\\ 1 & 1 & 1 & 1\end{pmatrix}.$$ I want the set $\{1, 3\}$ because row 1 has at least one nonzero element and row 3 has at least one nonzero element but row 2 in zero.

With $(1)$, the set is $\{3\}$, isn't it?

Asaf Karagila
  • 393,674
zdm
  • 452
  • 2
    I don’t think there is an issue with two “such that”’s. If the point of a set is to communicate a class of objects satisfying a well-formed quantifier, you are using a set well! Personally, I find the colon to be notationally helpful only at the beginning to delineate what is actually in the set; any existential quantifier after that is followed by the letters “s.t.”. – While I Am Jun 10 '23 at 03:16
  • 1
    No need of a second "$:$". Simply write$${n\in{1,\ldots,M}: \exists m\in{1,\ldots,M} \quad\mathbf{X}_{n,m}=1}.$$ – Anne Bauval Jun 10 '23 at 06:17

2 Answers2

2

My suggestion is $$\{n: \left|\{m: X_{n,m} = 1\}\right| \geq 1 \}$$

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Jun 10 '23 at 03:33
0

Since the values of the matrix are $0$ and $1$, you can write

$$ \{n: \sum_{m=1}^M X_{n,m}\geq 1 \} $$

This seems artificial but, if you don't mind introducing some notations, you can write the sum as a product of matrices so we stay in the realm of linear algebra: let $U$ the $M\times 1$ matrix whose entries are all $1$ and for $n\in\{1,\dots,M\}$, $e_n$ be the $N\times 1$ matrix whose values are all $0$, except the $n$th one which is equal to $1$. Then $XU$ is the sum of all columns of $X$, so

$$ e_nXU = \sum_{m=1}^M X_{n,m} $$


With (1), the set is ${3}$, isn't it?

Actually, the meaning of $(1)$ is unclear since we don't know what $m$ is. Is supposed to be "for every $m\in \{1,\dots,M\}$" or "for some $m\in \{1,\dots,M\}$"?

Taladris
  • 11,339
  • 5
  • 32
  • 58