I already plot the image of the function S:
(* structural entropy for N=3 *)
S[p1_, p2_] := (
S1 = -(p1*Log[p1] + p2*Log[p2] + (1 - p1 - p2) Log[(1 - p1 - p2)]);
S2 = 1 - (p1^2 + p2^2 + (1 - p1 - p2)^2);
Sstr = S1 - S2
)
Plot3D[S[p1, p2], {p1, 0, 1}, {p2, 0, 1}]
I use the code
MaxValue[{S[p1, p2], 0 <= p1 <= 1, 0 <= p2 <= 1}, {p1, p2}]
but I can't get the maximum value. The output can give the answer.