I have my own definition of "sortedness" of a sequence.
Given any sequence [a,b,c,…] we compare it with the sorted sequence containing the same elements, count number of matches and divide it by the number of elements in the sequence.
For example, given sequence [5,1,2,3,4]
we proceed as follows:
1) sort the sequence: [1,2,3,4,5]
2) compare the sorted sequence with the original by moving it one position at a time and
counting the maximal number of matches:
[5,1,2,3,4]
[1,2,3,4,5] one match
[5,1,2,3,4]
[1,2,3,4,5] no matches
[5,1,2,3,4]
[1,2,3,4,5] no matches
[5,1,2,3,4]
[1,2,3,4,5] no matches
[5,1,2,3,4]
[1,2,3,4,5] no matches
[5,1,2,3,4]
[1,2,3,4,5] 4 matches
[5,1,2,3,4]
[1,2,3,4,5] no matches
...
[5,1,2,3,4]
[1,2,3,4,5] no matches
3) The maximal number of matches is 4, we can calculate the "sortedness" as 4/5 = 0.8.
Sortedness of a sorted sequence would be 1, and sortedness of a sequence with elements placed in reversed order would be 1/n.
The idea behind this definition is to estimate the minimal amount of work we would need to do to convert any sequence to the sorted sequence. In the example above we need to move just one element, the 5 (there are many ways, but moving 5 is the most efficient). When the elements would be placed in reversed order, we would need to move 4 elements. And when the sequence were sorted, no work is needed.
I hope my definition makes sense.