Re: Plot a simple function
- To: mathgroup at smc.vnet.net
- Subject: [mg74895] Re: [mg74845] Plot a simple function
- From: Jmbatista at aol.com
- Date: Tue, 10 Apr 2007 05:18:58 -0400 (EDT)
Paul, the binary entropy function is defined as h(x) = -p log(p) - (1 - p)
log(1 - p). The log in this formula is binary logarithm. Given that h(0) =
h(1) = 0, you can then execute the following commands to plot the graph you are
looking for:
h[x_] := - x * Log[2,x] - (1 - x) * Log[2,1 - x]
Plot[h[x], {x,0,1}]
Hope this helps.
J. Batista
_______________
In a message dated 4/8/2007 5:31:59 AM Eastern Daylight Time,
jorgecordero at gmail.com writes:
Hi, a simple query. Do you know how could I plot the entropy function
in Mathematica? I wish to produce an image similar to this one:
http://upload.wikimedia.org/wikipedia/commons/c/c9/Binary_entropy_plot.png
Do you know how could I plot mutual information between two random
variables X and Y in a 3D surface in Mathematica?
Thanks!
Paul.