Basic operations on sequences (conventional notation)

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 4K views
azal
Messages
8
Reaction score
0
Hi All,

So here's my question:

Suppose we have two sets [itex]A[/itex] and [itex]B[/itex], then [itex]A \setminus B[/itex] denotes their set-difference.
Does there exist an equivalent operator for the case where A and B are not sets, but sequences?

Otherwise, is there an operator to convert a sequence into a set, removing the index, and all repetitions? In that case, I can take my sequences, convert them to their corresponding sets, and use [itex]\setminus[/itex] to get the result I'm looking for.

Also, what is the counterpart of [itex]A \cup \{b\}[/itex] for the case where [itex]A[/itex] is a sequence? is it [itex]A \oplus b[/itex]?

I can't seem to find such conventions regarding sequences anywhere on the web ...

Thanks so much for your help,

-A.
 
Physics news on Phys.org
azal said:
Does there exist an equivalent operator for the case where A and B are not sets, but sequences?

You aren't being specific enough abou what operation you want. For example,
if A = 1,2,3,4,5 and B = 1,3,3,4,6 what do you want "the equivalent operator" to do? Produce the sequence 1-1,2-3,3-3,4-4,5-6 = 0,-1,0,0,-1 ? Or produce the sequence 2,3,5,6 ? Or produce the sequence 2,6 ?

Some authors use the notation A - B to mean term-by-term subtraction. For more elaborate operations, I don't think there is any standard notation. If you are writing a paper on this specialized subject, look in the related literature and see what people have invented. (And don't feel obligated to use it!)
 
So, assume the operator [itex]f[/itex] takes a sequence, and returns its elements as a set (without repetitions). For example if [itex]\mathbf{a} = (1,1,2,1,3,2)[/itex] then [itex]f(\mathbf{a}) = \{1,2,3\}[/itex].

Now suppose we have a pair of sequences [itex]\mathbf {a} = (a_1,a_2,\cdots,a_n)[/itex] and [itex]\mathbf {b} = (b_1,b_2,\cdots,b_m)[/itex]. I want [itex]\mathbf {a}-\mathbf {b}:= f(\mathbf {a})\setminus f(\mathbf{b})[/itex].
 
So in your example I want the operator to produce: [itex]\{1,2,3,4,5\} \setminus \{1,3,4,6\} = \{2,5\}.[/itex]