Search HoldMyTwist

Browse all posts

Episode 19

The Giant Order

One huge order for soup got Duck wondering what a normal order is.

Episodes

Computing Basics

    Duck is watching the 5 order tickets in the monitor. Robot is outside with blank summary board.
    The robot will list the orders in ascending order of size. The sizes are 2, 3, 3, 4, and 18 bowls.
    The duck gazes at an enormous soup trolley next to the order for 18 bowls.
    The robot indicates five sorted out tickets, but doesn't show the summary answer.
    You start with a row, and it's sorted. You have 5 tickets in it. The duck picks one off each end. Do it once more with what's left. Now you're left with one in the middle.
    The duck puts 3 bowl symbols under the central ticket.
    The sum is thirty bowls.
    The robot divides 30/5 = 6. It compares the mean of 6 bowls vs the median of 3 bowls.
    The duck looks at both and the 5 order tickets are the same.
    Duck only affects the largest amount which goes from 18 bowls to 48 bowls.
    Robot takes outer pairs out.
    Duck divides sixty by five. That's twelve. Robot verifies the math.
    The mean changes from 6 to 12. The median is still 3.
    Duck shows you 4 tickets. 2, 3, 4 and 19. Median answer is still concealed.
    The robot spans three and four in the middle. The duck pushes the outer tickets aside.
    So the median is 3.5.
    The robot proves there is no 3.5 in the four actual order sizes.
    Robot chuckles outside next to the completed summary board.

    Episode transcript

    An unusual lunch rush

    Duck is watching the 5 order tickets in the monitor. Robot is outside with blank summary board.

    Diagram values: 2,3,3,4,18

    Duck: How much is the average person going to order for soup?

    The robot will list the orders in ascending order of size. The sizes are 2, 3, 3, 4, and 18 bowls.

    Diagram values: 2,3,3,4,18

    Robot: The sizes are 2, 3, 3, 4 and 18 bowls.

    The duck gazes at an enormous soup trolley next to the order for 18 bowls.

    Duck: 18?? This one came with a marching band.

    The robot indicates five sorted out tickets, but doesn't show the summary answer.

    Diagram values: 2,3,3,4,18

    Robot: What's the middle element in this sorted list?

    Find the middle order

    You start with a row, and it's sorted. You have 5 tickets in it. The duck picks one off each end. Do it once more with what's left. Now you're left with one in the middle.

    Diagram values: 2,3,[3],4,18

    Duck: Three in the middle.

    The duck puts 3 bowl symbols under the central ticket.

    Diagram values: MEDIAN: 3

    Robot: The middle value, which in this case is three bowls, is the median.

    The sum is thirty bowls.

    Diagram values: TOTAL: 30; ORDERS: 5

    Duck: But if you sum it, that's 30 bowls.

    The robot divides 30/5 = 6. It compares the mean of 6 bowls vs the median of 3 bowls.

    Diagram values: MEAN: 6; MEDIAN: 3

    Robot: 30 / 5 is 6. That's the mean.

    The duck looks at both and the 5 order tickets are the same.

    Diagram values: MEAN 6; MEDIAN 3

    Duck: Six and three talk about this order differently.

    The giant grows

    Duck only affects the largest amount which goes from 18 bowls to 48 bowls.

    Diagram values: 2,3,3,4,48

    Duck: So which summary is going to change? Is it going to be the mean? The median? Or maybe both?

    Robot takes outer pairs out.

    Diagram values: MEDIAN: 3

    Robot: Middle ticket remains at 3.

    Duck divides sixty by five. That's twelve. Robot verifies the math.

    Diagram values: 2 + 3 + 3 + 4 + 48 = 60; 60 / 5 = 12

    Duck: 60 is the sum, 12 is the mean.

    The mean changes from 6 to 12. The median is still 3.

    Diagram values: MEAN: 6 → 12; MEDIAN: 3 → 3

    Robot: If you replace eighteen with forty-eight, the median remains three, but the mean is now twelve.

    Four orders instead

    Duck shows you 4 tickets. 2, 3, 4 and 19. Median answer is still concealed.

    Diagram values: 2,3,4,19

    Duck: Where's the middle?

    The robot spans three and four in the middle. The duck pushes the outer tickets aside.

    Diagram values: MIDDLE: 3, 4

    Robot: If the number is even, it is the arithmetic mean of the two middle values.

    So the median is 3.5.

    Diagram values: MEDIAN: 3.5

    Duck: Average them out.

    The robot proves there is no 3.5 in the four actual order sizes.

    Diagram values: ORDERS: 2, 3, 4, 19; MEDIAN: 3.5

    Robot: The median does not have to be one of the actual order sizes.

    Robot chuckles outside next to the completed summary board.

    Duck: Good. Don't have to order half a bowl to make the maths work.

    The lesson

    The median is the value at the center of a sorted numeric data set. If the number of observations is odd, the median is the middle value. If the number is even, it is the arithmetic mean of the two middle values. The mean (arithmetic) of all the observations is the total divided by the number of observations. So in this example "two, three, three, four, eighteen" the median is three and the mean is six. If you replace eighteen with forty-eight, the median remains three, but the mean is now twelve. This illustrates that the mean can be strongly influenced by an outlying value more than the median is. It does not show that either summary is always "right".

    Try it

    Diagram values: INITIAL 1,2,4,5,28; CHANGED 1,2,4,5,48

    Find the median and arithmetic mean. Then change the twenty-eight into forty-eight. What happens?

    Answer

    Diagram values: INITIAL: MEDIAN4, MEAN8; CHANGED: MEDIAN4, MEAN12

    So the original one is mean = 8, median = 4, because initial central value is 4 and total is 40. The replacement of 28 with 48 leaves the middle as 4 and total as 60, therefore mean is 12.

    Sources

    Python statistics.median (opens in a new tab)

    Python statistics.mean (opens in a new tab)