I have the following equation that I am solving with NSolve, but Mathematica is giving unusual results when I use the Reals option with the function.
Here is the equation:
Pr[n_, c_, p_] := CDF[BinomialDistribution[n, p], c]
Here is the result (sans Reals) containing real and imaginary solutions:
In[31]:= AQL=NSolve[Pr[52,0,p]==0.05 ,p]
Out[31]= {{p->0. -0.703608 I},{p->0. +0.707855 I},{p->0.0559822},{p->0.0628651 +0.113789 I},{p->0.0628651 -0.113789 I},{p->0.0834136 -0.225918 I},{p->0.0834136 +0.225918 I},{p->0.117328 -0.334753 I},{p->0.117328 +0.334753 I},{p->0.164114 -0.438707 I},{p->0.164114 +0.438707 I},{p->0.223089 -0.536263 I},{p->0.22309 +0.536263 I},{p->0.29335 -0.626051 I},{p->0.293392 +0.626008 I},{p->0.468801},{p->0.475677},{p->0.492169},{p->0.495198},{p->0.543052},{p->0.556686},{p->0.55761},{p->0.612101},{p->0.617682},{p->0.663548},{p->0.704702},{p->0.746556},{p->0.761696},{p->0.811269},{p->0.828215},{p->0.856825},{p->0.864034},{p->0.887535},{p->0.909784},{p->1.01007},{p->1.0245},{p->1.05859},{p->1.15054},{p->1.25355},{p->1.40169},{p->1.47447},{p->1.5849},{p->1.84392},{p->1.93027},{p->2.3004},{p->2.30967},{p->2.36224},{p->2.3929},{p->2.69307},{p->2.73103},{p->2.82902},{p->2.87612}}
Now, when Reals is added to the function, I get this result:
In[32]:= AQL=NSolve[Pr[52,0,p]==0.05 ,p,Reals]
Out[32]= {{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.},{p->1.}}
Is it possible that I am missing a numerical precision argument somewhere? If it is of any value to this discussion, the result that I need to extract is the first real solution, or p->0.0559822
.