Let the numbers be x1,x2,x3,x4. First calculate the mean of the given numbers. Let the mean be "X". Then calculate mod(X-x1),mod(X-x2),mod(X-x3),mod(X-x4). Add all these modulus terms and divide them by number of terms i.e., 4 in this case. You can take any number of numbers and do this. Hope this helped.