What is the conventional notation for a function that returns 2 dissimilar items?

482 Views Asked by At

I see similar questions here and here but they do not answer my question.

The backstory is a little complicated but short version is I have a function $f(\cdots)$ that effectively returns 2 dissimilar results, a scalar $x$ and a vector $\mathbf{y}$. I do not mean there are multiple possible solutions as in e.g. polynomial root solving. I mean $f(\cdots)$ produces $x$ and if you have $x$ you have a unique value for $\mathbf{y}$. The long way to write this out would be $$ x=f(\cdots) \\ \mathbf{y}=g(x,\cdots)$$ but I don't want to break this out into 2 stages and I do not want to stack them into a vector like this $$ \begin{bmatrix}x\\\mathbf{y} \end{bmatrix}=f(\cdots). $$ I would like something like $$ x,\mathbf{y}=f(\cdots) $$ to denote that $x$ and $\mathbf{y}$ are a matched set.

Is there common notation to convey this?

3

There are 3 best solutions below

8
On BEST ANSWER

What is the problem with the vector notation?

Personally, I would define $f$ to produce a 2-tuple $(x, \mathbf{y})$. Unfortunately this is essentially the same as the "vector notation". If you want $f$ to produce $x$ and $\mathbf{y}$ where $x\neq\mathbf{y}$, with the same input, then $f$ is not a function (it is not well-defined!).

1
On

If you don't like a pair as in $f(t)=(x(t), \mathbf y(t))$, then you could separate the two functions but relate them with a diacritic or other typographic distinction. For example, maybe $f(t)$ is a scalar and $\widetilde{\mathbf f}(t)$ is a related vector.

0
On

$\renewcommand{\vec}{\mathbf}$First and foremost, a function is a relation: a collection $R$ of ordered pairs $(x,y)$, where $x$ is an element of some domain $D$, and $y$ is an element of some codomain $E$. In more concise notation, $$ R \subseteq D\times E. $$ A function $f$ is a special kind of relation which has the property that $$ (x,y_1), (x,y_2) \in f \implies y_1 = y_2. $$ In particular, this implies that a function $f$ is a collection of ordered pairs. From the point of view of notation, it doesn't really matter what the domain and codomain are. The notation $$ y = f(x) $$ means that the ordered pair $(x,y) \in f$, where $x \in D$ (i.e. $x$ is in the domain of $f$), and $y \in E$ (i.e $y$ is in the codomain of $f$). This notation is perfectly fine for whatever domain and codomain $f$ might have—the notation doesn't care if $y$ is a number; or a vector; or a fish; or a tuple which contains a number, a vector, and a fish.

From the question, it sounds like the intended idea is that there is a function $f$ which takes some input $t$, then produces two objects as output: a scalar $s(t)$ and a vector $\vec{v}(t)$. I would suggest that the notation $$ f : D \to k \times V : t \mapsto \bigl( s(t), \vec{v}(t) \bigr)$$ would be reasonable, where $D$ is the domain of $f$, $k$ is the field of scalars, and $V$ is a vector space (presumably over $k$, but the question is not clear about this). In other words, I would write $$ f(t) = (s, \vec{v}) = \bigl( s(t), \vec{v}(t) \bigr), $$ where $t \in D$ is some input, $s = s(t) \in k$ is a scalar, and $\vec{v} = \vec{v}(t)$ is a vector.