Re: How to prove that a random sort algorithm converges?
- From: "James" <jamestansc@xxxxxxxxxxxx>
- Date: 18 May 2006 17:08:52 -0700
In fact, since there can be only a finite number of transpositions, it is
a certainty that the state must converge.
The number of transpositions needed is the number of inversions, which is
why I pushed him toward reasoning about inversions.
However, we need to allow for the possibility of convergence to something
other than the sorted state, since a needed comparison might never be
made.
As above, I fear that gets into weeds the OP doesn't want to visit ;-)
[James:] Not to worry. I will try to understand. The idea of reasoning
about inversions is quite a smart one. Indeed, I am looking for a
simple proof to explain such algorithm so that a lay person can
understand.
As above, I doubt the OP cares about that possibility (although I agree he
needs to understand it-- if only vaguely --in order to grasp why no upper
bound can be given for the number of steps needed to reach the sorted state
whenever the start state has at least 3 elements and at least 1 inversion).
[James:] Actually, I don't really care whether or not to use
probability in the proof, as long as the proof is the easiest for
someone (with little maths background) to understand. The idea of "no
(theoretical) upperbound" for the algorithm is a good point. Now, say
IF I run the algorithm and capture the runtime empirically, and I find
that the runtime appears to scale linearly with respect to increase in
data size n. Can I claim O(n) time complexity for such algorithm?
.
- Follow-Ups:
- Re: How to prove that a random sort algorithm converges?
- From: Chip Eastham
- Re: How to prove that a random sort algorithm converges?
- References:
- Re: How to prove that a random sort algorithm converges?
- From: Tim Peters
- Re: How to prove that a random sort algorithm converges?
- From: James
- Re: How to prove that a random sort algorithm converges?
- From: Tim Peters
- Re: How to prove that a random sort algorithm converges?
- From: Dave Seaman
- Re: How to prove that a random sort algorithm converges?
- From: Tim Peters
- Re: How to prove that a random sort algorithm converges?
- Prev by Date: Re: Ring with nilpotent elements of arbitrary degree
- Next by Date: Re: Ring with nilpotent elements of arbitrary degree
- Previous by thread: Re: How to prove that a random sort algorithm converges?
- Next by thread: Re: How to prove that a random sort algorithm converges?
- Index(es):
Relevant Pages
|