|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uah.math.distributions.Distribution edu.uah.math.distributions.BirthdayDistribution
public class BirthdayDistribution
This class models the distribution of the number of distinct sample values when a sample of a specified size is chosen with replacement from a finite population of a specified size.
Field Summary |
---|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
BirthdayDistribution()
This default constructor creates a new birthday distribution with population size 365 (the classical birthday problem) and sample size 20. |
|
BirthdayDistribution(int n,
int k)
This general constructor creates a new birthday distribution with a specified population size and sample size. |
Method Summary | |
---|---|
double |
getDensity(double x)
This method computes the probability density function. |
double |
getMean()
This method computes the mean of the distribution in terms of the parameters. |
int |
getPopulationSize()
This method returns the population size. |
int |
getSampleSize()
This method returns the sample size. |
double |
getVariance()
This method computes the variance of the distribution in terms of the parameters. |
void |
setParameters(int n,
int k)
This method sets the parameters: the population size and the sample size. |
void |
setPopulationSize(int n)
This method sets the population size. |
void |
setSampleSize(int k)
This method sets the sample size. |
double |
simulate()
This method simulates a value from the distribution. |
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of the parameters. |
Methods inherited from class edu.uah.math.distributions.Distribution |
---|
getCDF, getDomain, getFailureRate, getMaxDensity, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BirthdayDistribution(int n, int k)
n
- the population sizek
- the sample sizepublic BirthdayDistribution()
Method Detail |
---|
public void setParameters(int n, int k)
n
- the population sizek
- the sample sizepublic double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distribuiton
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public int getPopulationSize()
public void setPopulationSize(int n)
n
- the population sizepublic int getSampleSize()
public void setSampleSize(int k)
k
- the sample sizepublic double simulate()
simulate
in class Distribution
public java.lang.String toString()
toString
in class Distribution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |