5

I am being asked to define several of my algorithms in mathematical terms to describe my work to a customer. I am 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)

sesteel
  • 75
  • 5
  • 1
    I think perhaps "set of symbols" would be better English than "symbology", which - if it's a real word - would mean something like "the study of symbols" – Frank Shearar Nov 18 '10 at 21:52

2 Answers2

9

Sequences or lists in which there is an implied ordering of the elements are commonly delimited between 〈 and 〉. For example:

S = 〈A, B, C〉 (They look like <A, B, C>, but taller. HTML entities are &lang; and &rang; )

If there is no order implied, use set notation.

S = {A, B, C}

Tuples, such as rows from a table or ordered pairs/triples, use parentheses:

car = (Toyota, Camry, 2010)
coordinates = (10, 45)

The union and intersection of sets are represented with the ∪ and ∩ symbols, as usual.

For lists, the operations are different. You concatenate lists rather than finding their union. This can be represented as S+T or simply ST (depending on who's watching).

As tuples are indivisible, the union or intersection of two of them is nonsensical.

You might want to ask this on https://cstheory.stackexchange.com/

Barry Brown
  • 4,095
  • 4
  • 25
  • 27
  • Hmmm... stupid browser. For the unicode impaired, could you point out which symbols you used? I'm guessing angle-brackets/chevrons? – CodexArcanum Nov 17 '10 at 21:03
  • Done. I added a note about the HTML entities I used. – Barry Brown Nov 17 '10 at 21:08
  • I took your suggestion and asked in cstheory as well. Thanks for the pointers, but would you know of a singular tome in which these matters are defined. – sesteel Nov 17 '10 at 22:29
  • Of course, subscripts are often used in math (as in CS) to talk about elements of a sequence. If A = and B = then you can compare or perform arithmetic on ai and bj, etc... (hopefully this makes sense with a little imagination...) – grossvogel Nov 17 '10 at 23:07
  • So, I answered my own question after some research and playing around on Wolfram|Alpha... Relational Algebra http://en.wikipedia.org/wiki/Relational_algebra – sesteel Nov 18 '10 at 07:08
  • I would avoid the use of `+` for concatenation. To many people, `+` implies commutativity, which is definitely not true for concatenation. One popular alternative seems to be `++` for concatenation. – Jörg W Mittag Nov 20 '10 at 14:56
0

Sounds like set notation and set-builder notation. Check out the links for more details and references.

JB King
  • 16,795
  • 1
  • 40
  • 76