


from math import factorial

def 			lowerCAmelCase__					(     a__:						int     ,    a__:						Union[str, Any]     ,    a__:						Union[str, Any]			)    ->						Any:


							'''simple docstring'''





							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'			)
							_UpperCAmelCase											=     (prob**successes) * ((1 - prob) ** (trials - successes))
							# Calculate the binomial coefficient: n! / k!(n-k)!
							_UpperCAmelCase											=     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))



import math


def 					_UpperCAmelCase				(						a__ = 1_0_0):

			'''simple docstring'''



			a_						:						List[str] 							= sum(i * i for i in range(1  ,	n + 1))
			a_						:						Optional[Any] 							= int(math.pow(sum(range(1  ,	n + 1))  ,	2))
			return square_of_sum - sum_of_squares


if __name__ == "__main__":
	print(F"""{solution() = }""")


