JOURNAL
OFhL4THEhlATICAL
ANALYSIS
AND
APPLICATIONS
15, 83-86(1966)
An Exact Probability Distribution for a Card Matching Problem ROBERT Department
E. GREENWOOD
of Mathematics,
The
University
of Texas
DEDICATORY STATEMENT. Professor H. S. Vandiver on several occasions has told the author of G. H. Hardy’s acknowledgment of indebtedness to the numerical calculations made by Major P. A. MacMahon and of other significant tabular studies used in testing and formulating a theory. MacnIahon computed the exact values of the partition numbersp(n) for n = 1, 2, ..., 200 at the request of Hardy, and these values were used by Hardy and Ramanujan to test their first approximating formula for p(n) and later to devise other and better approximating formulas for p(n). Some indications of the indebtedness of Hardy and Ramanujan to this numerical work of Major &IacMahon can be found in references [I], [2], and [3]. Professor Vandiver himself has expressed his own ideas of the importance of numerical tables in the foreword of “Tables of All Primitive Roots of Odd Primes Less Than 1000” by Roger C. Osborn [4]. This short table of exact numerical probabilities is therefore respectfully dedicated to Professor Harry S. Vandiver.
Card-matching problems have been studied by many authors. See Battin [5], Kaplansky [6], and Joseph and Bizley [7j. In 1953 the author published a table of approximate probabilities for a certain card-matching problem [8], and noted the possibility of approximating the resulting distribution with a Gram-Charlier series of type B. See Kendall [9] for this Gram-Char-her series. Consider an ordinary 52 card deck (four suits of 13 cards which could be numbered 1 through 13). Imagine two such decks being randomly shuffled, and then played out, and compared, one card from each of the two decks simultaneously, with a score being recorded if there is a match in number sequence disregarding suit. [Of course, only one deck is needed, and as the cards from this deck are played out, the comparisons could be made against a standard order.] When both sequence and suit are considered, the distribution can be approximated by the Poisson distribution. 83
84
GREEN\i’OOD
The probabilities of obtaining 0, 1, 2, ..., 52 matches can be obtained b! tedious calculations from standard formulas. Some of the tediousness can be removed if one uses the symbolic operators developed by Kaplansky. Still more of the drudgery can be removed if the calculations are performed on a high speed modern digital computer. Two of the author’s students in combinatory analysis were interested in programming a computer with more than the usual double precision arithmetic. Mr. Sheldon Ira Becker and RIr. Bob R. Norris, working independentl! and at times using different techniques, obtained exact probabilities for this problem, using modifications of Kaplansky’s symbolic methods. If P(K) represents the probability of obtaining exactly k matches, it is known from theoretical studies [8] that P[51]
= 0
$-‘[k]
= 1
I;=0
E[k] = c kP[k] = 4 I;=0
Var [k] = 2 (k - 4)” P[k] = g . k=O
In order decimal where C would all required
to avoid numbers whose decimal representations contain repeating sequences, all probabilities were expressed as P(k) = w(k)/C, was chosen so that the resulting numbers w(k), k = 0, 1, *.., 52 be positive integers except for the value ~(51) = 0. The value of C was
52! “=0’3 = 92024242230271040357
108320801872044844750000000000.
The values of w(k) are given in Table
CHECKING
1.
PROCEDURES
It was found by calculation with the University of Texas Control Data Corporation 1604 computing machine that P[51] = 0, and that each of the
TABLE
k 0
4 6
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
1493 6340 13266 18238 18526 14826 9732 5388 2567 1068 393 129 38 10 2
SO444 38575 56723 66828 76954 22426 70839 38213 25892 83955 53429 37197 27186 25443 50202 55848 11449 2162 377 61 9
44990 75570 22070 46762 83118 02331 20682 35350 61316 70150 64583 04332 12629 28929 82111 90680 29330 92661 62374 08228 17375 28163 16682 2026 229 24 2
1
93354 16669 57196 05177 47223 56028 46090 87467 02469 30994 52079 50016 50277 01004 63453 26035 61917 86692 64936 62705 39975 66440 74956 07555 84837 38138 42029 22499 1959 159 12
-
I’a dues of w(k)
91628 12842 01477 41889 05021 28875 95622 85827 30892 15895 87954 99234 02247 79716 51103 10570 76748 63317 83152 57444 72022 54489 07964 53203 82146 73450 37943 16451 69745 99864 24835 87933 5920 373 22
42901 06815 30867 SOS24 18253 43543 56515 82123 06909 56696 81931 62983 35315 31390 36323 17690 56077 53860 99214 46158 82034 69993 84134 02878 33044 38724 62291 91290 42406 23654 10552 85092 97570 93384 14811 23019 6406 312 14
88948 59913 16987 66616 72407 46995 22314 35850 73149 73671 77365 54693 20430 73870 75709 31504 64612 60136 54444 34900 66396 86077 49611 97710 25124 83064 96341 73264 53635 96645 02924 14420 27395 99202 66178 56968 93604 83060 31888 61438 2471 93 3
03122 58852 74727 08906 52403 03491 94313 45567 68435 97316 20110 41631 19440 81786 02278 04406 22891 76716 73282 76125 15206 59411 94057 87005 92450 40380 90701 21540 20454 0125s 75828 88855 85600 16443 56882 64581 92562 49732 03506 16247 33358 21481 29814 10953 341 10
98804 74539 72938 76256 90770 17460 82943 45499 36157 25699 67857 22703 60904 61697 15949 45538 18674 39672 29044 51404 94504 17215 60630 78289 20868 42890 41576 83304 98653 01556 09882 14808 58896 69170 05752 02787 06242 90054 75245 92980 31322 55608 94708 17653 70310 02133 27700 716 18
69556 96864 15856 07616 15557 27008 16704 25120 98276 09952 37968 68064 29150 40416 97632 74048 07264 18560 39616 05632 92503 26784 55040 70496 77192 88896 00736 16768 87284 74368 99392 29696 30580 45824 99248 17632 17411 14400 89984 23168 94452 57536 56240 55584 57518 56672 50816 60160 14904 36608 1248 0
86
GREENWOOD
three summation relations (2), (3), and (4) was satisfied exactly. This would seem to indicate error-free results, since such errors as two transposed digital pairs might balance each out in summation (2) say, but would hardly balance each other out in (3) and (4) also. The author realizes that this problem is of less importance than the problem considered by Hardy and Ramanujan. This lack of mathematical significance has not detracted from the author’s appreciation of and interest in this card-matching problem. It is hoped that this tabulation can be used to test approximation distributions for more general card matching problems.
REFERENCES 1. G.
H.
HARDY
PYOC. London 2.
G.
H.
AND
S. RAMANUJAN.
Math.
HARD>-,
Sot.
Asymptotic
formulae
Series 2, 17 (1918),
“Ramanujan,”
p. 119,
75-115. p. 87.
also,
in
combinatory
Cambridge
analysis.
University
Press,
1940. 3. S. RAMANUJAN.
“Collected
Papers,”
University Press, 1927. 4. R. C. OSBORN. “Tables
pp.
of .%I1 Primitive
273-309, Roots
University of Texas Press, 1961. 5. I. L. BATTIN. On the problem of multiple
especially of Odd
matching.
p.
Primes
Ann.
283.
Less
M&h.
Cambridge Than
1000.” 13 (1942),
Statist.
294-305. 6. I. KAPLANWY. Math. Sot. 50 7. rl. W. JOSEPH Statist. Sot. Jf. 8. R.
pp.
G. 154-l
solution
of certain
.~ND
iU.
T.
L.
88-93.
KENDALL.
“The
BIZLEY.
Part),
Probabilities
48 (1953), 56. Charles
problems
Bull.
in permutations.
Amer.
906-914.
(Methodological
E. GREENWOOD.
Assoc. 9. M.
Symbolic
(1944),
of certain
Advanced Griffin,
The
London,
two-pack
matching
Series B, 22 (1960),
Theory 1948.
solitaire
card
of Statistics,”
problem.
Roy.
114-130. games. \‘ol.
J.
Amer.
1, Fourth
Statist. Edition,