7
$\begingroup$

Is there any formal notation for dealing with lists, rather than sets?

e.g. if I have a set $X=\{x_1,\dots,x_n\}$ and I want to add a new item to the set, say $x_{n+1}$, I can say "Let $X = X \cup \{x_{n+1}\}$" and it is clearly understood that I want to add $x_{n+1}$ to my set.

However, if $X$ is not a set but rather a list, or tuple (i.e. the elements are ordered and duplicates are allowed), is there any way of indicating that I am adding an element to the end of the list?

e.g. given $X=(x_1,\dots,x_n)$, how do I say add an element to $X$ such that $X=(x_1,\dots,x_n,x_{n+1})$? i.e. how do I formally denote appending an element to $X$?

  • 0
    When you say "Let $X=X\cup x_{n+1}$" you are (i) using programmer's lingo, not mathematical notation (mathematically, that only works if $x_{n+1}$ is a *subset* of $X$) and (ii) formally incorrect (you really want $X\cup\{x_{n+1}\}$, not $X\cup x_n$).2011-05-05
  • 0
    To answer your actual question, we talk about "appending" $x_{n+1}$ to the tuple.2011-05-05
  • 0
    Correct; actually I just messed up my latex and forgot to escape the brackets; i meant to write $X = X\cup \{x_{n+1}\}$.2011-05-05
  • 0
    Also, I purposefully didn't use the word "appending" because I thought _that_ was programming lingo :-P2011-05-05

3 Answers 3