x f 0 0 1 1 2 1 3 0 4 1 5 0 6 0 7 1 f is balanced 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 -0.25 0.25 -0.25 0.25 0.25 -0.25 -0.25 0.25 0.25 -0.25 0.25 -0.25 -0.25 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 p0 = 0, 1-p0 = 1, f is balanced