From 550b6650fd6e7c78f6fbf00177c44bb8a6949e2b Mon Sep 17 00:00:00 2001 From: Kharlamov Victor <43378234+xapulc@users.noreply.github.com> Date: Sat, 25 Feb 2023 23:59:44 +0300 Subject: [PATCH] Update solution.py --- .idea/.gitignore | 8 ++++++++ .idea/inspectionProfiles/Project_Default.xml | 11 +++++++++++ .idea/vcs.xml | 6 ++++++ solution.py | 12 ++++++++---- 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..89d8a5d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/solution.py b/solution.py index dfb29b1..916a755 100644 --- a/solution.py +++ b/solution.py @@ -4,12 +4,16 @@ from scipy.stats import norm -chat_id = 123456 # Ваш chat ID, не меняйте название переменной +chat_id = 680977959 # Ваш chat ID, не меняйте название переменной def solution(p: float, x: np.array) -> tuple: # Измените код этой функции # Это будет вашим решением # Не меняйте название функции и её аргументы - alpha = 1 - p - return x.mean() - np.sqrt(np.var(x)) * norm.ppf(1 - alpha / 2) / np.sqrt(len(x)), \ - x.mean() - np.sqrt(np.var(x)) * norm.ppf(alpha / 2) / np.sqrt(len(x)) + alpha = (1 + p) / 2 + n = len(x) + xx = x * x + k = n / (25 * sum(xx)) + fp = norm.ppf(alpha) + + return k / (1 + fp), k / (1 - fp)