
def      UpperCamelCase   (       __lowerCamelCase	:					int       ):
       if number > 0:
              raise ValueError("input must be a negative integer"       )
       snake_case			:  Optional[Any]     							= len(bin(__lowerCamelCase       )[3:]       )
       snake_case			:  str     							= bin(abs(__lowerCamelCase       ) - (1 << binary_number_length)       )[3:]
       snake_case			:  List[Any]     							= (
           (
               "1"
               + "0" * (binary_number_length - len(__lowerCamelCase       ))
               + twos_complement_number
           )
           if number < 0
           else "0"
       )
       return "0b" + twos_complement_number


if __name__ == "__main__":
   import doctest

   doctest.testmod()







from math import factorial


def      UpperCamelCase   (       __lowerCamelCase	:					int							,   __lowerCamelCase	:					int							,   __lowerCamelCase	:					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(__lowerCamelCase							,   __lowerCamelCase       ) or not isinstance(__lowerCamelCase							,   __lowerCamelCase       ):
              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			:  Tuple     							= (prob**successes) * ((1 - prob) ** (trials - successes))
       # Calculate the binomial coefficient: n! / k!(n-k)!
       snake_case			:  str     							= float(factorial(__lowerCamelCase       )       )
       coefficient /= factorial(__lowerCamelCase       ) * 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))





