37
$\begingroup$

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)$?

$\endgroup$
  • 2
    $\begingroup$ I have seen more notations for this, the easiest is $XY$.. $\endgroup$ – Berci Feb 9 '13 at 10:54
  • 6
    $\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
  • 6
    $\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
33
$\begingroup$

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.

$\endgroup$
  • 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 at 21:43
10
$\begingroup$

The same question on Tex SE.

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:

| cite | improve this answer | |
$\endgroup$
  • 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
  • $\begingroup$ Wouldn't $X\times Y$ be the Cartesian Product of $X$ and $Y$? $\endgroup$ – Mr Pie Dec 26 '17 at 4:14
5
$\begingroup$

$\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+}}
| cite | improve this answer | |
$\endgroup$
  • 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
  • 3
    $\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 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 at 21:46
  • $\begingroup$ @HelloGoodbye like ++ $\endgroup$ – Chiel ten Brinke Oct 11 at 9:15
3
$\begingroup$

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$.

| cite | improve this answer | |
$\endgroup$
2
$\begingroup$

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.

| cite | improve this answer | |
$\endgroup$
2
$\begingroup$

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$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ i didn't know about \!. thanks\!! $\endgroup$ – anthonybell Feb 9 '17 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.