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)$?
-
In fact I meant a symbol for two named sequences, where it is not clear what their content looks like. I changed the question correspondingly. – chtenb Feb 09 '13 at 10:51
-
3I have seen more notations for this, the easiest is $XY$.. – Berci Feb 09 '13 at 10:54
-
11Depending on context, I have seen $XY$, $X\cdot Y$, and $X^{\frown}Y$. – Brian M. Scott Feb 09 '13 at 13:40
-
2Yes, probably this $X{}^\frown Y$ is the symbol you are looking for. – Berci Feb 09 '13 at 14:03
-
14I have seen $X||Y$. – Ron Gordon Feb 09 '13 at 14:33
-
3I've seen lots of notations, but I prefer $X^\frown Y$ because it doesn't seem to be used for anything else. – Andreas Blass Feb 10 '13 at 21:29
-
@RonGordon I was taught recently that the notation $X||Y$ means $X$ is parallel to $Y$ – Mr Pie Dec 26 '17 at 04:13
-
2In computer science I have often seen . used as concatenation, like $X.Y$ – DanielV Jul 28 '21 at 21:18
8 Answers
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.
- 105
- 17,924
- 9
- 52
- 132
-
3
-
7@Pedro77 How about $\big\Vert_{i=1}^N v_i = v_1 \Vert \dots \Vert v_N$? – user76284 Jul 19 '18 at 21:13
-
1I 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. – HelloGoodbye Oct 10 '20 at 21:43
-
5This answer sums up pretty well my problem with mathematical formalism. Even the most ridiculously trivial things are hard to find a clear answer to. – Johan Nov 04 '20 at 10:11
-
@Johan: That is why I began to define the heck out of everything, including notation, in my publications. – Make42 Sep 19 '21 at 14:09
-
I found
X {}^\frown Yto look nicer when the variables may have subscripts, compare $X_1^\frown X_2$ with $X_1 {}^\frown X_2$ (maybe there is a neater way to achieve this though?) – Miriam Jun 03 '25 at 01:15
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:
-
4I 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. – Warbo Dec 07 '15 at 10:20 -
2
-
4
$\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,491
-
1You'd have to pay your secretary a lot more to type all that for one symbol. :) – DanielWainfleet Aug 05 '16 at 13:06
-
9@user254665 That would be written once, at the top of the document, and thereafter
\mdoublepluscan be used. – OJFord Feb 24 '17 at 14:01 -
5The ⧺ symbol is
\doubleplusin the packages unicode-math, stix and stix2. – Davislor Apr 22 '20 at 05:01 -
I haven't used haskell, but how do you even type that symbol (when programming in haskell)? – HelloGoodbye Oct 10 '20 at 21:46
-
2
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.
- 2,636
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$.
- 69,385
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}
- 41
-
Can you please explain reasoning for downvote; I'd like the opportunity to learn from my mistake. – Daedalus Feb 01 '21 at 23:58
-
The question is asking for a "symbol" which is basically just a single character, not a notation as in your answer. – SMMH Jun 08 '21 at 06:07
-
3A tuple of two sequences is something different than a single sequence (after concatenation). – Make42 Sep 19 '21 at 14:10
First of all, the $\frown$ (like the $\smile$) are used in algebraic topology for the cap (cup) product, so there is another use for this symbol. I haven't seen $\uplus$ suggested and I have searched extensively to find an existing use without success. It seems especially suited because sequences are in fact index-ordered sets which can contain duplicate elements. Concatenation is the union of such sets which preserves the order of concatenation and allows duplicates.
- 143