Sort with random deviations I'm looking for an algorithm that will take a sorted array of numbers and generate a random permutation of this array in such a way that the probability of finding a larger element earlier in a sequence than a smaller element is proportional to the ratio of these elements' values.

For instance if we have a sorted sequence of elements: 1, 2, 3, then I'd like this algorithm to generate a permutation of this sequence in such a way that the probability of finding element 3 earlier in a sequence than the element 1 is 3 times smaller than the other way around. This property should hold for all pairs of the elements.

Is this possible?  If so, can you suggest an algorithm for this?
Here is an algorithm:
Choose a number from the sequence with probabilities proportional to their values, remove it and push_front it to the output sequence. Repeat the steps.

With your 1 2 3 example, consider the probability that 1 comes earlier than 3 ( so 1 is removed later than 3 in the input sequence ). Obviously the time 2 is removed is not relevant. So the probability is 1/(1+3)=1/4.

The algorithm can be implemented in time O(NlogN)