3
$\begingroup$

So I have a matrix $A=[a_{ij}]_{\forall\,i,j\in\{1,\dots,n\}}$.

I have no problem to define a set $S$ as $S:=\{j: j=\text{argmax}_{j'}\; a_{ij'},\forall i\in\{1,\dots,n\} \}$ for example. In fact, I have seen sets defined this way many times.

Now my problem is with tuple. Is it correct to use the same for tuple. So, can I say "let $A$ be the tuple $A:=(j: j=\text{argmax}_{j'}\; a_{ij'},\forall i\in\{1,\dots,n\} )$." or this makes no sense?

EDIT

In fact, I have a bad time finding some mathematical object that is like array in programming language. So I can access elements of that object, find its size, add elements, remove elements, etc. Is there any mathematical object like this?

  • 0
    Your "tuple" is in fact a 1D array, isn't it ? $$J:=[j_i]_{j_i=\text{argmax}_{j'}\; a_{ij'},\forall i\in\{1,\dots,n\}}$$2017-01-16
  • 0
    @YvesDaoust Yes, this is it.2017-01-16
  • 0
    You'd probably have fun learning the Relational Model. It's actually pure math (that SQL departs from drastically). Tuples and relations. But *most* books on the subject have misconceptions; look for Chris J. Date's books.2017-01-17

3 Answers 3

2

What do we typically write for the type of a tuple? Usually something like $\mathbb{R}^n$, say, for a $n$-tuple of real numbers. What does this notation mean? We could say that it means "multiply" $\mathbb{R}$ with itself $n$ times, i.e. $\mathbb{R}\times\cdots\times\mathbb{R}$. Alternatively, we could view $n$ as standing for the set $\{1,...,n\}$ and $\mathbb{R}^n$ as the function space $n \to \mathbb{R}$. This is completely consistent. An array is just a function, usually from a finite input space. A sequence is just a function from $\mathbb{N}$. A matrix is just a function $m\times n \to \mathbb{R}$.

From this perspective you can simply say the tuple $x = i \mapsto \text{argmax}_j A(i,j)$ treating your matrix, $A$, as a function too, because hey, why not? You can, of course, use subscripting as a notational variation on function application leading to ryanblack's answer rationalized: $x_i = \text{argmax}_j A_{ij}$

You can define "array" operations on this representation if you like, e.g. prepending an element would look like: $$\text{prepend}(a,x)\equiv i \mapsto \begin{cases}a, & i = 0\\ x_{i-1}, & i \neq 0\end{cases}$$ As ryanblack suggests though, mathematician's are rarely this precise or detailed.

5

Perhaps list comprehension is what you're after? I should add that mathematicians don't use this notation very often (probably to our detriment).

  • 0
    I'd like to think that list comprehensions were inspired by the notation of sets by mathematicians. So in this sense, we do use this notation very often.2017-01-16
  • 0
    Thank you. In fact, I have a bad time finding some mathematical object that is like `array` in programming language. So I can access elements of that `object`, find its size, add elements, remove elements, etc. Is there any mathematical object like this?2017-01-16
5

I would just write the tuple out to avoid any confusion or ambiguity with the order:

$$x = (x_1,\ldots,x_n),\ x_i = \operatorname{argmax}_j a_{ij}$$

Edit: Mathematical objects don't need to be "implemented". Just write what you want your reader to understand. To add an element $y$ to $x = (x_1,\ldots,x_n)$, just write "$x' = (x_1,\ldots,y,\ldots,x_n)$ where $y$ is inserted in the $i$-th position". To define its size, write "Let $n$ be the length of $x$.". To remove an element, write $(x_1,\ldots,x_{i-1},x_{i+1},...,x_n)$.

  • 0
    If, say, $$A=\begin{pmatrix} 3 & 4 & 8\\ 3 & 6 & 9\\ 10 & 4 & 6\end{pmatrix},$$ then $S=\{3, 3, 1\}=\{1,3\}$. So if I apply what you said I will get $(3, 3, 1)$ but I prefer $(1,3)$ or $(3, 1)$. Can I do this?2017-01-17
  • 0
    You can always describe what you want in complete sentences. I would write something like: "Let $M = \{\operatorname{argmax}_j a_{ij}\mid i=1,\ldots,n\}$. We write $M = \{m_1,\ldots,m_k\}$ so that $m_1<\ldots< m_k$ and consider the tuple $S=(m_1,\ldots,m_k)$."2017-01-17
  • 0
    Is there a way to transform a set to a tuple?2017-01-17
  • 1
    "For a finite set $M\subset \mathbb{R}$ we define the tuple $T(M)$ as follows: Write $M = \{m_1,\ldots,m_k\}$ with $m_1 < \ldots$T(M) = (m_1,\ldots,m_k)$." Now use $T(M)$ as you wish. I don't think there's a consistent notation for "transforming a set to a tuple"... – 2017-01-17
  • 1
    Even something simple like "We list all the numbers in $M$ in ascending order $m_1,m_2,\ldots$ and consider the tuple $(m_1,m_2,\ldots)$" will suffice.2017-01-17