How do I solve the following equation for $n$ using Maple: $$2\Phi\left(\frac{0.01}{\sqrt{\frac{\pi^{5}-2\pi^{4}}{2\pi^{2}n}}}\right)-1=0.95,$$ where $\Phi(x)$ denotes the cdf of a standard normal distribution.
Thanks in advance
How do I solve the following equation for $n$ using Maple: $$2\Phi\left(\frac{0.01}{\sqrt{\frac{\pi^{5}-2\pi^{4}}{2\pi^{2}n}}}\right)-1=0.95,$$ where $\Phi(x)$ denotes the cdf of a standard normal distribution.
Thanks in advance
On
I don't have a working Maple at home, so based on Distributions:Normal and solve, try
with(Statistics)
solve( 2 * PDF( RandomVariable(Normal(0,1)), 0.01/sqrt((Pi^5 - 2 Pi^4)/(2*Pi^2 * n)) ) - 1 = 0.95, n)
Now maybe Maple's solve doesn't know how or recognize that it can apply the inverse CDF, norminv, so we have to do that manually...
with(Statistics)
first = solve( 2*phi - 1 = 0.95, phi)
solve( 0.01/sqrt((Pi^5 - 2 Pi^4)/(2*Pi^2 * n)) = norminv(first), n)
Again, I don't have Maple handy, so these may require a few rounds of tweaking to get right, so feel free to comment with progress or results.
In Maple the inverse of the CDF is implemented as the
Quantilecommand from theStatisticspackage. For example,If you prefer you can skip several easy steps and directly write down the reformulated equation,
Or it can all be done starting from the originally supplied equation, with no mental rearrangement of the equations required.
I'll break down some of those steps, for explanation.
I'll start with the
eqas given.The only function call to
Phi, ineq,Isolating
eqfor that call toPhiApplying the inverse of
Phito both side of that new equation.The same as previous, but following up by replacing the generic inverse
Phicall with a call toQuantile(using R.V.X).Solving that, numerically,
or, if preferred,