






from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

lowercase  							=					typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
lowercase  							=					typing.Union[np.floataa, int, float]  # noqa: UP007





def 						__UpperCAmelCase			(     a_							,     a_):
							return np.sqrt(np.sum((np.asarray(a_) - np.asarray(a_)) ** 2))





def 						__UpperCAmelCase			(     a_							,     a_):
							return sum((va - va) ** 2 for va, va in zip(a_							,     a_)) ** (1 / 2)


if __name__ == "__main__":





	def 						__UpperCAmelCase			(     ):
								from timeit import timeit

								print('Without Numpy')
								print(
								    timeit(
								        'euclidean_distance_no_np([1, 2, 3], [4, 5, 6])'							,     number=1_00_00							,     globals=globals()							,     ))
								print('With Numpy')
								print(
								    timeit(
								        'euclidean_distance([1, 2, 3], [4, 5, 6])'							,     number=1_00_00							,     globals=globals()							,     ))




	benchmark()










from math import factorial
def        lowercase_							(A : int		,					A : int		,					A : float      ):
       if successes > trials:
              raise ValueError('successes must be lower or equal to trials'      )
       if trials < 0 or successes < 0:
              raise ValueError('the function is defined for non-negative integers'      )
       if not isinstance(A		,					A      ) or not isinstance(A		,					A      ):
              raise ValueError('the function is defined for non-negative integers'      )
       if not 0 < prob < 1:
              raise ValueError('prob has to be in range of 1 - 0'      )
       snake_case__							:	List[Any]   	=	(prob**successes) * ((1 - prob) ** (trials - successes))
       # Calculate the binomial coefficient: n! / k!(n-k)!
       snake_case__							:	List[str]   	=	float(factorial(A      )      )
       coefficient /= factorial(A      ) * factorial(trials - successes      )
       return probability * coefficient


if __name__ == "__main__":
 from doctest import testmod

 testmod()
 print("Probability of 2 successes out of 4 trails")
 print("with probability of 0.75 is:", end=" ")
 print(binomial_distribution(2, 4, 0.75))






