diff --git a/practica/math/statistic/Number_square.py b/practica/math/statistic/Number_square.py new file mode 100644 index 0000000..736f058 --- /dev/null +++ b/practica/math/statistic/Number_square.py @@ -0,0 +1,3 @@ +# возвращаем квадрат из числа +def get_sqrt(x): + return x ** 0.5 \ No newline at end of file diff --git a/practica/math/statistic/Standard deviation.py b/practica/math/statistic/Standard deviation.py new file mode 100644 index 0000000..8a22e16 --- /dev/null +++ b/practica/math/statistic/Standard deviation.py @@ -0,0 +1,14 @@ +# Среднеквадратичное отклонение sd +list_data = [int(value) for value in input().split()] +n = len(list_data) +Sum = 0 +for value in list_data: + Sum += value + SUm=Sum/n +Sum = 0 +for value in list_data: + a = (value - SUm)**2 + Sum += a + D = (Sum / (n - 1 )) + sd = D ** 0.5 + print (sd) diff --git a/practica/math/statistic/average value.py b/practica/math/statistic/average value.py new file mode 100644 index 0000000..397e553 --- /dev/null +++ b/practica/math/statistic/average value.py @@ -0,0 +1,3 @@ + # среднее значение +def find_average(x): + return sum(x) / len(x) \ No newline at end of file diff --git a/practica/math/statistic/median.py b/practica/math/statistic/median.py new file mode 100644 index 0000000..46c3602 --- /dev/null +++ b/practica/math/statistic/median.py @@ -0,0 +1,6 @@ +# медиана +def find_median(x): + if len(x) % 2 == 0: + return (x[len(x) // 2] + x[len(x) // 2 -1]) / 2 + else: + return x[len(x) // 2] \ No newline at end of file diff --git a/practica/math/statistic/renge.py b/practica/math/statistic/renge.py new file mode 100644 index 0000000..8f8192e --- /dev/null +++ b/practica/math/statistic/renge.py @@ -0,0 +1,4 @@ +# размах +def find_range(x): + x_copy = sorted(x) + return abs(x_copy[-1] - x_copy[0]) \ No newline at end of file