What is the probability of guessing 3 digits out of an 8-digit number?

  • Thread starter lavoisier
  • Start date
In summary: So the number of ways that the three digits of interest can occur in the string can be representedIn summary, the conversation was about a probability problem where a person bets on being able to guess three digits from the serial number of a randomly chosen dollar bill. The person who posed the problem found a formula for the probability using basic set and probability theory, but was unsure if it was correct. After testing it with a simplified case, it seemed to work. Other participants in the conversation also provided their own methods of verifying the probability.
  • #1
lavoisier
177
24
Hi everyone,
I have a question concerning probability.
In short, a guy on TV was betting with people in a bar that they wouldn't be able to guess 3 digits right out of the 8 digits of the serial number of a randomly chosen one dollar bill, and indeed, he won several times. He later explained that 'it isn't so easy to guess 3 digits out of an 8-digit number'.

I was curious to know how difficult it actually was (quantitatively), so I worked on the problem for a while and I found a formula that seemed OK. I used basic set and probability theory.
However, I wasn't very rigorous in deriving it (I'm not a mathematician): when I seemed to spot a pattern (binomial coefficients with alternating signs) I just 'assumed' this could be extended to a more general case. But I'm not sure I was correct in doing so.

This is what I got.
Suppose you pick a random number from the set of all numbers of p digits, each digit taking n possible values (so in the example above, p = 8 and n = 10).
A person (who doesn't know what the picked number is) writes down m distinct digits (obviously, 1≤mp, and each digit can only take one of the n defined values).

According to my calculations, the probability that the m digits are all contained (at least once) in the randomly picked number is:

[itex]{{\sum_{i=0}^{m}{\left(-1\right)^{i}\,{m\choose i}\,\left(n-i%
\right)^{p}}}\over{n^{p}}}[/itex]

I tested the formula in the simplified case of p=3, n=10, by actually counting how many numbers contained a given set of m=1, 2 or 3 digits, and it seemed to work there (the probabilities being 27.1%, 5.4% and 0.6%, respectively).
For the original problem (n=10, p=8, m=3), I found a probability of about 15%.

My questions are:
- is the formula correct?
- could it be expressed in a better/more concise form?

Thank you!
L

PS: someone in another forum suggested this problem is already addressed by the binomial distribution, but the numerical results I got from that didn't match the ones above, even for the case of p=3, where I am sure they are correct.
 
Physics news on Phys.org
  • #3
Thank you for your reply jedishrfu.
However, it doesn't seem to be about the problem I was describing.
In my problem it's only one serial number at a time that is considered, and the digits on which one bets are all distinct.
 
  • #4
Your formula is correct. The easiest way to check it is with the principle of inclusion-exclusion. Let [itex]E_i[/itex] be the event that the serial number of the bill does not contain the digit [itex]i[/itex]. Then we are looking for [itex]1 - P\left(\bigcup_{i \in S}E_i\right)[/itex], and this is equal to
[tex]1 - \sum_{T \subseteq S}(-1)^{\left|T\right|}P\left(\bigcap_{i \in T}E_i\right);[/tex]using the symmetry and calculating the probabilities, this is
[tex]1 - \sum_{i=1}^{\left|S\right|}(-1)^i\binom{\left|S\right|}{i} \left(n-i \over n\right)^p[/tex] and this is equal to your formula.

I don't immediately see a way to make it more concise.
 
  • #5
Interesting problem. For starters I wrote a program to verify the numbers you mentioned. The computer constructs a random [itex]p[/itex]-digit string to represent a serial number, then picks [itex]m[/itex] random digit characters. It then checks whether all of the [itex]m[/itex] digits picked occur at least once in the string. I ran this through a loop [itex]100 [/itex] [itex]000[/itex] [itex]000[/itex] times, counting the number of times all [itex]m[/itex] were in the string, and then returning the count. This way the significant digits of the count would be the significant digits of the proportion. The sample proportions I observed for [itex]n=10[/itex], [itex]p=3[/itex] were consistently within [itex].0001[/itex] of [itex].271[/itex], [itex].054[/itex], and [itex].006[/itex] for [itex]m=1[/itex], [itex]2[/itex], and [itex]3[/itex], respectively. When I upped the string length to [itex]8[/itex], the computer took longer to get through [itex]100[/itex] [itex]000[/itex] [itex]000[/itex] plays, but when it finally came back with an answer, it was in the ballpark of [itex]15[/itex] [itex]427[/itex] [itex]000[/itex], which corresponds closely with the figure you mentioned.

I then realized I could get the computer to count all of the [itex]8[/itex]-digit strings that have three distinct given digits, so I wrote another program that runs through a loop for every integer from [itex]0[/itex] to [itex]n[/itex][itex]p[/itex] [itex]-[/itex] [itex]1[/itex]. Every time through the loop, it constructs an equivalent [itex]p[/itex]-digit string to represent the integer of the current pass by prepending [itex]0[/itex]s to the integer until it is [itex]p[/itex] digits in length. It then checks the resulting string for three distinct digit characters, the same three every time through the loop, and if on a given pass all three are present, it increments the count. After [itex]n[/itex][itex]p[/itex] string representations corresponding to integers [itex]0[/itex] to [itex]n[/itex][itex]p[/itex] [itex]-[/itex] [itex]1[/itex] have been checked, it returns the count. When I ran this program with [itex]n=10[/itex], [itex]p=8[/itex], and [itex]m=3[/itex], it returned [itex]15[/itex] [itex]426[/itex] [itex]684[/itex], which, expressed as a proportion out of the [itex]100[/itex] [itex]000[/itex] [itex]000[/itex] total possible [itex]8[/itex]-digit strings, is [itex].15426684[/itex]. Not only is this the exact proportion you seek, but whereas the computer required nearly a full minute to get through [itex]100[/itex] [itex]000[/itex] [itex]000[/itex] plays using my empirical method, I only waited five seconds for the computer to get back this time.

While these algorithms are a quick and nifty way to get the correct answer, I think this problem deserves better from me, so I'm going to get right down to the statistics of it. First we must acknowledge that in searching a serial number, every digit place you check either contains a digit of interest whose presence among the string is uncertain (success), or it does not (failure); furthermore, there is only one way that a given digit of interest can occur at a given digit place in the string. We will know the string contains our three distinct digits if and when we have three successes; we need not look further. The first success can occur in one of three ways at a given digit place since it can contain any of the three distinct digits of interest. Given this success, we are now only interested in the two digits remaining, so our definition of success changes to include only those two. The second success can occur in one of two ways at any subsequent digit place. Given the second success, we redefine success yet again to include only the last digit of interest, so the third success can only occur in one way at any subsequent digit place. If we have three successes before we get to the end of the string, then any permutations of the remaining digits to check count toward the number of strings that contain our three.
Let [itex]Y[/itex] denote a success, [itex]N[/itex] a failure, and [itex]E[/itex] any outcome following the third success. We're interested in all string permutations that have three successes (i.e. contain all three digits of interest). Following is a table of all possible string combinations where we have three successes. Traversing a row to the right represents placing the first success further into the string, and as a consequence, there are fewer combinations whose first successes start at that digit place, symbolized by successively shorter columns.


[itex]YYYEEEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYYYEEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex][itex][/itex] [itex][/itex] [itex]NNYYYEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNYYYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNNYYYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNNNYYY[/itex]

