Say we have two finite sequences $X = (x_0,...,x_n)$ and $Y = (y_0,...,y_n)$. Is there a more or less common notation for the concatenation of these sequences, like $\sum (X,Y) = (x_0,...,x_n,y_0,...,y_n)$?
-
2$\begingroup$ I have seen more notations for this, the easiest is $XY$.. $\endgroup$ – Berci Feb 9 '13 at 10:54
-
7$\begingroup$ Depending on context, I have seen $XY$, $X\cdot Y$, and $X^{\frown}Y$. $\endgroup$ – Brian M. Scott Feb 9 '13 at 13:40
-
2$\begingroup$ Yes, probably this $X{}^\frown Y$ is the symbol you are looking for. $\endgroup$ – Berci Feb 9 '13 at 14:03
-
8$\begingroup$ I have seen $X||Y$. $\endgroup$ – Ron Gordon Feb 9 '13 at 14:33
-
3$\begingroup$ I've seen lots of notations, but I prefer $X^\frown Y$ because it doesn't seem to be used for anything else. $\endgroup$ – Andreas Blass Feb 10 '13 at 21:29
The comments suggest the following notations for the concatenation of $X$ and $Y$:
- $X^\frown Y$ (given by
X^\frown Y
); - $XY$ (given by
XY
); - $X \cdot Y$ (given by
X \cdot Y
); - $X \mathbin\Vert Y$ (given by
X \mathbin\Vert Y
);
of which the first seems not to be in use for other concepts, making it especially suitable.
-
2$\begingroup$ What about concatenation from i=1 to N vectors? $\endgroup$ – Pedro77 Apr 6 '18 at 22:02
-
5$\begingroup$ @Pedro77 How about $\big\Vert_{i=1}^N v_i = v_1 \Vert \dots \Vert v_N$? $\endgroup$ – user76284 Jul 19 '18 at 21:13
-
$\begingroup$ I would personally definitely avoid $X\cdot Y$, as that easily can be misinterpreted as the dot product. But hey, maybe it's obvious what is meant given the context. $\endgroup$ – HelloGoodbye Oct 10 '20 at 21:43
-
$\begingroup$ This answer sums up pretty well my problem with mathematical formalism. Even the most ridiculously trivial things are hard to find a clear answer to. $\endgroup$ – Johan Nov 4 '20 at 10:11
From there, and more:
- $X \oplus Y$ (given by
X \oplus Y
); - $(X,Y)$ (given by
(X,Y)
);
I would avoid $X \times Y$, $XY$ or $X \cdot Y$ to not confuse it with any sort of multiplication / product.
And I would also not use $X \otimes Y$ because it is usually the tensor product. (See also here.)
Some relevant Wikipedia pages with common notations:
-
2$\begingroup$ I would avoid
(X, Y)
for concatenation, as it conflicts with the notation used for sequences(x_0, ..., x_n)
; appearing to be a sequence containing two sequences. $\endgroup$ – Warbo Dec 7 '15 at 10:20 -
1$\begingroup$ Wouldn't $X\times Y$ be the Cartesian Product of $X$ and $Y$? $\endgroup$ – Mr Pie Dec 26 '17 at 4:14
-
$\newcommand\mdoubleplus{\mathbin{+\mkern-10mu+}}$ In haskell the $ \mdoubleplus $ operator is used for concatenating lists.
You can define it in latex using the command
\newcommand\mdoubleplus{\mathbin{+\mkern-10mu+}}
-
1$\begingroup$ You'd have to pay your secretary a lot more to type all that for one symbol. :) $\endgroup$ – DanielWainfleet Aug 5 '16 at 13:06
-
4$\begingroup$ @user254665 That would be written once, at the top of the document, and thereafter
\mdoubleplus
can be used. $\endgroup$ – OJFord Feb 24 '17 at 14:01 -
$\begingroup$ The ⧺ symbol is
\doubleplus
in the packages unicode-math, stix and stix2. $\endgroup$ – Davislor Apr 22 '20 at 5:01 -
$\begingroup$ I haven't used haskell, but how do you even type that symbol (when programming in haskell)? $\endgroup$ – HelloGoodbye Oct 10 '20 at 21:46
-
Computer science often uses the ⧺ (U+29FA) symbol for concatenation.
This is \doubleplus
in the LaTeX package unicode-math (which requires a modern engine that supports Unicode), as well as the legacy packages stix and stix2. Or, in the modern toolchain, you can use the Unicode symbol in your source.
If $x$ and $y$ are finite sequences, you could denote their concatenation by $xy$. Let me explain. There's at least two ways of formalizing the statement "$x$ and $y$ are finite sequences in $X$"
$x$ and $y$ are functions of type $[\:\!n) \rightarrow X$, where $[\:\!n)$ is a shorthand for the set $\{0,\ldots,n-1\}$.
$x$ and $y$ are elements of $X^*$, where $X^*$ is the monoid freely generated by $X$.
If you're interested in concatenating these things, then you should probably take the second perspective, in which case the concatenation of $x$ and $y$ is simply their product in the monoid $X^*$, which is denoted $xy$.
In formal specifications, one way to concatenate two sequences is using the Haskell concatenation symbol as indicated in one of the comments above. In a $\mathrm\TeX$ editor one can type the following: X +\!\!\!+ Y
. The result appears like this, $X+\!\!\!+Y$.
Starting with your defined sequences $X = (x_0, \ldots, x_n)$ and $Y=(y_0,\ldots,y_n)$, you can use the commonly accepted tuple/ordered pair notation: \begin{align} (X,Y) &= \left( \left(x_0,\ldots,x_n\right), \left(y_0,\ldots,y_n\right) \right) \\ &= \left(x_0,\ldots,x_n,y_0,\ldots,y_n\right) \end{align}
-
$\begingroup$ Can you please explain reasoning for downvote; I'd like the opportunity to learn from my mistake. $\endgroup$ – Daedalus Feb 1 at 23:58