# Transform a set into an ascending order sequence

1. Oct 19, 2012

### Cinitiator

1. The problem statement, all variables and given/known data
Let's say that I have a set called M, which is a subset of real numbers. Let's say that I want to create a sequence {$s_1, s_2, ..., s_3$} with all of the members of M, which would be ordered in an ascending (increasing) order. For example, if M = {4, 5, 1, 3, 2}, then $s_0 = 1 ; s_1 = 2; s_2 = 3$ etc.

How does one do that?

2. Relevant equations
-

3. The attempt at a solution
Googling without any luck.

2. Oct 19, 2012

### jbunniii

This is not possible in general.

If M is uncountably infinite, then there isn't even a way to enumerate its elements in a sequence.

If M is countably infinite, then you can enumerate the elements in a sequence (indeed, this is the definition of countable), but in general it won't be possible to sort this sequence. Consider $M = \mathbb{Q}^+$, the set of positive rational numbers. This set has no smallest element, so it's impossible even to choose $s_0$ in the way that you want to do.

However, in some particular cases it may be possible when M is countably infinite. For example, if $M = \mathbb{N}$, the set of natural numbers, just choose $s_0 = 1, s_1 = 2, s_2 = 3, \ldots$.

Of course, if M is finite, then this will always be possible. If you want a concrete algorithm to do it, look into various sorting algorithms: bubble sort, insertion sort, quick sort, etc.