Compute the classical matching probability mass function.
The classical matching distribution has the following
probability mass function:
with k a non-negative integer denoting the number of
Given k items numbered 1, 2, ..., k that are
arranged in a random order, the classical matching distribution
is the distribution of the number of items were the original
numbering and the random ordering are the same.
Feller (see References below) formulates this as
the problem where we have two matching decks of cards
and we want to determine the probability of matching
X cards in the two decks.
LET <y> = MATPDF(<x>,<k>)
where <x> is a variable, a number, or a parameter containing
values between 0 and <k>;
<k> is a number or parameter that defines the upper
limit of the matching distribution;
<y> is a variable or a parameter (depending on what
<x> is) where the computed pdf value is stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET A = MATPDF(3,20)
LET Y = MATPDF(X,100)
For a number of commands utilizing the matching distribution,
it is convenient to bin the data. There are two basic ways of
binning the data.
- For some commands (histograms, maximum likelihood
estimation), bins with equal size widths are required.
This can be accomplished with the following commands:
LET AMIN = MINIMUM Y
LET AMAX = MAXIMUM Y
LET AMIN2 = AMIN - 0.5
LET AMAX2 = AMAX + 0.5
CLASS MINIMUM AMIN2
CLASS MAXIMUM AMAX2
CLASS WIDTH 1
LET Y2 X2 = BINNED
- For some commands, unequal width bins may be
helpful. In particular, for the chi-square goodness
of fit, it is typically recommended that the minimum
class frequency be at least 5. In this case, it may
be helpful to combine small frequencies in the tails.
Unequal class width bins can be created with the
LET MINSIZE = <value>
LET Y3 XLOW XHIGH = INTEGER FREQUENCY TABLE Y
If you already have equal width bins data, you can
use the commands
LET MINSIZE = <value>
LET Y3 XLOW XHIGH = COMBINE FREQUENCY TABLE Y2 X2
The MINSIZE parameter defines the minimum class
frequency. The default value is 5.
You can generate matching random numbers, probability plots,
and chi-square goodness of fit tests with the following commands:
LET N = VALUE
LET K = <value>
LET Y = MATCHING RANDOM NUMBERS FOR I = 1 1 N
MATCHING PROBABILITY PLOT Y
MATCHING PROBABILITY PLOT Y2 X2
MATCHING PROBABILITY PLOT Y3 XLOW XHIGH
MATCHING CHI-SQUARE GOODNESS OF FIT Y
MATCHING CHI-SQUARE GOODNESS OF FIT Y2 X2
MATCHING CHI-SQUARE GOODNESS OF FIT Y3 XLOW XHIGH
Dataplot does not provide any explicit parameter estimation
methods. It is assummed that the number of objects is a
known quantity. We can then apply goodness of fit tests
(i.e., the probability plot or the chi-square goodness of fit)
to see if the classical matching distribution is an appropriate
For sufficiently large values of k, the classical
matching distribution can be accurately approximated with a
Poisson distribution with
Dataplot computes MATPDF from the above definition for values
of k < 20. For values of k ≥ 20, Dataplot
computes MATPDF using the Poisson pdf with
= Compute the matching cumulative distribution function.
= Compute the matching percent point function.
= Compute the Poisson probability density function.
= Compute the leads in coin tossing probability mass
= Compute the discrete uniform probability mass function.
= Compute the lost games probability mass function.
= Compute the arcsine probability density function.
= Compute the beta probability density function.
= Compute the uniform probability mass function.
Johnson, Kotz, and Kemp (1992), "Univariate Discrete
Distributions", Second Edition, Wiley, pp. 409-410.
Feller (1957), "Introduction to Probability Theory",
Third Edition, John Wiley and Sons, pp. 107-109.
TITLE CASE ASIS
TITLE Matching Probability Mass Function CR() ...
(N = 50)
LABEL CASE ASIS
Y1LABEL Probability Mass
TIC OFFSET UNITS SCREEN
TIC OFFSET 3 3
PLOT MATPDF(X,50) FOR X = 0 1 50
Date created: 6/20/2006
Last updated: 6/20/2006
Please email comments on this WWW page to