[itex]YYNYEEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYYNYEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYYNYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNYYNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNNYYNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YYNNYEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYYNNYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYYNNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNYYNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNNYNYY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YYNNNYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYYNNNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYYNNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNYNYYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YYNNNNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYYNNNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYNYYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNYNYNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YYNNNNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNYYEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYNYNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNNYNNYY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNYYEEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNYNYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYNYNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNYNYEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNYNNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYNNYYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNYNNYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNYNNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYNNYNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNYNNNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNNYYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NNYNNNYY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNYNNNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNNYNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNYYEEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNNYNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNYNYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNNNYYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNYNNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNNNYNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNYNNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex]NYNNNNYY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNNYYEE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNNYNYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNNYNNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNNNYYE[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNNNYNY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]

[itex]YNNNNNYY[/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex] [itex][/itex]


Now I will rewrite every combination as a chain product of the number of ways each of its successive outcomes could happen: the first success ([itex]3[/itex]), the second success ([itex]2[/itex]), the third success ([itex]1[/itex]), any failures before the first success ([itex]7[/itex]), any failures between the first and second successes ([itex]8[/itex]), any failures between the second and third successes ([itex]9[/itex]), and any outcomes after the third success ([itex]10[/itex]). In this way I account for every permutation of interest.

Permutations whose first successes occur at the first digit place:

