<p>Specification languages such as <a href="http://en.wikipedia.org/wiki/Z_notation" rel="nofollow">Z</a> have a vast range of data types and operations on them and, at least within that community, these are standardised. This <a href="http://www.uni-koblenz.de/~beckert/Lehre/Spezifikation/11Z.pdf" rel="nofollow">tutorial</a> gives a great overview. Other specification languages exist, such as <a href="http://en.wikipedia.org/wiki/B-Method" rel="nofollow">B</a> and <a href="http://en.wikipedia.org/wiki/Alloy_%28specification_language%29" rel="nofollow">Alloy</a> which may also satisfy your requirements.</p>

CC BY-SA 2.5
2011-01-19T12:19:32.317Z
2011-01-19T15:07:26.587Z
2011-01-19T15:07:26.587Z
Dave Clarke
<p>Just define what you need and try to give it a descriptive name. The first example could be the largest common prefix (can't really tell from an example). The second just looks like a concatenation (which is usually +).</p>

CC BY-SA 2.5
2011-01-19T12:06:06.243Z
2011-01-19T12:06:06.243Z
ziggystar
<p>Relational algebra symbology most accurately depicts what I am trying to communicate.</p>

<p><a href="http://en.wikipedia.org/wiki/Relational_algebra" rel="nofollow">http://en.wikipedia.org/wiki/Relational_algebra</a></p>

CC BY-SA 2.5
2010-11-18T06:54:06.193Z
2010-11-18T06:54:06.193Z
JMike
<p>Preface: So, it was suggested in 'Programmers' that I ask this over here.</p>

<p>I am being asked to define several of my algorithms in mathematical terms to describe my work to a customer. I trying to determine if anybody knows whether common operators for collections like sequences, lists, tuples, etc have been defined. If so, is there a good reference that I could be pointed to. Thanks. I am interested in the actual symbols used. I am wondering if the following would make sense or be appropiate to anybody.</p>

<p>Given two sequences (or strings):</p>

<p>S = (A, B, C) and T = (A, D, H)</p>

<p>In my mind, the intersection of these sequences would look like S ∩ T = (A) and the union of these sequences would be S ∪ T = (A, B, C, A, D, H)</p>

CC BY-SA 2.5
2010-11-17T23:27:00.197Z
It's not clear what intersection and union look like for sets of sequences: your intersection operation looks like a set intersection, but the union operation looks like a disjoint union, and probably should merely be concatenation (+).
Suresh Venkat
CC BY-SA 2.5
2010-11-18T01:24:56.963Z
Next time you crosspost, please add a link!  http://programmers.stackexchange.com/questions/19701/is-there-a-common-mathematical-symbology-for-collections
Tsuyoshi Ito
CC BY-SA 2.5
2010-11-18T03:46:14.870Z
Perhaps more suitable for MathOverflow. Sequence, list, tuples are all linearly ordered structures, a collection is usually used as an alternative name for sets which are unordered. If you are talking about linearly ordered collections then parenthesis (there are other notations also) seems OK to me, you may want to look at notations for list operations. Someone from PL theory would know better, they are pretty good with symbols :).
Kaveh
CC BY-SA 2.5
2010-11-18T06:56:48.203Z
Thanks for the pointers and advice...  It is truly appreciated, and I will link when I crosspost next time.
JMike
CC BY-SA 2.5
2010-11-23T09:26:58.387Z
It is common that function names of some programming language is used. ++/⧺ for concatenation.
beroal
CC BY-SA 2.5
2010-12-18T09:35:25.473Z
In my math education I have yet do encounter a notation for collections (or multisets). I would probably go with $[A, B, A, ...]$ because I am not aware of any conflicts and it is immediately clear to any programmer.
Raphael
CC BY-SA 2.5
2010-12-18T10:45:06.803Z
@Raphael: It does not seem to me that that the OP means multiset by collection.
Kaveh
CC BY-SA 2.5
2010-12-18T13:58:27.447Z
But that is what collections typically are, afaik. See, e.g., http://download.oracle.com/javase/6/docs/api/java/util/Collection.html
Raphael
<ds.data-structures><pl.programming-languages><co.combinatorics><notation>
Is there a common mathematical symbology for collections?
JMike
# Is there a common mathematical symbology for collections?

(Asked by: username_0 on 2010-11-17)

Preface: So, it was suggested in 'Programmers' that I ask this over here.

I am being asked to define several of my algorithms in mathematical terms to describe my work to a customer. I trying to determine if anybody knows whether common operators for collections like sequences, lists, tuples, etc have been defined. If so, is there a good reference that I could be pointed to. Thanks. I am interested in the actual symbols used. I am wondering if the following would make sense or be appropiate to anybody.

Given two sequences (or strings):

S = (A, B, C) and T = (A, D, H)

In my mind, the intersection of these sequences would look like S ∩ T = (A) and the union of these sequences would be S ∪ T = (A, B, C, A, D, H)

**Tags:** ds.data-structures, pl.programming-languages, co.combinatorics, notation
> **Comments:**
> **username_1**: It's not clear what intersection and union look like for sets of sequences: your intersection operation looks like a set intersection, but the union operation looks like a disjoint union, and probably should merely be concatenation (+).  
> **username_2**: Next time you crosspost, please add a link!  http://programmers.stackexchange.com/questions/19701/is-there-a-common-mathematical-symbology-for-collections  
> **username_3**: Perhaps more suitable for MathOverflow. Sequence, list, tuples are all linearly ordered structures, a collection is usually used as an alternative name for sets which are unordered. If you are talking about linearly ordered collections then parenthesis (there are other notations also) seems OK to me, you may want to look at notations for list operations. Someone from PL theory would know better, they are pretty good with symbols :).  
> **username_0**: Thanks for the pointers and advice...  It is truly appreciated, and I will link when I crosspost next time.  
> **username_4**: It is common that function names of some programming language is used. ++/⧺ for concatenation.  
> **username_5**: In my math education I have yet do encounter a notation for collections (or multisets). I would probably go with $[A, B, A, ...]$ because I am not aware of any conflicts and it is immediately clear to any programmer.  
> **username_3**: @Raphael: It does not seem to me that that the OP means multiset by collection.  
> **username_5**: But that is what collections typically are, afaik. See, e.g., http://download.oracle.com/javase/6/docs/api/java/util/Collection.html  

---

## 3 answers

### Answer by username_6 on 2011-01-19. Score: 5

Specification languages such as [Z](http://en.wikipedia.org/wiki/Z_notation) have a vast range of data types and operations on them and, at least within that community, these are standardised. This [tutorial](http://www.uni-koblenz.de/~beckert/Lehre/Spezifikation/11Z.pdf) gives a great overview. Other specification languages exist, such as [B](http://en.wikipedia.org/wiki/B-Method) and [Alloy](http://en.wikipedia.org/wiki/Alloy_%28specification_language%29) which may also satisfy your requirements.


---

### Answer by username_7 on 2011-01-19. Score: 1

Just define what you need and try to give it a descriptive name. The first example could be the largest common prefix (can't really tell from an example). The second just looks like a concatenation (which is usually +).


---

### Answer by username_0 on 2010-11-18. Score: 1

Relational algebra symbology most accurately depicts what I am trying to communicate.

<http://en.wikipedia.org/wiki/Relational_algebra>


---

