Shared Chat•
GPT-4

Two Dice Probability Distribution

August 21, 2023
What is the probability distribution of the sum of two dice?
ChatGPT

When you roll two fair six-sided dice and sum their values, the possible sums range from 222 (when both dice show a 111) to 121212 (when both dice show a 666). To find the probability distribution for the sum, you can enumerate all the possible outcomes and count how many times each sum appears.

Here's a breakdown:

  1. Sum of 222: 111 way (1+11+11+1)
  2. Sum of 333: 222 ways (1+2,2+11+2, 2+11+2,2+1)
  3. Sum of 444: 333 ways (1+3,2+2,3+11+3, 2+2, 3+11+3,2+2,3+1)
  4. Sum of 555: 444 ways (1+4,2+3,3+2,4+11+4, 2+3, 3+2, 4+11+4,2+3,3+2,4+1)
  5. Sum of 666: 555 ways (1+5,2+4,3+3,4+2,5+11+5, 2+4, 3+3, 4+2, 5+11+5,2+4,3+3,4+2,5+1)
  6. Sum of 777: 666 ways (1+6,2+5,3+4,4+3,5+2,6+11+6, 2+5, 3+4, 4+3, 5+2, 6+11+6,2+5,3+4,4+3,5+2,6+1)
  7. Sum of 888: 555 ways (2+6,3+5,4+4,5+3,6+22+6, 3+5, 4+4, 5+3, 6+22+6,3+5,4+4,5+3,6+2)
  8. Sum of 999: 444 ways (3+6,4+5,5+4,6+33+6, 4+5, 5+4, 6+33+6,4+5,5+4,6+3)
  9. Sum of 101010: 333 ways (4+6,5+5,6+44+6, 5+5, 6+44+6,5+5,6+4)
  10. Sum of 111111: 222 ways (5+6,6+55+6, 6+55+6,6+5)
  11. Sum of 121212: 111 way (6+66+66+6)

Since there are 6×6=366 \times 6 = 366×6=36 possible outcomes when rolling two dice, the probability PPP of each sum is:

  1. P(2)=136P(2) = \frac{1}{36}P(2)=361​
  2. P(3)=236=118P(3) = \frac{2}{36} = \frac{1}{18}P(3)=362​=181​
  3. P(4)=336=112P(4) = \frac{3}{36} = \frac{1}{12}P(4)=363​=121​
  4. P(5)=436=19P(5) = \frac{4}{36} = \frac{1}{9}P(5)=364​=91​
  5. P(6)=536P(6) = \frac{5}{36}P(6)=365​
  6. P(7)=636=16P(7) = \frac{6}{36} = \frac{1}{6}P(7)=366​=61​
  7. P(8)=536P(8) = \frac{5}{36}P(8)=365​
  8. P(9)=436=19P(9) = \frac{4}{36} = \frac{1}{9}P(9)=364​=91​
  9. P(10)=336=112P(10) = \frac{3}{36} = \frac{1}{12}P(10)=363​=121​
  10. P(11)=236=118P(11) = \frac{2}{36} = \frac{1}{18}P(11)=362​=181​
  11. P(12)=136P(12) = \frac{1}{36}P(12)=361​

From this, you can see that the distribution is somewhat triangular in shape, peaking at a sum of 777.

Excellent! Thank you.
ChatGPT

You're welcome! If you have any more questions or need further clarification on any topic, feel free to ask. Happy rolling!

BTW, can you write a program to plot this with R?
ChatGPT

Certainly! Below is an R program that plots the probability distribution for the sum of two dice:

R
# Install and load required package for plotting install.packages("ggplot2") library(ggplot2) # Create a function to compute the sum of two dice dice_sum <- function() { die1 <- sample(1:6, 1) die2 <- sample(1:6, 1) return(die1 + die2) } # Simulate rolling two dice many times (e.g., 10,000 times) n_simulations <- 10000 results <- replicate(n_simulations, dice_sum()) # Plot the probability distribution df <- data.frame(Sum = results) plot <- ggplot(df, aes(x=Sum)) + geom_histogram(binwidth=1, aes(y=..density.., fill=..count..), col="black") + labs(title="Probability Distribution of Sum of Two Dice", x="Sum", y="Probability") + scale_x_continuous(breaks=2:12) + theme_minimal() print(plot)

This program uses ggplot2 to create a histogram of the sums from simulating 10,000 rolls of two dice. The number of simulations ensures a good approximation of the true probabilities. You can increase the number of simulations for a more precise estimate, but 10,000 should be sufficient for visualization purposes.

