MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot a simple function


 
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.







  • Prev by Date: Re: reliability function drawing
  • Next by Date: Re: Simplification with Integers assumption
  • Previous by thread: Re: Plot a simple function
  • Next by thread: Re: Plot a simple function