Transform a set into an ascending order sequence

Cinitiator
Messages
66
Reaction score
0

Homework Statement


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?

Homework Equations


-


The Attempt at a Solution


Googling without any luck.
 
Physics news on Phys.org
Cinitiator said:

Homework Statement


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?

Homework Equations


-

The Attempt at a Solution


Googling without any luck.

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.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top