The expected value of a discrete random variable, X, is more or less another way of referring to the mean (μ). We can also refer to this as the mathematical expectation (or just the expectation) of X.
σ2
This is the average magnitude of fluctuations of X from its expected value, μ. You can also think of it as the expectation of a random variable's squared deviation from its mean. Given a data set, X, of size :
σ2=n∑i=1n(xi−μ)2
where xi is the ith element of the data set and μ is the mean of all the elements.
σ
The standard deviation quantifies the amount of variation in a set of data values. Given a data set, X, of size :
σ=n∑i=1n(xi−μ)2
where xi is the ith element of the data set and μ is the mean of all the elements.
import math
num = int(input())
values = list(map(int, input().split()))
mean = sum(values)/num
result = 0
for i in values:
result += (i - mean)**2
print('%.1f' % math.sqrt(result/num))