[itex]3\times2\times1\times10\times10\times10\times10\times10=600[/itex] [itex]000[/itex]

[itex]3\times2\times9\times1\times10\times10\times10\times10=540[/itex] [itex]000[/itex]

[itex]3\times2\times9\times9\times1\times10\times10\times10=486[/itex] [itex]000[/itex]

[itex]3\times2\times9\times9\times9\times1\times10\times10=437[/itex] [itex]400[/itex]

[itex]3\times2\times9\times9\times9\times9\times1\times10=393[/itex] [itex]660[/itex]

[itex]3\times2\times9\times9\times9\times9\times9\times1=354[/itex] [itex]294[/itex]

[itex]3\times8\times2\times1\times10\times10\times10\times10=480[/itex] [itex]000[/itex]

[itex]3\times8\times2\times9\times1\times10\times10\times10=432[/itex] [itex]000[/itex]

[itex]3\times8\times2\times9\times9\times1\times10\times10=388[/itex] [itex]800[/itex]

[itex]3\times8\times2\times9\times9\times9\times1\times10=349[/itex] [itex]920[/itex]

[itex]3\times8\times2\times9\times9\times9\times9\times1=314[/itex] [itex]928[/itex]

[itex]3\times8\times8\times2\times1\times10\times10\times10=384[/itex] [itex]000[/itex]

[itex]3\times8\times8\times2\times9\times1\times10\times10=345[/itex] [itex]600[/itex]

[itex]3\times8\times8\times2\times9\times9\times1\times10=311[/itex] [itex]040[/itex]

[itex]3\times8\times8\times2\times9\times9\times9\times1=279[/itex] [itex]936[/itex]

[itex]3\times8\times8\times8\times2\times1\times10\times10=307[/itex] [itex]200[/itex]

[itex]3\times8\times8\times8\times2\times9\times1\times10=276[/itex] [itex]480[/itex]

[itex]3\times8\times8\times8\times2\times9\times9\times1=248[/itex] [itex]832[/itex]

[itex]3\times8\times8\times8\times8\times2\times1\times10=245[/itex] [itex]760[/itex]

[itex]3\times8\times8\times8\times8\times2\times9\times1=221[/itex] [itex]184[/itex]

[itex]3\times8\times8\times8\times8\times8\times2\times1=196[/itex] [itex]608[/itex]

Sum: [itex]7[/itex] [itex]593[/itex] [itex]642[/itex]

Permutations whose first successes occur at the second digit place:

[itex]7\times3\times2\times1\times10\times10\times10\times10 = 420[/itex] [itex]000[/itex]

[itex]7\times3\times2\times9\times1\times10\times10\times10 = 378[/itex] [itex]000[/itex]

[itex]7\times3\times2\times9\times9\times1\times10\times10 = 340[/itex] [itex]200[/itex]

[itex]7\times3\times2\times9\times9\times9\times1\times10 = 306[/itex] [itex]180[/itex]

[itex]7\times3\times2\times9\times9\times9\times9\times1 = 275[/itex] [itex]562[/itex]

