Sorry, my mistake: pj are effectively different. But kj and zj are not.
With j=2, sum(x.*(m-x)) yields two identical values. As observers can choose only between category 1 or category 2, n votes for cat 1 induce m-n votes for cat 2.
Parameter b=pj.*(1-pj) yields also 2 identical values with j=2.