Mathoverflow multinomial identity

R3 probability simplex -> R2 map

A=Sqrt[2/3]{Cos[#],Sin[#],Sqrt[1/2]}&/@Table[Pi/2+2Pi/3+2k Pi/3,{k,0,2}]//Transpose;
B=Inverse[A];
(* map 3d probability vector into 2 vector *)
p2r[{x_,y_,z_}]:=Most[A.{x,y,z}];
(* map 2-vector in 3d probability vector *)
r2p[{u_,v_}]:=B.{u,v,Sqrt[1/3]};

(* Bounds to center the simplex *)
{p1,p2,p3}=Transpose[A];
e=1/20;
x1=First[p1]-e/2;
x2=First[p2]+e/2;
w=x2-x1;
h=p3[[2]]-p2[[2]];
marg=(w-h+e)/2;
y1=p2[[2]]-marg;
y2=p3[[2]]+marg;


(* reject <0 and >1 values in probability distributions *)
valid[x_,y_]:=Min[r2p[{x,y}]]≥0&&Max[r2p[{x,y}]]≤1;

RegionPlot[valid[x,y],{x,x1,x2},{y,y1,y2},PlotLabel->"Probability Simplex"]

Checking the bound

getit[n_,k_,c_]:=Module[{},
all=Select[Tuples[Range[0,n],k],Total[#]==n&];
e=Select[all,Total[Most[#]]≤c&];
hterm[x_]:=If[x≤0||x≥1,0,x Log[x]];
H[event_]:=-Total[hterm/@(event/n)];
exact=Total[Multinomial@@#&/@e];
upper=Exp[n Max[H/@e]];
exact<upper
];
getit[10,3,5]

Visualize Coefficients and accepted set

p1=ListPlot[tosimplex/@all,PlotRange->10{{ x1, x2},{y1,y2}},AspectRatio->1,PlotStyle->PointSize[Large],Axes->None];
p2=RegionPlot[Min[r2p[{x/10,y/10}]]>0&&Total[Most[r2p[{x/10,y/10}]]]<1/2,{x,10x1,10x2},{y,10y1,10y2},Frame->False,BoundaryStyle->Blue];
Show[p2,p1]

Visualize set where p1 Log q1 + ... > q1 Log q1 + ...

(* Entropy and cross entropy *)
H[q_]:=Total[Map[# Log[#]&,q]];
H[p_,q_]:=Total[MapThread[#1 Log[#2]&,{p,q}]];

q=RandomReal[{0,1},3]//Normalize[#,Total]&;
plot1=RegionPlot[valid[x,y],{x,x1,x2},{y,y1,y2},PlotStyle->None];
plot2=RegionPlot[valid[x,y]&&H[r2p[{x,y}],q]>H[q],{x,x1,x2},{y,y1,y2},PlotPoints->100];
Show[plot1,plot2,Graphics[Disk[p2r[q],.03]],Frame->None]