Mon Sep 19 08:49:14 2022 permutation_distance_test(): Python version: 3.6.9 Test permutation_distance() Graphics saved as "permutation_distance_histogram.png" permutation_distance_stats_test(): Test permutation_distance_stats(). Using N = 10000 sample permutations. Permutation order is M Compute mean and variance of Ulam permutation distance. M Mean Predicted Variance 1 0 -1 0 2 0.4943 -0.0995706 0.249968 3 1.0053 0.010593 0.328672 4 1.5694 0.0749139 0.413984 5 2.217 0.194919 0.489911 6 2.8502 0.226707 0.57176 7 3.5365 0.297617 0.622868 8 4.2425 0.361966 0.686694 9 4.9298 0.370431 0.748872 10 5.6627 0.421986 0.791529 11 6.406 0.468015 0.846164 12 7.1597 0.511223 0.879396 13 7.9172 0.544704 0.944944 14 8.6581 0.54303 0.993004 15 9.4355 0.578952 1.03084 16 10.2369 0.635931 1.04238 17 11.0043 0.638846 1.11288 18 11.7918 0.659638 1.15365 19 12.5926 0.689811 1.15383 20 13.379 0.694463 1.19056 21 14.2027 0.739994 1.22561 22 14.9829 0.72445 1.25901 23 15.8081 0.75998 1.29247 24 16.6227 0.776889 1.32714 25 17.4291 0.778735 1.36297 26 18.2637 0.81091 1.39236 27 19.0962 0.83604 1.40795 28 19.9367 0.866806 1.46749 29 20.7325 0.839091 1.49814 30 21.6011 0.896497 1.49378 31 22.4211 0.891285 1.48917 32 23.2771 0.926369 1.52412 33 24.0863 0.901859 1.56605 34 24.9321 0.918511 1.60969 35 25.7968 0.95491 1.59651 36 26.6614 0.988336 1.66375 37 27.4832 0.968084 1.67872 38 28.3419 0.989322 1.713 39 29.2147 1.02482 1.6986 40 30.0682 1.0351 1.74455 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 0 1 2 3 4 5 6 7 8 9 5 6 0 7 2 4 9 8 3 1 Permutation P2 0 1 2 3 4 5 6 7 8 9 2 9 5 7 0 1 6 3 4 8 Permutation P3 0 1 2 3 4 5 6 7 8 9 8 3 0 6 1 2 9 4 5 7 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) = 7 K(P1,P2) = 6 K(P2,P3) = 6 K(P1,P2) + K(P2,P3) = 12 permutation_distance_test(): Normal end of execution. Mon Sep 19 08:50:31 2022