public class MatchDistribution extends Distribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
MatchDistribution()
This default constructor creates a new mathcing distribuiton with
parameter 5.
|
MatchDistribution(int n)
This general constructor creates a new matching distribution with a
specified parameter.
|
Modifier and Type | Method and Description |
---|---|
double |
getDensity(double x)
This method computes the probability density function.
|
double |
getMaxDensity()
This method gives the maximum value of the probability density function.
|
double |
getMean()
This method returns the mean, which is 1, regardless of the parameter
value.
|
int |
getParameter()
This method gets the parameter.
|
double |
getVariance()
This method returns the variance, which is 1 regardless of the parameter
value.
|
void |
setParameter(int n)
This method sets the parameter of the distribution.
|
double |
simulate()
This method simulates a value from the distribution, by generating
a random permutation and computing the number of matches.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getCDF, getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain
public MatchDistribution(int n)
n
- the number of elementspublic MatchDistribution()
public void setParameter(int n)
n
- the size of the random permutationpublic double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain {0, 1, 2, ...}public double getMaxDensity()
getMaxDensity
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public int getParameter()
public double simulate()
simulate
in class Distribution
public java.lang.String toString()
toString
in class Distribution