# Hypothesis testing for the sum of 100 tosses of a fair die

Suppose you have a fair 6-sided die. You toss the die 100 times and sum up the values. I claim that the sum of the 100 tosses is 400. Will you believe me?

I don't know of a good way to compute the probability of the sum of 100 tosses being 400. The only exact way that I know of is using generating functions, but I'm not well versed in that area. An approximate method is to use CLT and integrate a normal distribution with a continuity correct factor. A monte carlo simulation with 1 million trials shows that the probability is about 0.0003. Let's just pretend this is the exact result since that's not the focus of this question.

I would like to apply hypothesis testing to this problem, but I'm kind of confused on what the null and alternate hypothesis should be. In the few times that I've worked with hypothesis testing, it was to test against the null hypothesis that the mean of the distribution is true, which in this case is 350. But it seems we're not testing means here. We're testing whether my claim that the sum of 100 tosses is 400 is believable.

In my case should the null hypothesis be $$H_0 : Y = X_1 + \ldots + X_{100} = 400$$ where $$X_i \sim U( 1, 6)$$. If so, then the alternate hypothesis is $$H_a: Y \neq 400$$. If this is the case, then my p-value is going to be almost 1 since there's a very small probability that we're going to see $$Y = 400$$. In the times that I've used hypothesis testing, we want a smaller value to reject a null hypothesis. But with the way things are defined here, it seems we'd want a higher p-value. The other issue is I don't actually appear to be conducting any experiments for my test statistic, $$Y$$. All I'm doing is saying that there's a tiny chance $$Y = 400$$, hence we should reject the null hypothesis.

So, I guess the questions that I have are:

(1) What should the null and alternate hypothesis be here?

(2) What does the p-value in this case represent, and do we desire a smaller or higher p-value in this situation? (I think the answer is dependent on the answer to (1)).

(3) This is probably a dumb question, but my proposal above doesn't actually involve computing a value for the test statistic, $$Y$$. Like, e.g., in another hypothesis test we could claim that $$H_0: \mu_{Y} = 350$$ and $$H_a: \mu_Y \neq 350$$ and observe that $$Y = 400$$, and then use this $$Y = 400$$ to compute our p-value using a two-tailed test. Do we need some realization of $$Y$$ for the current problem?

Two useful approximations:

(1) A normal approximation to the sum of 100 rolls of a die based on $$\mu = 3.5, \sigma^2 = 2.916667$$ for one roll should give a useful answer. [Related Q&A.]

(2) A simulation in R for the sum $$S_{100}$$ of 100 rolls gives the following results, showing that a sum as large as 400 would be very unlikely.

set.seed(513)
s = replicate(10^6, sum(sample(1:6, 100, rep=T)))
summary(s)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
271     338     350     350     362     431
mean(s >= 400)
[1] 0.001821


A histogram of a million simulated results illustrates that $$P(S_{100} \ge 400)$$ is small, and that a normal approximation is useful.

hist(s, prob=T, br=30, col="skyblue2", main="Sum of 100 Rolls of a Die")
abline(v = 400, lwd=2, lty="dotted")
curve(dnorm(x, mean(s), sd(s)), add=T, col="orange", lwd=2)


• Hmm, but I think this hypothesis test that you did is asking the question if the sum of 100 tosses is significantly more than 350 or not? In other words, $H_0: S_{100} = 350$ and $H_a: S_{100} > 350$? May 14, 2021 at 9:25
• I purposely did not frame my answer as a test of hypothesis. Strictly speaking the hypothesis should come before the observation. "I got 400. Will you believe me?" does not lead to a proper test. I don't doubt you could have gotten 400<600, if you say so. (I might wonder if your die is fair and randomly tossed.) In my simulation of a million 100-roll experiments I got max 431. and exactly 334 times in a million I got exactly score 400. All I'm saying is someone who's contemplating doing 100 careful rolls of a fair die has a very small chance of getting a score 400 or more May 14, 2021 at 18:16