binomialrvls
Class normalApprox
- public class normalApprox
- extends normDist
initialize
public void initialize(int _numTicks,
double _LL,
double _UL,
double _mean,
double _sd,
double _LC,
double _UC,
boolean _between,
String _title,
Color _fillColor)
- call super's initialize, plus set up a basic binomial distribution fitting for p=.5,n=8,LP=0,HP=8;
setParams
public void setParams(double _p,
int _N)
- setParams sets up mean, standard deviation, binomial probability array, and integer low bound, upper bound for the binomial distribution
paint
public void paint(Graphics g)
- In addition to paint the normal distribution, paint the discrete probablity of binomial distribution b(n,p) for each integer within the upper and lower limit range.
b
public double b(double p,
int n,
int x)
- calculate the probability of x out of n is true for binomial(n,p) distribution
nper
public double nper(int n,
int x)
- calculate choosing x from n = n!/x!(n-x)!
B
public double B(int x1,
int x2,
double p,
int n)
- cumulative binomial probability from x1 is true to x2 is true
B
public double B(int x1,
int x2)
- cumulative binomial probability from x1 to x2, if n is predefined