Clarification of Answer by
09 Feb 2004 22:30 PST
In the interest of expediency and completeness, having seen your new
Question, let me go ahead and provide further breakdowns here.
First the framework. There are three "outcome" types we distinguish:
A := all three digits of outcome number are different
B := two digits of the outcome number are the same, one different
C := all three digits of outcome number are the same
A priori the chances of these (mutually exclusive) outcomes are:
Pr( A ) = (10*9*8)/1000 = 0.720
Pr( B ) = (10*9*3)/1000 = 0.270
Pr( C ) = 10/1000 = 0.010
For example, in A one has 10 choices for the first digit, 9 for the
second digit, and 8 for the third digit (as they must all be
distinct). In B we can choose the "doubled" digit 10 ways, the
"single" digit 9 ways, and the position of the single digit (out of
three) in 3 ways. Finally for C we can choose a tripled digit in 10
ways. Of course these choices added up to the "universe" of 1000
As before there are "on paper" ten different possible scores, but
depending on the type of outcome and the rule for scoring with matched
repetitions, some of these scores are impossible. E.g. your
observation in the other thread that if each guess digit contributes
at most once to the score, then PPX would not be possible.
So let's breakout "conditional probabilities" first for that scoring
rule, ie. each digit of the guess counts at most once:
- as P if it matches the outcome digit in the same position
- as X if it matches an outcome digit but not the one in its position
- as _ if it does not match any outcome digit
We then have the following table of conditional probabilities for
combined scores, where outcome event O is one of A,B,C as displayed in
O = A O = B O = C
Pr( _ _ _ | O ) 210/720 336/720 504/720
Pr( X _ _ | O ) 252/720 168/720 0
Pr( X X _ | O ) 63/720 16/720 0
Pr( X X X | O ) 2/720 0 0
Pr( P _ _ | O ) 126/720 168/720 216/720
Pr( P X _ | O ) 42/720 16/720 0
Pr( P X X | O ) 3/720 0 0
Pr( P P _ | O ) 21/720 16/720 0
Pr( P P X | O ) 0 0 0
Pr( P P P | O ) 1/720 0 0
A quick check on our arithmetic is to verify that each column adds to
1, and I've done that. It is worthwhile going through the computation
of each entry in detail, but first let's apply the results above,
using the definition of conditional probability, to find the absolute
probability of each score.
This formula is:
Pr( Score ) = Pr( Score | A ) * Pr( A )
+ Pr( Score | B ) * Pr( B )
+ Pr( Score | C ) * Pr( C )
because the events A,B,C "partition" the possible outcomes.
Plugging in the values for Pr( A ), Pr( B ), Pr( C ) obtained earlier:
Pr( _ _ _ ) = 0.210 + 0.126 + 0.007 = 0.343
Pr( X _ _ ) = 0.252 + 0.063 + 0.000 = 0.315
Pr( X X _ ) = 0.063 + 0.006 + 0.000 = 0.069
Pr( X X X ) = 0.002 + 0.000 + 0.000 = 0.002
Pr( P _ _ ) = 0.126 + 0.063 + 0.003 = 0.192
Pr( P X _ ) = 0.042 + 0.006 + 0.000 = 0.048
Pr( P X X ) = 0.003 + 0.000 + 0.000 = 0.003
Pr( P P _ ) = 0.021 + 0.006 + 0.000 = 0.027
Pr( P P X ) = 0.000 + 0.000 + 0.000 = 0.000
Pr( P P P ) = 0.001 + 0.000 + 0.000 = 0.001
Now let's go through the columns of conditional probabilities in
detail. In each case the "universe" of possibilities is the choice of
three distinct digits for the "guess", so we wind up with a common
10 * 9 * 8 = 720
that I did not try to reduce, knowing that the decimal answers would
work out cleanly in the end.
Let's go through the first column, conditional on A, having all three
digits of the outcome distinct, esp. since this part of calculation is
valid for either scoring rule:
Pr( _ _ _ | A ) = (7 * 6 * 5)/720 since we have 7 choices for the
first digit of the guess, to avoid all three digits of the outcome,
then 6 choices for the second digit (since it must also differ from
the first digit of the guess), times 5 choices for the final digit of
Pr( X _ _ | A ) = (3*2*7*6)/720 because we can pick which of the
outcome digits to match in 3 ways, and the position in which to put
that digit in 2 ways, times 7 ways to pick the next digit of the guess
and 6 ways to pick the final digit of the guess (to avoid repetition
and further matches).
Pr( X X _ | A ) = (3 * 3 * 7)/720 since we have 3 choices for which
digit of the outcome will not be matched, times 3 positions for the
digit of the guess that does not match anything, times 7 choices for
the value of that unmatching guess digit (the positions of the
matching guess digits are then forced to avoid a "position" match).
Pr( X X X | A ) = 2/720 because all three outcome digits are matched
but none in its own position; there are only 2 such "derangements"
(rotate the three digits once to the left or once to the right).
Pr( P _ _ | A ) = (3 * 7 * 6)/720 since there are 3 choices for the
position match and then 7 * 6 ways to choose the remaining unmatched
Pr( P X _ | A ) = (3 * 2 * 7)/720 since there are 3 choices for the
position match, times 2 choices for other "non-position" match, times
7 choices for the remaining unmatching guess digit.
Pr( P P _ | A ) = (3 * 7)/720 because we can choose the unmatching
position in 3 ways and unmatching guess digit in that position in 7
Pr( P P X | A ) = 0 because as you pointed out, it's not possible to
have an "out of position" match if the other two positions do match
(assuming the three guess digits are all distinct).
Pr( P P P | A ) = 1/720 because there is only one choice for each position.
Next we consider the conditional probabilities given B, having two
digits in the outcome which are equal and a third digit which is
Pr( _ _ _ | B ) = (8 * 7 * 6)/720 since it is only necessary to avoid
the two digits that appear in the outcome.
Pr( X _ _ | B ) = (3 * 8 * 7)/720 since we have 3 choices for the
location of the (non-positional) match, times 8 * 7 ways to fill the
other two guess digits without matching the outcome (if the location
of the non-positional match is chosen, the value for that guess digit
Pr( X X _ | B ) = (2 * 8)/720 because we have a choice of 2 locations
(the positions of the equal outcome digits) for our unmatched guess
digit, times 8 possible values for that guess digit (the other two
guess digits are forced).
Pr( X X X | B ) = 0 because we can't have three matches with only two
distinct digits in the outcome.
Pr( P _ _ | B ) = (3 * 8 * 7)/720 since again we can choose the
position of the (positional) match in 3 ways, times 8 * 7 ways to fill
the other two guess digits without matching (all the values except the
two that appear in the outcome are available to choose from).
Pr( P X _ | B ) = (2 * 8)/720 because we must choose one of the 2
locations in which the outcome digits are equal to put a positional
match (we cannot have a non-positional match there if the outcome's
"odd" digit has a positional match) and then we have 8 choices for the
unmatched guess digit in the other one of those locations (the value
for the guess digit in the outcome's "odd" digit position is forced).
Pr( P X X | B ) = 0 because again it's not possible to have three matches.
Pr( P P _ | B ) = (2 * 8)/720 because one of the 2 locations where the
outcome has equal digits must be unmatched (we cannot match both as
the guess digits are distinct) and that position can be filled 8 ways.
Pr( P P X | B ) = 0 because three matches are not possible.
Pr( P P P | B ) = 0 because three matches are not possible.
To complete these conditional probabilities it remains only to
consider the outcomes C in which all three digits are equal. One
quickly sees that under the scoring rules considered here, either
there are no matches or there is exactly one match and that one is
Pr( _ _ _ | C ) = (9 * 8 * 7)/720 since there are 9 choices for the
first guess digit (that avoid the triple digit in the outcome), 8
choices for the second guess digit, and 7 choices for the third one.
Pr( P _ _ | C ) = (3 * 9 * 8)/720 since there are 3 positions for the
matching digit (which necessarily matches also in position) and 9 * 8
choices for the remaining unmatched digits.
All the other conditional probabilities involving outcomes C are zero,
as it is not possible to have two matches or to have a match that does
not agree in position.
This completes the calculation of the scoring probabilities with the
interpretation that you evidently intended (at most one "score" per
each digit of the guess). To see that the numbers I originally
provided are consistent with this interpretation of scoring:
- a P for each guess digit matching an outcome digit in its position, and
- an X for each guess digit matching an outcome digit not in its position
we need only revise the conditional probabilities in the columns for B
and C, because the scoring changes only affect outcomes with
For the column under B the basic differences are that any positional
match associated with a repeated digit gives and X as well as a P, and
also opens up a number of ways to obtain three X's (which was not
possible given B under the scoring system you intended).
For the column under C there are still only two possible scores, but
these are now "_ _ _" and "P X X" because a positional match in the
latter case also draws in two nonpositional matches.
If there is interest I can supply the gory details, but the final
numbers would revert to those I originally posted.
Sorry for the confusion.