15-May-2025 18:38:35 permutation_distance_test(): MATLAB/Octave version 6.4.0 Test permutation_distance() Graphics saved as "permutation_distance_histogram.png" permutation_distance_stats_test(): Test permutation_distance_stats(). Using N = 1000 sample permutations. Permutation order is M Compute mean and variance of Ulam permutation distance. M Mean Predicted Variance 1 0 -1 0 2 0.522 -0.0330087 0.249766 3 1.008 0.0159841 0.348284 4 1.575 0.0849801 0.420796 5 2.241 0.234994 0.509428 6 2.879 0.272523 0.56092 7 3.496 0.235519 0.626611 8 4.232 0.346365 0.706883 9 4.961 0.41566 0.748227 10 5.586 0.312944 0.825429 11 6.391 0.447085 0.868988 12 7.152 0.500645 0.851748 13 7.858 0.464425 0.938775 14 8.686 0.580404 0.932336 15 9.401 0.53321 1.01922 16 10.189 0.573043 1.15443 17 10.991 0.621535 1.15608 18 11.725 0.573357 1.14452 19 12.552 0.63776 1.14644 20 13.352 0.660078 1.12322 21 14.252 0.802364 1.24574 22 15.052 0.811381 1.23453 23 15.823 0.778627 1.331 24 16.575 0.717481 1.41179 25 17.453 0.808358 1.39719 26 18.279 0.829789 1.40657 27 19.191 0.952507 1.41994 28 19.949 0.881861 1.42983 29 20.717 0.820186 1.35827 30 21.519 0.796715 1.48913 31 22.384 0.846346 1.41396 32 23.202 0.835691 1.61481 33 23.993 0.78953 1.66862 34 24.899 0.87878 1.65045 35 25.83 0.994645 1.61872 36 26.63 0.950853 1.67077 37 27.474 0.957129 1.679 38 28.338 0.98469 1.73749 39 29.201 1.00859 1.63824 40 30.04 1.00175 1.73013 Graphics saved as "permutation_distance_stats.png" permutation_distance_ulam(): permutation_distance_ulam() computes the Ulam metric distance between two permutations of (1,...,N). Permutation P1 1 2 3 4 5 6 7 8 9 10 1 2 5 6 7 10 3 8 4 9 Permutation P2 1 2 3 4 5 6 7 8 9 10 7 10 5 9 1 3 4 2 8 6 Permutation P3 1 2 3 4 5 6 7 8 9 10 5 2 10 3 4 6 8 1 7 9 K(P1,P1) should be 0. K(P1,P1) = 0 K(P1,P2) should equal K(P2,P1). K(P1,P2) = 6 K(P2,P1) = 6 K(P1,P3) <= K(P1,P2) + K(P2,P3). K(P1,P3) = 5 K(P1,P2) = 6 K(P2,P3) = 6 K(P1,P2) + K(P2,P3) = 12 permutation_distance_test(): Normal end of execution. 15-May-2025 18:39:20