0. {w,  x,  y, z}[]1. {w, x, y, [z}] (growing array)1. {w,  x,  z, [y}] (swapping z<->y)<->1. {w,  x,  z}, [y] (shrinking set)

Similarly, for the next round, we choose to swap w with z as follows:

1. {w,  x,  z}, [y]2. {w, x,  [z}, y] (grow array)2. {x,  z, [w}, y]  (swap w <-> x)<->2. {x, z}, [w, y] (shrinking set)

For the next round, we swap z with z (ie, no change!)

2. {x,  z}, [w, y]3. {x, [z}, w, y] (grow array)3. {x, [z}, w, y] (swap z<->z)<->3. {x},[z, w, y] (shrink set)

Finally, we swap x with x:

3. {x},  [z, w, y]4. {[x}, z, w, y] (grow array)3. {x}, [z, w, y] (swap x<->x)<->3. {}[x, z, w, y] (shrink set)
@compositedef permutation(draw, n):    # raw random    # Fishes Yates: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle    xs = { i : xs[i] for i in range(n) }    i = n-1 # from (n-1), down to zero.    while i >= 0:        r = draw(integers(0, i)) # r ∈ [0, i]        temp = xs[i]; xs[i] = xs[r]; xs[r] = temp; # swap        i -= 1    return xs