Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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)

share|improve this question
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 Answers 2

up vote 8 down vote accepted

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 http://cstheory.stackexchange.com/

share|improve this answer
    
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 = <a1,a2,...> and B = <b1,b2,...> 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 en.wikipedia.org/wiki/Relational_algebra –  sesteel Nov 18 '10 at 7:08

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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