2

Given an n-digit integer sequence, e.g. $n=5$ [1, 1, 5, 6, 4] where each digit is independent and uniformly random in the range 1-6, what is the probability of having at least k same digits of a certain value (e.g. 1)?

Specifically I'm interested in $k = n/2$ (rounded up) and n in the range 1 - 40.

So ... f(k, n) = Probability of *at least* k same of a specific digit = ... n ... k ...?


Background:

This is as far as I got with the question of plotting the probability of rolling $n$ dice once and having at least $k$ 1s in the resulting roll. (e.g. at least half the dice showing 1.)

Yes, there are $6^n$ combinations to roll $n$ dice. The probability for each die to show or not show a 1 is $1/6$ or $5/6$ respectively.

Yes, the question is the same whether asking if we have at least half 1s or at least half 4s ... any single digit, the others are irrelevant. And, yes, it does not matter if I roll $n$ dice once to generate the sequence or one die $n$ times.

That it is $1/6$ for one die is trivial. For two dice I can come up with a calculation, and is still easy to check with a table - $11/36$), but I fail to come up with a calculable general solution for $n >= 3$

Similar to this other question I'm currently looking at the binomial distribution but I'm stuck a bit at the moment.

Side Side Note: The question for increasing n comes from a discussion we had on if, and how much, the probability of rolling more than half 1s with a hand full of D6 dice increases with the number of dice.

Martin
  • 123

2 Answers2

1

$$P(k, n) = \binom{n}{k} p^k (1-p)^{n-k}$$ Where $\binom{n}{k}$ is the number of ways to choose $k$ successes from $n$, which accounts for all the combinations of dice that would roll successfully without duplicates.

$p^k$ is the probability of each success to the power of desired successes.

$(1-p)^{n-k}$ is the probability of failure to the power of number of failures.

In this case, you are assuming that you will have exactly $k$ successes and $(n-k)$ failures. If you want to find at least $k$ successes, you have to add all the possible outcomes from $k$ to $n$: $$P(k, n) = \sum_{k=x}^n\binom{n}{k} p^k (1-p)^{n-k}$$

We can also write it as a probability with the number of successful cases over the total number of cases. In this case, $p$ is the number of options (6 for dice):

$$P(k, n) = \frac{\binom{n}{k}(p-1)^{n-k}}{p^n}$$ Or for at least k successes: $$P(k, n) = \sum_{k=x}^n\frac{\binom{n}{k}(p-1)^{n-k}}{p^n}$$

Trom
  • 26
  • 2
  • 1
    If you want to find at least k successes, you can omit the failure term. I think, this is wrong. You overcount a lot. Consider there was $k+1$ ones. You can choose $k$ ones from $k+1$ multiple ways and you count that as different combinations. – Aig Feb 19 '24 at 06:20
  • 1
    To find at least $k$ successes one must add all the relevant “exact” probabilities: $P(k,n)+P(k+1,n)+…+P(n,n)$. – Aig Feb 19 '24 at 06:22
  • 1
    You are correct, I've updated my answer. – Trom Feb 19 '24 at 08:24
0

Part answer to the last side note:

I've managed to plot this via Wolfram Alpha and the result is quite interesting in that - contrary to my intuition - the probability of having >= n/2 identical sides of any die face (e.g. half or more than half 1s) decreases rapidly:

n=2 to 40

Martin
  • 123