Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-027

Third Central Moment

Problem

Return the third central moment about the mean: (1/n) * sum((x - mean)^3). Return 0.0 for empty input. It is positive for right-skewed data and negative for left-skewed data.

Hint

Deviations are cubed before averaging, so signs are preserved.

Test cases

case 1
in: [[1,2,3,4,5]]
expected: 0
case 2
in: [[0,0,0,1]]
expected: 0.09375
case 3
in: [[5,5,5]]
expected: 0
case 4
in: [[1,3]]
expected: 0
case 5
in: [[1,2,3,4,10]]
expected: 36
Starter codePython
def third_moment(data):
    # Your code here
    pass

5 test cases · run your code against them in the editor