



from math import factorial



def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_  ,					SCREAMING_SNAKE_CASE_  ,					SCREAMING_SNAKE_CASE_					):
   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"					)
   lowercase__   					=			(prob**successes) * ((1 - prob) ** (trials - successes))
   # Calculate the binomial coefficient: n! / k!(n-k)!
   lowercase__   					=			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))









def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_					):
			lowercase__   					=			int(SCREAMING_SNAKE_CASE_					)
			if decimal in (0, 1):  # Exit cases for the recursion
						return str(SCREAMING_SNAKE_CASE_					)
			lowercase__					,    lowercase__   					=			divmod(SCREAMING_SNAKE_CASE_  ,					2					)
			return binary_recursive(SCREAMING_SNAKE_CASE_					) + str(SCREAMING_SNAKE_CASE_					)



def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_					):
			lowercase__   					=			str(SCREAMING_SNAKE_CASE_					).strip()
			if not number:
						raise ValueError("No input value was provided"					)
			lowercase__   					=			"-" if number.startswith("-"					) else ""
			lowercase__   					=			number.lstrip("-"					)
			if not number.isnumeric():
						raise ValueError("Input value is not an integer"					)
			return f'''{negative}0b{binary_recursive(int(SCREAMING_SNAKE_CASE_					)					)}'''


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

							testmod()




