Post Reply 
Solve question
03-06-2016, 05:32 PM
Post: #1
Solve question
How does one use solve with inverse binomial or Poisson? If we had p=.01, area under curve=.5, wanted to solve for number of trials in order to satisfy this condition, what is the syntax?

For binomial, if we want number of trials to have p=.5+ of obtaining 2 successes where each trial had p=.01 of success, correct answer is ~168 trials. How do I use solve to obtain this?
Find all posts by this user
Quote this message in a reply
03-06-2016, 06:37 PM
Post: #2
RE: Solve question
I believe you can do a dichotomy. Here is an Xcas program to do that, the translation to the HP Prime is left as an exercice to the reader:
Code:

g(f):={
local n,a,b,c;
n:=1; 
while 1 do if f(n)<0.5 then break; else n:=n*2; end; end; 
a:=n/2; b:=n; 
while b-a>1 do c:=iquo(a+b,2); if f(c)>0.5 then a:=c; else b:=c; end; end;
return b;
}:;
g(k->binomial_cdf(k,0.01,1));
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)