Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
import numpy as np

from scipy.stats import norm
from scipy.stats import chi2


chat_id = 123456 # Ваш chat ID, не меняйте название переменной
chat_id = 712443973 # Ваш chat ID, не меняйте название переменной

def solution(p: float, x: np.array) -> tuple:
# Измените код этой функции
# Это будет вашим решением
# Не меняйте название функции и её аргументы
alpha = 1 - p
loc = x.mean()
scale = np.sqrt(np.var(x)) / np.sqrt(len(x))
return loc - scale * norm.ppf(1 - alpha / 2), \
loc - scale * norm.ppf(alpha / 2)
length = len(x)
return np.sqrt(sum(x ** 2) / (13 * chi2.ppf((1 + p) / 2, df = 2 * length))), \
np.sqrt(sum(x ** 2) / (13 * chi2.ppf((1 - p) / 2, df = 2 * length)))