Hi all,
Give a sset, how can we convert that into a sequence? Like for example
set S = { 1, 2, 3, 4 }
seq S = < 1, 2, 3, 4 >
thanks
ssharish
Is it a typo?
There are many ways to convert a set into a sequence. For an n-element set, n! ways, to be precise. Note that {1, 2, 3, 4} = {4, 3, 2, 1} as sets. If a set A has n elements, then any injection {1, ..., n} -> A can be considered a sequence of elements of A.
Thanks a lot emakarov for the reply.
Sorry yeah definitely that a typo. I do slip out of my typing now and then
So from what you’re saying can the following be considered as a sequence?
$\displaystyle \{ e:\{1,2,3,4\}|\exists n:\mathbb{N} \bullet n \mapsto e \}$
And of course $\displaystyle n \mapsto e$ is n injective function.
thanks
ssharish
In regular mathematics, as opposed to type theory or programming, one uses ∈ instead of : . Next, the set {e ∈ {1,2,3,4} | ...} is just a subset of {1,2,3,4}, not a sequence.
The question is about the meaning of the question "how can we convert that [a set] into a sequence?" Do you mean conversion in some formal system or programming language? Do you mean some mathematical expression for a sequence? In this case, it is good to have a precise definition of a sequence. Otherwise, converting a set into a sequence informally is easy: choose the order of elements and change { } into < >.
I certainly mean mathematical expression.
I'm involved in writing an function which gets just gets a set of elements from a set of relations.
So what I’m really doing is writing a axiomatic definition or a function which takes a set and returns a sequence.
I've already managed to get a set of elements which i will have to return it in terms of sequence. Hence the question.
Not quite sure if that answers your question.
thanks
ssharish
>Next, the set {e ∈ {1,2,3,4} | ...} is just a subset of {1,2,3,4}, not a sequence.
And I also understand why use ∈ rather than ':'. I think thats how its been used in Z. Sorry about that. Although what i was doing there was a set comperhensin to create a set of mapletsto form a sequence given a set.
thanks a lot
ssharish