The task is to plot a graph between Variance of sample means and population mean & give a graphical solution for the question whether the Variance of sample means depends on the population mean or not?
We can see in the 1st graph in the question, the range of population mean to be used is (-5, 5).
Hence I wrote:
samples_variable_mean = np.random.normal(loc=i, scale=1, size=(1000, 10))
According to the formula:
Var(X) = sigma^2/n
We can see that, Var(X) depends only on sigma, which I have kept as constant (scale=1). Hence, the graph of Var(X) v/s population mean should be a line parallel to x-axis:
y=c , where c=sigma^2/n
sigma=1, n=10 (n = size of each sample)
Hence, y = 0.1 (the desired graph given in the question post, which I am not getting)