You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Measures-of-disorder.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ Measures of disorder are pretty formalized, so the names of the functions in the
144
144
Computes the number of elements in a sequence that aren't followed by the same element in the sorted sequence.
145
145
146
146
Our implementation is slightly different from the original description in *Sublinear merging and natural mergesort* by S. Carlsson, C. Levcopoulos and O. Petersson:
147
-
* It doesn't add 1 to the general result, thus returning 0 when $X$ is sorted - therefore respecting the Mannila definition of a MOP.
147
+
* It doesn't add 1 to the general result, thus returning 0 when $X$ is sorted and respecting Mannila's first criterion for what makes a measure of presortedness (though this change might be responsible for the breakage of criterion 4).
148
148
* It explicitly handles *equivalent elements*, while the original formal definition makes it difficult.
149
149
150
150
| Complexity | Memory | Iterators |
@@ -153,6 +153,8 @@ Our implementation is slightly different from the original description in *Subli
153
153
154
154
`max_for_size`: $|X| - 1$ when $X$ is sorted in reverse order.
155
155
156
+
**Note:**`probe::block` does not respect Mannila's criterion 4: $Block(\langle 1, 0 \rangle) = 1$ and $Block(\langle 2, 3 \rangle) = 0$, but $Block(\langle 1, 0, 2, 3 \rangle) = 2$.
157
+
156
158
### *Dis*
157
159
158
160
```cpp
@@ -285,6 +287,8 @@ The measure of disorder is slightly different from its original description in [
285
287
286
288
`max_for_size`: $\frac{|X| + 1}{2} - 1$ when $X$ is a sequence of elements that are alternatively greater then lesser than their previous neighbour.
@@ -299,7 +303,9 @@ Computes the *Oscillation* measure described by C. Levcopoulos and O. Petersson
299
303
300
304
`max_for_size`: $\frac{|X|(|X| - 2) - 1}{2}$ when the values in $X$ are strongly oscillating.
301
305
302
-
**Note:***Osc* does not respect Mannila's criterion 5: $Osc(\langle 2, 4, 1, 3, 1, 3 \rangle) \not \le |\langle 4, 1, 3, 1, 3 \rangle| + Osc(\langle 4, 1, 3, 1, 3 \rangle)$, though it is possible that it only happens when equivalent elements are involved.
306
+
**Note:***Osc* does not respect Mannila's criterion 4: $Osc(\langle 0 \rangle) = 0$ and $Osc(\langle 3, 2, 1 \rangle) = 0$, but $Osc(\langle 0, 3, 2, 1 \rangle) = 2$.
307
+
308
+
**Note²:***Osc* does not respect Mannila's criterion 5: $Osc(\langle 2, 4, 1, 3, 1, 3 \rangle) \not \le |\langle 4, 1, 3, 1, 3 \rangle| + Osc(\langle 4, 1, 3, 1, 3 \rangle)$, though it is possible that it only happens when equivalent elements are involved.
0 commit comments