1
$\begingroup$

This is my function.

`g[p_, q_, c_] := 
 2^(-p*Log2[p] - 
     q*Log2[q] - (1 - p)*Log2[1 - p] - (1 - q)*
      Log2[1 - q])*(c^(p*q + (1 - p)*(1 - q)))*(1 - c)^(1 - 
     p*q - (1 - p)*(1 - q))`

I have graphed this function taking g as a function of p and q, I am varying c as a constant.

`flo=Manipulate[Plot3D[{g[p, q, c]}, {p, 0, 1}, {q, 0, 1}], {c, 0.001, 1}]`

enter image description here

How can I get values of p, q and c so that g[p,q,c]<1?

$\endgroup$
1
$\begingroup$

Plot your function for given value c=.5(for example) with the option RegionFunction

 pic = Plot3D[  g[p, q, .5]  , {p, 0, 1}, {q, 0, 1}, RegionFunction -> Function[{p, q, z}, z <= 1]]

enter image description here

With

points=pic[[1, 1]][[1]]
(*{{7.14286*10^-8, 7.14286*10^-8, 0.500001}, {0.0714286, 7.14286*10^-8,0.64673}, 
{0.142857, 7.14286*10^-8, 0.753498}, {0.214286,7.14286*10^-8, 0.840662},...}*)
points = pic[[1, 1]][[1]];
Graphics3D[{Point[points]}]

enter image description here

you get all the plotted points in pic!

| improve this answer | |
$\endgroup$
  • $\begingroup$ Which version of mathematica do you use? The second part, that is the part beginning from points isnt working for me. I use 10.3. This is amazing though. I want the numerical values of these points too. What can I do further? $\endgroup$ – newgirl May 26 at 11:13
  • $\begingroup$ When I do this - points = pic[[1, 1]][[1]] ,I get just a single point. {7.14286*10^-8, 7.14286*10^-8, 0.500001} $\endgroup$ – newgirl May 26 at 11:24
  • $\begingroup$ Try ??pic to Analyse the graphic. My version is v12 $\endgroup$ – Ulrich Neumann May 26 at 11:50
  • $\begingroup$ I get a list of numbers. I do think part of it is the values of p, q and c. Is there any way I can get the range for p and q for a given c, such that g is lesser than 1? $\endgroup$ – newgirl May 26 at 12:01
  • $\begingroup$ Probably points=pic[[1, 1]] gives you the values {p,q} . ListPlot[ points[[All,{1,2}]]] shows the range. $\endgroup$ – Ulrich Neumann May 26 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.