Roll 5 12-sided fair die with faces numbered 0 to 11. Expected value of second highest value rolled?

The problem's question: What is the expected value of the second highest value rolled of five dodecahedron (12-sided) fair die with faces numbered 0 to 11?

The procedure to determine the second highest value is to sort the rolled values into descending order and then select the second value in the list. This means that the selected value may, in fact, duplicate the highest value rolled. This is, nonetheless, the correct selection.

Write the answer as a reduced fraction . 1 000 000 × numerator + denominator 1\,000\,000\times\text{numerator}+\text{denominator} is the value to be given as the answer.

If the answer were 76543 65432 \frac{76543}{65432} (it is not) , then enter 76543065432.


The answer is 77759010368.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Yuriy Kazakov
Jun 28, 2019

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import random
def add(xx, yy):
    return list(map(lambda a, b: a + b, xx, yy))
x=[0,1,2,3,4,5,6,7,8,9,10,11]
n=100
cc=[0,0,0,0,0]
p=[0,0,0,0,0]
#monte carlo part
for i in range(n):
   for k in range(5):
     p[k]=x[random.randint(0,11)]
   c=sorted(p)
   cc=add(cc,c)
for k in range(5):
  print (cc[k]/float(n))
#analitic part
cc=[0,0,0,0,0]
for x1 in x:
  for x2 in x:
    for x3 in x:
      for x4 in x:
        for x5 in x:
          c=sorted([x1,x2,x3,x4,x5])
          cc=add(cc,c)
print(cc)
for k in range(5):
  print (cc[k]/float(12*12*12*12*12))

I use Python.

Expectation [ x , x OrderDistribution [ { DiscreteUniformDistribution [ { 0 , 11 } ] , 5 } , 4 ] ] \text{Expectation}[x,x\overset{\sim}{\sim}\text{OrderDistribution}[\{\text{DiscreteUniformDistribution}[\{0,11\}],5\},4]]

or

Mean [ Table [ Sort [ t ] [ [ 4 ] ] , { t , Tuples [ Range [ 0 , 11 ] , 5 ] } ] ] \text{Mean}[\text{Table}[\text{Sort}[t][[4]],\{t,\text{Tuples}[\text{Range}[0,11],5]\}]]

In either case the reduced fraction is 77759 10368 \frac{77759}{10368} .

Care to explain what these codes represent and how they are constructed?

Pi Han Goh - 2 years ago

They are Wolfram Mathematica expressions and complete descriptions of the computation. For example, doing a Google search on Mathematica Tuples yields the URL https://reference.wolfram.com/language/ref/Tuples.html which describes the Tuples command.

The first line is an executable functional description of the problem.

The second line reads from inside-out: compute all combinations (tuples) of integers going from 0 to 11 with 5 members in each tuple, make a table of each individual tuple sorted into ascending order and select the fourth (next to last) element of the sorted tuple [this computes the second highest value per the problem's description of how to compute the second highest] and compute the mean of the resultant table. The use of rational arithmetic is implicit. Wolfram Mathematica automatically reduces rational fractions.

Log in to reply

Log in to reply

Because Wolfram/Alpha isn't Wolfram Mathematica. In particular, they do not accept the same input language. The Wolfram/Alpha input language is less capable and more forgiving than Wolfram Mathematica's input language.

Wolfram Mathematica at low cost and for higher cost for PCs.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...