Here is the code, apologize for the delay. Yes it is also a bunch of noise where the problem asks;
Make a plot of your data in DataSet1 vs. row number. From your plot, estimate the standard deviation of your data, i.e. how far the points scatter from the average and record your value. Now write a program to calculate the standard deviation (don’t use built in functions this time). Discuss how well your estimate matches your calculated value. Every time we make a measurement, a value of the noise gets determined at random. This is a bit like quantum mechanics, where when we make a measurement of, say, position, the value is determined randomly. In quantum mechanics the probability of measuring different positions is drawn from a probability distribution given by the complex square of the wave function, P(x) = |Ψ|^2, so that the probability of measuring a position between x1 and x2 is given by the area under the P(x) curve between x1 and x2
Make a plot of your data in DataSet1 vs. row number. From your plot, estimate the standard deviation of your data, i.e. how far the points scatter from the average and record your value. Now write a program to calculate the standard deviation (don’t use built in functions this time). Discuss how well your estimate matches your calculated value. Every time we make a measurement, a value of the noise gets determined at random. This is a bit like quantum mechanics, where when we make a measurement of, say, position, the value is determined randomly. In quantum mechanics the probability of measuring different positions is drawn from a probability distribution given by the complex square of the wave function, P(x) = |Ψ|^2, so that the probability of measuring a position between x1 and x2 is given by the area under the P(x) curve between x1 and x2
#Worksheet 1.3A - make plot of DataSet vs row Nums from numpy import * from matplotlib.pyplot import * import matplotlib.pyplot as plt variance = 0.0 standDev = 0.0 summ = 0 sum_sq = 0 average = 0 textFile = open('DataSet1.dat','r') file = textFile.readlines() dataSet = [float(i) for i in file] for i in range(0, len(dataSet)): array1[i] = file.readline() average += (sum(array1)/len(array1) print("The average is:", average) plt.xlabel('x axis') plt.ylabel('y axis') plt.title('Plot of DataSet vs Row Numbers') plt.plot(dataSet) plt.show()