Patrick B. answered 02/26/19
Math and computer tutor/teacher
You may not assume the data set is sorted.
case 1: x < 4
then the median is 4, so (x+4+8)/3 = 4 , since the mean equals the median.
Then, (x+12)/3 = 4
x+12 = 12
x = 0
case 2: 4 < x < 8.
so (4+x+8)/3 = x, since the mean equals the median.
then, (x+12)/3 = x
x+12 = 3x
12 = 2x
x = 6
case 3: x>8
then the median is 8, so (x+4+8)/3 = 8 since the mean equals the median.
(x+12)/3 = 8
x+12 = 24
x = 12