Max value of random numbers

93 Views Asked by At

I have a dice with 100 sides. If I roll the dice n times, what will the maximum value of the n numbers statistically be?

Please keep it as simple as possible, as I want to turn the answer into an algorithm to calculate the value.

1

There are 1 best solutions below

0
On

Clues: Let $n = 10$ and $W_{10}$ be the maximum number seen in ten rolls of a fair $100$-sided die.

Then $P(W_{n} \le 95) = (.95)^{10} = 0.5987369,$ $P(W_{n} \le 94) = (.94)^{10} = 0.5386151,$ and $P(W_{10} = 95) = P(W_{10} \le 95) - P(W_{10} \le 94) = 0.06012183.$ [Following @lulu's Comment. Computations in R.]

.95^10;  .94^10;  .95^10 - .94^10
## 0.5987369
## 0.5386151
## 0.06012183

Also,

$$E(W_{10}) = \sum_{i=1}^{100} iP(W_{10}=i) = \sum_{i=0}^{100} [1 - P(X_{10} \le i)]= \sum_{i=0}^{100} [1-(i/100)^{10}] = 91.40076.$$

i=0:100;  sum(1 - (i/100)^n)
## 91.40076

Quantities such as those above can be approximated to about two decimal places by simulating a million ten-roll experiments. Simulation also facilitates making an approximate histogram of the distribution of $W_{10},$ for which the larger values are mainly above $W_{10} \approx 60.$ (While absolute simulation errors remain small for values below 60, relative errors may be quite large. $P(W_{10} = i) > 0,$ for $i = 1, 2, \dots, 100,$ but no values below 23 were observed during the simulation run shown.)

set.seed(622);  m = 10^6;  n = 10
w = replicate(m, max(sample(1:100, n, repl=T)))
pdf.95 = mean(w==95);  pdf.95
## 0.05988
mean(w);  sd(w)
## 91.40535
## 8.293265
lw = min(w); up = max(w); cutp=lw:(up+1)-.5
hist(w, prob=T, br=cutp, col="skyblue2")

enter image description here