[itex]7\times3\times8\times2\times1\times10\times10\times10 = 336[/itex] [itex]000[/itex]

[itex]7\times3\times8\times2\times9\times1\times10\times10 = 302[/itex] [itex]400[/itex]

[itex]7\times3\times8\times2\times9\times9\times1\times10 = 272[/itex] [itex]160[/itex]

[itex]7\times3\times8\times2\times9\times9\times9\times1 = 244[/itex] [itex]944[/itex]

[itex]7\times3\times8\times8\times2\times1\times10\times10 = 268[/itex] [itex]800[/itex]

[itex]7\times3\times8\times8\times2\times9\times1\times10 = 241[/itex] [itex]920[/itex]

[itex]7\times3\times8\times8\times2\times9\times9\times1 = 217[/itex] [itex]728[/itex]

[itex]7\times3\times8\times8\times8\times2\times1\times10 = 215[/itex] [itex]040[/itex]

[itex]7\times3\times8\times8\times8\times2\times9\times1 = 193[/itex] [itex]536[/itex]

[itex]7\times3\times8\times8\times8\times8\times2\times1 = 172[/itex] [itex]032[/itex]

Sum: [itex]4[/itex] [itex]184[/itex] [itex]502[/itex]

Permutations whose first successes occur at the third digit place:

[itex]7\times7\times3\times2\times1\times10\times10\times10 = 294[/itex] [itex]000[/itex]

[itex]7\times7\times3\times2\times9\times1\times10\times10 = 264[/itex] [itex]600[/itex]

[itex]7\times7\times3\times2\times9\times9\times1\times10 = 238[/itex] [itex]140[/itex]

[itex]7\times7\times3\times2\times9\times9\times9\times1 = 214[/itex] [itex]326[/itex]

[itex]7\times7\times3\times8\times2\times1\times10\times10 = 235[/itex] [itex]200[/itex]

[itex]7\times7\times3\times8\times2\times9\times1\times10 = 211[/itex] [itex]680[/itex]

[itex]7\times7\times3\times8\times2\times9\times9\times1 = 190[/itex] [itex]512[/itex]

[itex]7\times7\times3\times8\times8\times2\times1\times10 = 188[/itex] [itex]160[/itex]

[itex]7\times7\times3\times8\times8\times2\times9\times1 = 169[/itex] [itex]344[/itex]

[itex]7\times7\times3\times8\times8\times8\times2\times1 = 150[/itex] [itex]528[/itex]

Sum: [itex]2[/itex] [itex]156[/itex] [itex]490[/itex]

Permutations whose first successes occur at the fourth digit place:

[itex]7\times7\times7\times3\times2\times1\times10\times10 = 205[/itex] [itex]800[/itex]

[itex]7\times7\times7\times3\times2\times9\times1\times10 = 185[/itex] [itex]220[/itex]

[itex]7\times7\times7\times3\times2\times9\times9\times1 = 166[/itex] [itex]698[/itex]

[itex]7\times7\times7\times3\times8\times2\times1\times10 = 164[/itex] [itex]640[/itex]

[itex]7\times7\times7\times3\times8\times2\times9\times1 = 148[/itex] [itex]176[/itex]

[itex]7\times7\times7\times3\times8\times8\times2\times1 = 131[/itex] [itex]712[/itex]

Sum: [itex]1[/itex] [itex]002[/itex] [itex]246[/itex]

Permutations whose first successes occur at the fifth digit place:

[itex]7\times7\times7\times7\times3\times2\times1\times10 = 144[/itex] [itex]060[/itex]

[itex]7\times7\times7\times7\times3\times2\times9\times1 = 129[/itex] [itex]654[/itex]

[itex]7\times7\times7\times7\times3\times8\times2\times1 = 115[/itex] [itex]248[/itex]

Sum: [itex]388[/itex] [itex]962[/itex]

Permutations whose first successes occur at the sixth digit place:

