Re: Plot a simple function
- To: mathgroup at smc.vnet.net
- Subject: [mg74898] Re: Plot a simple function
- From: Roger Bagula <rlbagula at sbcglobal.net>
- Date: Tue, 10 Apr 2007 05:20:31 -0400 (EDT)
Bob Hanlon wrote:
>H[p_] := -p*Log[2, p] -(1-p)*Log[2, 1-p] /; 0 <= p <= 1;
>
>Plot[H[p],{p,0,1},
> PlotStyle->{AbsoluteThickness[3],Blue},
> Frame->True,
> FrameTicks->{Range[0,1,0.5],Range[0,1,0.5],None,None},
> FrameStyle->White,
> FrameLabel->{"Pr(X = 1)","H(X)"},
> AspectRatio->1,
> TextStyle->{FontSize->18},
> GridLines->Table[Table[
> {x,{AbsoluteThickness[2],GrayLevel[0.9]}},
> {x,0,1,0.1}],{2}],
> Prolog->{Black,
> AbsoluteThickness[2],
> Line[{{0,1.05},{0,0},{1.05,0} }]}];
>
>
>Bob Hanlon
>
>
>
>
>>
>>
>>
>
>
>
>
Bob Hanlon,
You are on top of things as usual, but the question wanted a 3d approach!
Well it appears there is a third method and it isn't the same either!
I had forgotten about the Log two entropy approach!
I got a sign wrong in my approach, too.
But a very nice Zeta[2] like constant.
Can you solve the logistic to Log two as a power or as a linear factor?
H[p_] := -p*Log[2, p] -(1-p)*Log[2, 1-p] /; 0 <= p <= 1;
x0 = t;
y0 = p;
z0 = H[t]*H[p];
ParametricPlot3D[{x0, y0, z0}, {t, 0, 1}, {p, 0, 1}]
Solve:
p[t_] := h /. Solve[H[t] - y[t]^h == 0, h]
g3= Plot[p[x], {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}]
pp[t_] = Log[ -t*Log[2, t] - (1 - t)*Log[2, 1 - t]]/(Log[4] + Log[(1 -
t) t])
g4 = Plot[p[x], {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}]
Limit[pp[t], t -> 1/2]
1/Log[4]
N[%]
0.7213475204444817
Roger Bagula