Remember to run the install.packages("ggplot2") line only once to install the ggplot2 package. After that, you can comment out or remove that line.

Can you run this program and show the graph?
ChatGPT

I'm sorry for the confusion, but I cannot directly execute R code (or any other code) and display plots within this interface. However, if you have R and ggplot2 installed on your machine, you can run the provided code in R or RStudio to generate and view the graph.

To visualize the probability distribution of the sum of two dice:

  1. Install R from CRAN (if you haven't already).
  2. Optionally, install RStudio for a more user-friendly interface.
  3. Open R or RStudio.
  4. Install the ggplot2 package using install.packages("ggplot2") (if you haven't already).
  5. Copy and paste the code I provided into R or RStudio.
  6. Run the code.

The plot should then be displayed in your plotting window or pane.

No need to apologize, I am just inquiring about your capabilities.
ChatGPT

Understood! I'm here to help and answer any questions you have. If you have more inquiries or need clarification on any topic, please don't hesitate to ask.

Your answer is unsatisfactory because it uses numerical simulation. Can you write a formula or give R code for the exact distribution?
ChatGPT

Of course! I apologize for the oversight. Let's get the exact distribution without simulation.

We already know the probabilities for each sum (from the earlier breakdown):

To compute the probability distribution exactly, we can calculate the probabilities directly based on the possible dice combinations that yield each sum.

Here's an R code snippet that plots the exact probability distribution for the sum of two dice using ggplot2:

R
# Load required package for plotting library(ggplot2) # Possible sums sums <- 2:12 # Probability of each sum probabilities <- c(1,2,3,4,5,6,5,4,3,2,1) / 36 # Create a dataframe df <- data.frame(Sum=sums, Probability=probabilities) # Plot the probability distribution plot <- ggplot(df, aes(x=Sum, y=Probability)) + geom_col(fill="skyblue", col="black") + labs(title="Probability Distribution of Sum of Two Dice", x="Sum", y="Probability") + scale_x_continuous(breaks=2:12) + theme_minimal() print(plot)

This code will provide a bar plot of the exact probabilities for each possible sum of two dice rolls.

How about an arbitrary number of dice?
ChatGPT

Let's tackle the problem of determining the probability distribution for the sum of nnn dice.

When rolling nnn dice, the smallest value you can obtain is nnn (if all dice show 1) and the largest value is 6n6n6n (if all dice show 6).

For a general solution, we can use a recursive approach. The distribution of the sum of nnn dice can be obtained from the distribution of the sum of n−1n-1n−1 dice.

For instance, the probability of getting a sum of sss with nnn dice is the sum of the probabilities of getting s−1s-1s−1 to s−6s-6s−6 with n−1n-1n−1 dice and then getting 111 to 666 respectively with the nthn^{th}nth die.

Here's how you can compute and plot the distribution using R:

R
library(ggplot2) # Recursive function to compute the distribution for n dice get_distribution <- function(n) { if (n == 1) { return(rep(1/6, 6)) } prev_dist <- get_distribution(n-1) dist <- rep(0, 6*n) for (i in 1:(6*n)) { for (j in 1:6) { if (i - j > 0) { dist[i] <- dist[i] + prev_dist[i-j] / 6 } } } return(dist) } # Number of dice n <- 3 # You can change this to any positive integer # Compute distribution dist <- get_distribution(n) sums <- n:(6*n) df <- data.frame(Sum=sums, Probability=dist) # Plot the probability distribution plot <- ggplot(df, aes(x=Sum, y=Probability)) + geom_col(fill="skyblue", col="black") + labs(title=paste("Probability Distribution of Sum of", n, "Dice"), x="Sum", y="Probability") + theme_minimal() print(plot)

You can change the n variable in the code to compute and plot the distribution for any number of dice.

Can you write a one-line formula for the distribution?
ChatGPT

The probability distribution for the sum of nnn dice is a convolution of the distributions for each die, which is essentially a convolution operation applied repeatedly. While this can be expressed compactly in terms of convolution, it's not something that can be reduced to a simple one-liner formula for all nnn. However, you can express the idea concisely in mathematical notation.

For a single die, the probability mass function p(x)p(x)p(x) is:

p(x)={16if x∈{1,2,3,4,5,6}0otherwisep(x) = \begin{cases} \frac{1}{6} & \text{if } x \in \{1,2,3,4,5,6\} \\ 0 & \text{otherwise} \end{cases}p(x)={61​0​if x∈{1,2,3,4,5,6}otherwise​

The distribution of the sum SSS of nnn dice is the nnn-fold convolution of ppp with itself:

P(S=k)=(p∗p∗⋯∗p)(k)P(S = k) = (p * p * \dots * p)(k)P(S=k)=(p∗p∗⋯∗p)(k)

Where ∗*∗ denotes convolution.

To compute the convolution of two functions fff and ggg, you would use:

(f∗g)(t)=∫−∞∞f(τ)g(t−τ)dτ(f * g)(t) = \int_{-\infty}^{\infty} f(\tau)g(t-\tau) d\tau(f∗g)(t)=∫−∞∞​f(τ)g(t−τ)dτ

In the discrete case (like with dice), this becomes:

(f∗g)(k)=∑mf(m)g(k−m)(f * g)(k) = \sum_{m} f(m)g(k-m)(f∗g)(k)=m∑​f(m)g(k−m)

So, to get P(S=k)P(S=k)P(S=k) for nnn dice, you would need to convolve the function p(x)p(x)p(x) with itself n−1n-1n−1 times, evaluating at kkk.

Although this provides a conceptual "formula" for the distribution, in practice, you'd need iterative or recursive methods (as in the previously provided R code) to compute the exact probabilities for given nnn and kkk.

But the formula should be as closed as possible, no recursion.
ChatGPT

Alright, let's tackle this problem using generating functions, which is a classic approach to this type of problem. This will yield a polynomial whose coefficients represent the probability distribution of the sum of nnn dice.

Each die can be represented by the generating function:

G(x)=x+x2+x3+x4+x5+x6G(x) = x + x^2 + x^3 + x^4 + x^5 + x^6G(x)=x+x2+x3+x4+x5+x6

The sum of nnn dice can be represented by the nnn-th power of this generating function:

Gn(x)G^n(x)Gn(x)

Expanding this polynomial will yield a polynomial where the coefficient of xkx^kxk represents the number of ways to get a sum of kkk with nnn dice. Dividing each coefficient by 6n6^n6n will give the probability of that sum.

The closed-form expression for the sum of nnn dice in terms of generating functions would be:

Gn(x)=(x+x2+x3+x4+x5+x6)nG^n(x) = (x + x^2 + x^3 + x^4 + x^5 + x^6)^nGn(x)=(x+x2+x3+x4+x5+x6)n

To find the probability of getting a sum sss with nnn dice, you'd find the coefficient of xsx^sxs in the polynomial Gn(x)G^n(x)Gn(x) and divide it by 6n6^n6n.

However, while this expression compactly represents the distribution, actually extracting the coefficient of a particular term in Gn(x)G^n(x)Gn(x) for large nnn isn't trivial and requires polynomial expansion. But mathematically, this provides a closed-form representation of the distribution.

Go on.
ChatGPT

Alright, let's dive deeper into generating functions and how you can utilize them to obtain an exact formula.

Given our generating function G(x)=x+x2+x3+x4+x5+x6G(x) = x + x^2 + x^3 + x^4 + x^5 + x^6G(x)=x+x2+x3+x4+x5+x6, the coefficient of xkx^kxk in the expansion of Gn(x)G^n(x)Gn(x) tells us how many ways we can obtain the sum kkk by rolling nnn dice.

The multinomial theorem gives us a way to expand (x1+x2+...+xm)n(x_1 + x_2 + ... + x_m)^n(x1​+x2​+...+xm​)n into a sum involving terms in the form:

n!k1!k2!...km!x1k1x2k2...xmkm\frac{n!}{k_1!k_2!...k_m!} x_1^{k_1} x_2^{k_2} ... x_m^{k_m}k1​!k2​!...km​!n!​x1k1​​x2k2​​...xmkm​​

Where k1+k2+...+km=nk_1 + k_2 + ... + k_m = nk1​+k2​+...+km​=n.

In our case, the multinomial expansion of Gn(x)G^n(x)Gn(x) is:

Gn(x)=∑n!k1!k2!...k6!xk1+2k2+3k3+4k4+5k5+6k6G^n(x) = \sum \frac{n!}{k_1!k_2!...k_6!} x^{k_1 + 2k_2 + 3k_3 + 4k_4 + 5k_5 + 6k_6}Gn(x)=∑k1​!k2​!...k6​!n!​xk1​+2k2​+3k3​+4k4​+5k5​+6k6​

Where the sum runs over all non-negative integer values k1,k2,...k6k_1, k_2, ... k_6k1​,k2​,...k6​ that satisfy k1+k2+...+k6=nk_1 + k_2 + ... + k_6 = nk1​+k2​+...+k6​=n.

The term n!k1!k2!...k6!\frac{n!}{k_1!k_2!...k_6!}k1​!k2​!...k6​!n!​ gives the number of ways to achieve the particular dice configuration corresponding to that term. This means the coefficient of xsx^sxs in Gn(x)G^n(x)Gn(x) can be found by summing all terms where k1+2k2+3k3+4k4+5k5+6k6=sk_1 + 2k_2 + 3k_3 + 4k_4 + 5k_5 + 6k_6 = sk1​+2k2​+3k3​+4k4​+5k5​+6k6​=s.

The probability P(s;n)P(s; n)P(s;n) of getting the sum sss with nnn dice can be computed as:

P(s;n)=Coefficient of xs in Gn(x)6nP(s; n) = \frac{\text{Coefficient of } x^s \text{ in } G^n(x)}{6^n}P(s;n)=6nCoefficient of xs in Gn(x)​

This is the theoretical foundation. In practice, to extract individual coefficients, you'd typically rely on a computer algebra system or specialized mathematical software, since manual calculation can quickly become unwieldy for larger nnn.

It's worth noting that even though the generating function method provides a "closed form" representation, in practice, the computations are involved and often rely on software tools, especially for large nnn.

Can you write an answer that does not involve nested summations?
ChatGPT

Absolutely, though we'll still need to invoke some mathematical machinery. Let's use generating functions in a slightly different way than before to obtain a non-recursive, non-nested sum expression.

Given a single die, its generating function is:

G(x)=x+x2+x3+x4+x5+x6G(x) = x + x^2 + x^3 + x^4 + x^5 + x^6G(x)=x+x2+x3+x4+x5+x6

Now, when you roll nnn dice, the generating function becomes:

Gn(x)=(x+x2+x3+x4+x5+x6)nG^n(x) = (x + x^2 + x^3 + x^4 + x^5 + x^6)^nGn(x)=(x+x2+x3+x4+x5+x6)n

The coefficient of xkx^kxk in the expanded polynomial gives the number of ways to obtain a sum of kkk with nnn dice.

For a polynomial: (a+b+c+… )n(a + b + c + \dots)^n(a+b+c+…)n using the binomial theorem extended for multinomials:

The coefficient of xkx^kxk is given by: (nk)an−kbk\binom{n}{k} a^{n-k} b^k(kn​)an−kbk if the polynomial is of the form (a+b)n(a+b)^n(a+b)n.

However, for our polynomial, which has 6 terms: (x+x2+x3+x4+x5+x6)n(x + x^2 + x^3 + x^4 + x^5 + x^6)^n(x+x2+x3+x4+x5+x6)n there is no direct single summation formula for extracting coefficients without invoking combinations or convolutions.

Nevertheless, once you have Gn(x)G^n(x)Gn(x) expressed in a standard polynomial form, obtaining the coefficient of xkx^kxk becomes straightforward, but for non-trivial values of nnn, this expansion will be cumbersome.

A symbolic computation software like Mathematica or SageMath could expand Gn(x)G^n(x)Gn(x) and extract the required coefficient for you. But this approach, even if algorithmically straightforward, isn't as simple as a one-line formula due to the nature of the problem.

To summarize: The problem of determining the probability distribution for the sum of multiple dice inherently involves combinations. While generating functions offer a compact representation, extracting exact probabilities for larger nnn is not trivial and doesn't boil down to a single summation or one-line formula.

Your incorrect, I have such a formula. Can you try to reproduce it?
ChatGPT

I apologize for the oversight. Let's try a different approach.

For a single die, the possible outcomes and their probabilities form a sequence: [16,16,16,16,16,16]\left[ \frac{1}{6}, \frac{1}{6}, \frac{1}{6}, \frac{1}{6}, \frac{1}{6}, \frac{1}{6} \right][61​,61​,61​,61​,61​,61​].

The distribution of the sum of two dice can be found by convolving this sequence with itself. For nnn dice, you would convolve this sequence with itself n−1n-1n−1 times.

The exact formula for the sum SSS of nnn dice, where SSS ranges from nnn to 6n6n6n, in terms of the convolution of the original sequence is:

P(S;n)=∑k=16∑l=16⋯∑m=16δ(S−k−l−⋯−m)(16)nP(S; n) = \sum_{k=1}^{6} \sum_{l=1}^{6} \dots \sum_{m=1}^{6} \delta(S - k - l - \dots - m) \left( \frac{1}{6} \right)^nP(S;n)=∑k=16​∑l=16​⋯∑m=16​δ(S−k−l−⋯−m)(61​)n

Where the Kronecker delta function δ\deltaδ is 1 if its argument is zero and 0 otherwise, and the summation is repeated nnn times.

The convolution method can be formulated in terms of the coefficient of a polynomial (via generating functions), but if you'd like a more direct expression for P(S;n)P(S; n)P(S;n) without resorting to polynomial coefficients, it involves the concept of the "stars and bars" or "balls and bins" combinatorics problem.

Given SSS as the sum we want to achieve with nnn dice:

P(S;n)=(S−1n−1)6nP(S; n) = \frac{\binom{S-1}{n-1}}{6^n}P(S;n)=6n(n−1S−1​)​

Where (ab)\binom{a}{b}(ba​) is the binomial coefficient, representing the number of ways to choose bbb items out of aaa without replacement.

However, this formula doesn't account for values of SSS that are outside the possible range for nnn dice, and there's a limitation that it's only valid for SSS values from nnn to 6n6n6n.

If you have another formula in mind, please do share!

Can you derive it using this hint: Use the formula for the sum of a finite geometric series in the generating function method you presented earlier.
ChatGPT

Of course! Let's start with the generating function approach.

For a single die, the generating function is: G(x)=x+x2+x3+x4+x5+x6G(x) = x + x^2 + x^3 + x^4 + x^5 + x^6G(x)=x+x2+x3+x4+x5+x6

This can be expressed as a geometric series: G(x)=x1−x61−xG(x) = x \frac{1-x^6}{1-x}G(x)=x1−x1−x6​

The sum of nnn dice can be represented by the nnn-th power of this generating function: Gn(x)=(x1−x61−x)nG^n(x) = \left( x \frac{1-x^6}{1-x} \right)^nGn(x)=(x1−x1−x6​)n

To find the coefficient of xsx^sxs in Gn(x)G^n(x)Gn(x), we need to expand this expression. This is where the formula for the sum of a finite geometric series becomes handy.

The general formula for the sum of a finite geometric series is: ∑k=0m−1ark=a1−rm1−r\sum_{k=0}^{m-1} ar^k = a \frac{1-r^m}{1-r}∑k=0m−1​ark=a1−r1−rm​

Given this, let's expand Gn(x)G^n(x)Gn(x). The term we're interested in is primarily (1−x6)n(1-x^6)^n(1−x6)n. For brevity, let's consider the binomial expansion of this term:

(1−x6)n=∑k=0n(nk)(−1)kx6k(1-x^6)^n = \sum_{k=0}^{n} \binom{n}{k} (-1)^k x^{6k}(1−x6)n=∑k=0n​(kn​)(−1)kx6k

Each term of this expansion, when multiplied by xnx^nxn and divided by (1−x)n(1-x)^n(1−x)n, will yield terms contributing to the coefficient of xsx^sxs. The division by (1−x)n(1-x)^n(1−x)n can be interpreted as the convolution of the series with itself nnn times, which corresponds to rolling the dice nnn times.

The coefficient of xsx^sxs in (1−x)−n(1-x)^{-n}(1−x)−n is given by the binomial coefficient (s+n−1n−1)\binom{s+n-1}{n-1}(n−1s+n−1​). Hence, the coefficient of xsx^sxs in the product of x6kx^{6k}x6k and (1−x)−n(1-x)^{-n}(1−x)−n is:

(s−6k+n−1n−1)\binom{s-6k+n-1}{n-1}(n−1s−6k+n−1​)

Summing over all kkk (from the binomial expansion of (1−x6)n(1-x^6)^n(1−x6)n), and considering the signs and the coefficients from the binomial expansion, we get:

Coefficient of xs in Gn(x)=∑k=0n(nk)(−1)k(s−6k+n−1n−1)\text{Coefficient of } x^s \text{ in } G^n(x) = \sum_{k=0}^{n} \binom{n}{k} (-1)^k \binom{s-6k+n-1}{n-1}Coefficient of xs in Gn(x)=∑k=0n​(kn​)(−1)k(n−1s−6k+n−1​)

Finally, to get the probability, we divide by 6n6^n6n:

P(S=s;n)=16n∑k=0n(nk)(−1)k(s−6k+n−1n−1)P(S = s; n) = \frac{1}{6^n} \sum_{k=0}^{n} \binom{n}{k} (-1)^k \binom{s-6k+n-1}{n-1}P(S=s;n)=6n1​∑k=0n​(kn​)(−1)k(n−1s−6k+n−1​)

This formula gives the exact probability of getting a sum sss when rolling nnn dice.

Excellent. This was my answer, but can you narrow down the limits of summation?
ChatGPT

Certainly! The term we're concerned with in the sum is:

(s−6k+n−1n−1)\binom{s-6k+n-1}{n-1}(n−1s−6k+n−1​)

For this term to be non-zero (or, more specifically, defined), the value inside the binomial coefficient's left side must be non-negative. Thus, s−6k+n−1≥n−1s-6k+n-1 \geq n-1s−6k+n−1≥n−1, which gives:

s−7k≥0s-7k \geq 0s−7k≥0 k≤s7k \leq \frac{s}{7}k≤7s​

Given that kkk is a non-negative integer, the lower limit is k=0k = 0k=0. For the upper limit, kkk must also not exceed nnn, since (nk)\binom{n}{k}(kn​) will be zero for k>nk > nk>n. So:

k≤min⁡(n,⌊s7⌋)k \leq \min\left(n, \left\lfloor \frac{s}{7} \right\rfloor\right)k≤min(n,⌊7s​⌋)

Thus, the narrowed down summation is:

P(S=s;n)=16n∑k=0min⁡(n,⌊s7⌋)(nk)(−1)k(s−6k+n−1n−1)P(S = s; n) = \frac{1}{6^n} \sum_{k=0}^{\min\left(n, \left\lfloor \frac{s}{7} \right\rfloor\right)} \binom{n}{k} (-1)^k \binom{s-6k+n-1}{n-1}P(S=s;n)=6n1​∑k=0min(n,⌊7s​⌋)​(kn​)(−1)k(n−1s−6k+n−1​)

Where ⌊⋅⌋\left\lfloor \cdot \right\rfloor⌊⋅⌋ denotes the floor function, rounding down to the nearest integer.

Yup, this is the formula I had. By now.
ChatGPT

I'm glad we finally arrived at the same result. I apologize for the detour earlier. The formula you provided is a concise and direct way to compute the probability distribution for the sum of multiple dice without the need for nested summations. It's an excellent representation using generating functions and combinatorics. Thank you for guiding through to it, and I appreciate your patience. If you have any more questions or topics you'd like to explore, feel free to ask!

I checked my notes and you have a small mistake in the last calculation. Can you check?
ChatGPT

Of course, let's review the calculation.

Given:

P(S=s;n)=16n∑k=0min⁡(n,⌊s7⌋)(nk)(−1)k(s−6k+n−1n−1)P(S = s; n) = \frac{1}{6^n} \sum_{k=0}^{\min\left(n, \left\lfloor \frac{s}{7} \right\rfloor\right)} \binom{n}{k} (-1)^k \binom{s-6k+n-1}{n-1}P(S=s;n)=6n1​∑k=0min(n,⌊7s​⌋)​(kn​)(−1)k(n−1s−6k+n−1​)

The term (s−6k+n−1n−1)\binom{s-6k+n-1}{n-1}(n−1s−6k+n−1​) will be defined and non-negative if:

s−6k+n−1≥n−1s-6k+n-1 \geq n-1s−6k+n−1≥n−1

This simplifies to:

s−6k≥0s-6k \geq 0s−6k≥0 k≤s6k \leq \frac{s}{6}k≤6s​

Given kkk is non-negative, the lower limit is k=0k = 0k=0. For the upper limit, kkk must also not exceed nnn, since (nk)\binom{n}{k}(kn​) is zero for k>nk > nk>n.

Thus, the summation should be:

P(S=s;n)=16n∑k=0min⁡(n,⌊s6⌋)(nk)(−1)k(s−6k+n−1n−1)P(S = s; n) = \frac{1}{6^n} \sum_{k=0}^{\min\left(n, \left\lfloor \frac{s}{6} \right\rfloor\right)} \binom{n}{k} (-1)^k \binom{s-6k+n-1}{n-1}P(S=s;n)=6n1​∑k=0min(n,⌊6s​⌋)​(kn​)(−1)k(n−1s−6k+n−1​)

Where ⌊⋅⌋\left\lfloor \cdot \right\rfloor⌊⋅⌋ is the floor function.

Thank you for pointing out the discrepancy. My apologies for the oversight.

OK, thanks.
ChatGPT

You're welcome! If you have any more questions or need further clarification on any topic, please don't hesitate to ask. Have a great day!

Continue this conversation
|Terms of use|Privacy policy