This commit is contained in:
2025-12-23 13:24:45 +03:00
parent 2fd24df06a
commit dad29d4e7d
2 changed files with 531 additions and 0 deletions

31
exam/main.py Normal file
View File

@@ -0,0 +1,31 @@
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
def main() -> None:
data = np.array([float(v) for v in open("data.csv", 'r')])
n = len(data)
x_m = data.mean()
s_0 = data.var(ddof=1)
plt.figure()
plt.hist(data, bins = 10, density=True, edgecolor='black')
a, b = np.histogram(data, bins=10)
print(a)
plt.show()
tau = norm.ppf(0.975)
theta_minus = x_m - tau * np.sqrt(s_0 / n)
print(theta_minus)
theta_plus = x_m + tau * np.sqrt(s_0 / n)
print(theta_plus)
if __name__ == "__main__":
main()