== 1. known values of D_1 (Trutschnig 2011: D_1(C,Pi) <= 1/3, = 1/3 iff C completely dependent)
OK   D_1(Pi, M) = 1/3  [got 1/3]
OK   D_1(Pi, W) = 1/3  [got 1/3]
OK   D_1(M, W) = 1/2  [got 1/2]
OK   D_1(Pi, random straight shuffle #0) = 1/3  [got 1/3]
OK   D_1(Pi, random straight shuffle #1) = 1/3  [got 1/3]
OK   D_1(Pi, random straight shuffle #2) = 1/3  [got 1/3]
OK   D_1(Pi, random straight shuffle #3) = 1/3  [got 1/3]
OK   D_1(Pi, random straight shuffle #4) = 1/3  [got 1/3]
== 2. A = Pi: B_N, exact D_1(Pi,B_N) and inner integral
OK   N= 1: margins uniform, D_1(Pi,B_N) = 1/3 (expected 1/(3N) = 1/3), inner formula ok=True
OK   N= 2: margins uniform, D_1(Pi,B_N) = 1/6 (expected 1/(3N) = 1/6), inner formula ok=True
OK   N= 3: margins uniform, D_1(Pi,B_N) = 1/9 (expected 1/(3N) = 1/9), inner formula ok=True
OK   N= 4: margins uniform, D_1(Pi,B_N) = 1/12 (expected 1/(3N) = 1/12), inner formula ok=True
OK   N= 5: margins uniform, D_1(Pi,B_N) = 1/15 (expected 1/(3N) = 1/15), inner formula ok=True
OK   N= 6: margins uniform, D_1(Pi,B_N) = 1/18 (expected 1/(3N) = 1/18), inner formula ok=True
OK   N= 7: margins uniform, D_1(Pi,B_N) = 1/21 (expected 1/(3N) = 1/21), inner formula ok=True
OK   N= 8: margins uniform, D_1(Pi,B_N) = 1/24 (expected 1/(3N) = 1/24), inner formula ok=True
OK   N= 9: margins uniform, D_1(Pi,B_N) = 1/27 (expected 1/(3N) = 1/27), inner formula ok=True
OK   N=10: margins uniform, D_1(Pi,B_N) = 1/30 (expected 1/(3N) = 1/30), inner formula ok=True
OK   N=11: margins uniform, D_1(Pi,B_N) = 1/33 (expected 1/(3N) = 1/33), inner formula ok=True
OK   N=12: margins uniform, D_1(Pi,B_N) = 1/36 (expected 1/(3N) = 1/36), inner formula ok=True
OK   N=2: B_N(Pi) equals the uniform mixture of the N circular shifts (cdf on a grid, D_1 = 0)
OK   N=3: B_N(Pi) equals the uniform mixture of the N circular shifts (cdf on a grid, D_1 = 0)
OK   N=5: B_N(Pi) equals the uniform mixture of the N circular shifts (cdf on a grid, D_1 = 0)
== 3. random checkerboard A on an M-grid with M | N: expect ||H_A - P_N H_A||_1 = 0 and D_1(A,B_N) = 1/(3N)
OK   M=2 N= 4: D_1(A,B_N) = 1/12, ||H_A - P_N H_A||_1 = 0
OK   M=4 N=12: D_1(A,B_N) = 1/36, ||H_A - P_N H_A||_1 = 0
OK   M=4 N=12: D_1(A,B_N) = 1/36, ||H_A - P_N H_A||_1 = 0
OK   M=4 N= 4: D_1(A,B_N) = 1/12, ||H_A - P_N H_A||_1 = 0
OK   M=4 N= 4: D_1(A,B_N) = 1/12, ||H_A - P_N H_A||_1 = 0
OK   M=4 N=12: D_1(A,B_N) = 1/36, ||H_A - P_N H_A||_1 = 0
OK   M=2 N= 4: D_1(A,B_N) = 1/12, ||H_A - P_N H_A||_1 = 0
OK   M=3 N= 6: D_1(A,B_N) = 1/18, ||H_A - P_N H_A||_1 = 0
== 4. Lemma 3.3(c) bound, exact, A not adapted to the N-grid
OK   checkerboard M=5               N=3: D_1(A,B_N)=0.284822  bound=0.576000  ratio=0.4945
OK   shuffle n=5                    N=2: D_1(A,B_N)=0.320000  bound=0.722667  ratio=0.4428
OK   (M+Pi)/2                       N=5: D_1(A,B_N)=0.033333  bound=0.233333  ratio=0.1429
OK   mixture shuffle/checkerboard   N=4: D_1(A,B_N)=0.110163  bound=0.320193  ratio=0.3441
OK   checkerboard M=3               N=3: D_1(A,B_N)=0.111111  bound=0.333333  ratio=0.3333
OK   shuffle n=6                    N=3: D_1(A,B_N)=0.284722  bound=0.611111  ratio=0.4659
OK   (M+Pi)/2                       N=5: D_1(A,B_N)=0.033333  bound=0.233333  ratio=0.1429
OK   mixture shuffle/checkerboard   N=3: D_1(A,B_N)=0.158238  bound=0.461477  ratio=0.3429
OK   checkerboard M=3               N=6: D_1(A,B_N)=0.055556  bound=0.166667  ratio=0.3333
OK   shuffle n=7                    N=7: D_1(A,B_N)=0.051020  bound=0.190476  ratio=0.2679
OK   (M+Pi)/2                       N=4: D_1(A,B_N)=0.041667  bound=0.291667  ratio=0.1429
OK   mixture shuffle/checkerboard   N=3: D_1(A,B_N)=0.084491  bound=0.370370  ratio=0.2281
OK   checkerboard M=3               N=2: D_1(A,B_N)=0.174383  bound=0.611111  ratio=0.2854
OK   shuffle n=6                    N=6: D_1(A,B_N)=0.041667  bound=0.222222  ratio=0.1875
OK   (M+Pi)/2                       N=5: D_1(A,B_N)=0.033333  bound=0.233333  ratio=0.1429
OK   mixture shuffle/checkerboard   N=4: D_1(A,B_N)=0.117004  bound=0.308417  ratio=0.3794
OK   checkerboard M=3               N=4: D_1(A,B_N)=0.146262  bound=0.324074  ratio=0.4513
OK   shuffle n=2                    N=6: D_1(A,B_N)=0.041667  bound=0.222222  ratio=0.1875
OK   (M+Pi)/2                       N=3: D_1(A,B_N)=0.055556  bound=0.388889  ratio=0.1429
OK   mixture shuffle/checkerboard   N=3: D_1(A,B_N)=0.186490  bound=0.461529  ratio=0.4041
OK   checkerboard M=3               N=5: D_1(A,B_N)=0.113235  bound=0.269565  ratio=0.4201
OK   shuffle n=4                    N=3: D_1(A,B_N)=0.228299  bound=0.541667  ratio=0.4215
OK   (M+Pi)/2                       N=5: D_1(A,B_N)=0.033333  bound=0.233333  ratio=0.1429
OK   mixture shuffle/checkerboard   N=7: D_1(A,B_N)=0.071070  bound=0.180687  ratio=0.3933
   largest ratio D_1/bound in section 4: 0.494482
== 5. A = (M+Pi)/2: exact D_1(A,B_N), exact ||H_A-P_N H_A||_1 (expected 1/(6N) by hand)
OK   N= 1: D_1 = 1/6 = 0.16666667, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/6, bound = 1.166667
OK   N= 2: D_1 = 1/12 = 0.08333333, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/12, bound = 0.583333
OK   N= 3: D_1 = 1/18 = 0.05555556, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/18, bound = 0.388889
OK   N= 4: D_1 = 1/24 = 0.04166667, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/24, bound = 0.291667
OK   N= 8: D_1 = 1/48 = 0.02083333, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/48, bound = 0.145833
OK   N=16: D_1 = 1/96 = 0.01041667, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/96, bound = 0.072917
OK   N=32: D_1 = 1/192 = 0.00520833, N*D_1 = 0.166667, ||H_A-P_N H_A|| = 1/192, bound = 0.036458
== failures: 0   (time 1.2 s)
