Expected value of median of rolling three fair dice

  • Thread starter Master1022
  • Start date
  • #1
545
108
Homework Statement:
What is the expected value of the median of three dice rolls?
Relevant Equations:
Expected Values
Hi,

I was reading this problem and I found a solution on Math Stackexchange which I don't quite understand.

Question: Calculate the expected value of the median of rolling a die three times.

Attempt:
I read the following answer on math stack exchange here
"As already noted in a comment, the result can be derived from symmetry without any calculation. The probability distribution of the die is invariant under the symmetry transformation ##x \rightarrow 7 - x##, a reflection about ##x = \frac{7}{2}##. Thus the median and the mean must also be invariant under this transformation. Thus they must be the centre of the reflection, [itex] x =\frac{7}{2} [/itex] . "


I don't quite understand why this means the median of rolling three die is ##\frac{7}{2}##. I apologize if this is quite obvious, but any help would be appreciated
 

Answers and Replies

  • #2
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
18,296
9,971
The median of three dice would be ##21/2## by the same symmetry argument.
 
  • #3
545
108
The median of three dice would be ##21/2## by the same symmetry argument.
sure, but I thought the median was a non-linear operator, so how have we arrived at that answer?
 
  • #4
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
18,296
9,971
sure, but I thought the median was a non-linear operator, so how have we arrived at that answer?
Symmetry!

It doesn't have to be non-linear in all cases. It's only non-linear in general.
 
  • #5
545
108
The median of three dice would be ##21/2## by the same symmetry argument.
Sorry, I just realized I wasn't clear. When I said 3 dice rolls, I meant as in rolling the dice three times and then calculating the median of the sequence (e.g. 1, 2, 5 --> median = 2). I think 21/2 might not be correct as it is bigger than 6 so median of the three rolls shouldn't (and I dare say can't) be that...
 
  • #6
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
18,296
9,971
Sorry, I just realized I wasn't clear. When I said 3 dice rolls, I meant as in rolling the dice three times and then calculating the median of the sequence (e.g. 1, 2, 5 --> median = 2). I think 21/2 might not be correct as it is bigger than 6 so median of the three rolls shouldn't (and I dare say can't) be that...
Okay, of course, not added together. Then it's ##7/2## by the symmetry argument.

111 is as likely as 666
112 is as likely as 665
etc.

You ought to simulate this, with a computer script or otherwise, if you don't see it.
 
  • #7
545
108
Okay, of course, not added together. Then it's ##7/2## by the symmetry argument.

111 is as likely as 666
112 is as likely as 665
etc.

You ought to simulate this, with a computer script or otherwise, if you don't see it.
Yes that is true, I wrote a quick python simulation to test it and it does make sense now. Thanks @PeroK !

I'll just leave the code here for any future readers:
Expected Median of Three Dice Python Simulation:
# import libraries
import numpy as np

# define the number of repetitions
number_repetitions = 1000

# now make an array to store the medians
median_array = np.zeros(number_repetitions)

# start the loop
for i in range(number_repetitions):
  # get the outcomes of the three dice and append median to array
  median_array[i] = np.median(np.random.randint(low = 1, high = 7, size = (1, 3)))

print('The expected value of the median of three dice rolls is', np.average(median_array))
 

Related Threads on Expected value of median of rolling three fair dice

  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
2
Views
982
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
6
Views
3K
  • Last Post
Replies
1
Views
27K
  • Last Post
Replies
10
Views
1K
  • Last Post
Replies
7
Views
1K
  • Last Post
Replies
8
Views
1K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
2K
Top