[itex]7\times7\times7\times7\times7\times3\times2\times1 = 100[/itex] [itex]842[/itex]

Sum: [itex]100[/itex] [itex]842[/itex]

By taking the sum of these six sums of sets of permutations, we have determined that there are [itex]15[/itex] [itex]426[/itex] [itex]684[/itex] [itex]8[/itex]-digit strings that contain each of any three distinct digits. Therefore we can find the probability that all three digits you guess are in the serial number on a dollar bill in the following way:

[itex]P(win)=\frac{15426684}{100000000}=0.15426684[/itex]

Applying this whole process in general involves setting up [itex]p-m+1[/itex] sets of combinations, where the sets explore combinations whose first successes occur anywhere from the first digit place to the [itex](p-m+1)[/itex]th digit place. The way you consider all the combinations in a given set seems to involve moving the last success from right after the preceding success along to the end, then starting the process over again for every position closer to the end the preceding success is moved, and then starting that over again for every position closer to the end the success that precedes that one is moved, and so on, such that the number of combinations follows a binomial pattern. To get permutations from combinations, you substitute the number of ways each outcome can happen. At the beginning, there will always be [itex]m[/itex] ways for a success to occur at any spot and [itex]n-m[/itex] ways for a failure to occur. Every time you mark down a success, the number of ways for a success to occur at any subsequent spot decrements by one and the number of ways for a failure to occur increments by one. Marking failures does not change the number of ways either can occur. Lastly, once [itex]m[/itex] successes have been marked down, any subsequent spots can take on any of the [itex]n[/itex] possible values. Then it's just a matter of summing the sets of permutations of interest and dividing by the total possible number of permutations. I'd like to think that your formula is mathematical shorthand for carrying out this long-winded process, but if there's one thing I can guarantee, its that your formula is completely backed by the results I've obtained from each of the methods I've used to tackle this problem.
 
  • Like
Likes 1 person
  • #6
Thank you both very much eigenperson and tycoon515! I couldn't have hoped for more professional and thorough explanations.
My approach was much less sophisticated than yours, but it's nice to know I got it right nevertheless.
Interesting though to see how even someone with limited mathematical knowledge like myself can sometimes produce correct results when there's money involved...

I think it's now safe to assume that the binomial distribution can't be used in this case.
From tycoon515's answer I seem to gather that it's rather a sum of several hypergeometric-looking terms that eventually (in some way) produces my formula, and the formula itself also still contains a term decreasing by one unit at a time raised to a constant power, (n-i)^p, rather than a constant ratio raised to a changing power.

I don't know, perhaps there is a way to express my sum more concisely, or as a combination of known hypergeometric-based functions, but it may be 'shorthand' enough as it is.

The bottom line, if I understand correctly, is that with a 15% probability of losing, the guy had reasonably high odds of making money by playing this game long enough. I'll be careful if anyone approaches me with this kind of gambles...
 

1. What is "The dollar bill problem"?

The dollar bill problem is a mathematical puzzle that involves arranging a specific number of dollar bills in a specific way to create a certain dollar amount.

2. How do you solve "The dollar bill problem"?

The solution to the dollar bill problem involves finding the factors of the desired dollar amount and arranging the corresponding number of dollar bills in a specific way.

3. What is the significance of "The dollar bill problem"?

The dollar bill problem is a fun and challenging way to practice basic math skills and problem-solving strategies. It can also help improve critical thinking and logical reasoning abilities.

4. Can you give an example of "The dollar bill problem"?

For example, if you want to create $20 using only $1 and $5 bills, the solution would be to arrange 4 $5 bills and 4 $1 bills in a specific way, such as 4 rows of 3 bills each.

5. What are some variations of "The dollar bill problem"?

There are many variations of the dollar bill problem, such as using different denominations of bills, finding the minimum number of bills needed to create a certain amount, and creating a specific dollar amount using only a certain number of bills.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
0
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
Replies
4
Views
212
Back
Top