The following questions gave me food for thought:
- Efficient way to shuffle objects
- I'd like to write an "ultimate shuffle" algorithm to sort my mp3 collection
When you sort a list - you always have a base-line(numbers, alphabet, ...) which tell you how to order the list.
Question: When you shuffle a set - how would you measure "degree of order"?
For example: 9 8 7 6 5 4 3 2 1 is ordered, even if completely differently than 1 2 3 4 5 6 7 8 9. And 9 8 7 6 1 2 3 4 5 also has some order (if you look at it in chunks: 9 8 7 6 and 1 2 3 4 5). Another example could be 9 2 3 4 5 6 7 8 1. How can you determine if one listing is less or more ordered than another.
Note: since there has been some confusion about the goal of this question - I would like to specify, that I'm not looking for a method to measure randomness. 1234 is just a random set of 4 digits as 4213, but it seems to me that 1234 is more ordered than 4213. The comment about "Kolmogorov complexity" by user61852, or the answer by Mathew Foscarini which mentions measuring the deviation between neighboring numbers in a sequence, are the types of answers I am looking for. I'm not sure if the measure entropy approach in the comment by MichaelT helps identify order in a list - if the comments could be elaborated into answers that would be great.