
from itertools import product






def 				UpperCAmelCase_						(				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE				):
	lowercase	    =       sides_number
	lowercase	    =       max_face_number * dice_number
	lowercase	    =       [0] * (max_total + 1)

	lowercase	    =       1
	lowercase	    =       range(__SCREAMING_SNAKE_CASE					,				max_face_number + 1				)
	for dice_numbers in product(__SCREAMING_SNAKE_CASE					,				repeat=__SCREAMING_SNAKE_CASE				):
		lowercase	    =       sum(__SCREAMING_SNAKE_CASE				)
		totals_frequencies[total] += 1

	return totals_frequencies






def 				UpperCAmelCase_						(				):
	lowercase	    =       total_frequency_distribution(
	    sides_number=4					,				dice_number=9				)
	lowercase	    =       total_frequency_distribution(
	    sides_number=6					,				dice_number=6				)

	lowercase	    =       0
	lowercase	    =       9
	lowercase	    =       4 * 9
	lowercase	    =       6
	for peter_total in range(__SCREAMING_SNAKE_CASE					,				max_peter_total + 1				):
		peter_wins_count += peter_totals_frequencies[peter_total] * sum(
		    colin_totals_frequencies[min_colin_total:peter_total]				)

	lowercase	    =       (4**9) * (6**6)
	lowercase	    =       peter_wins_count / total_games_number

	lowercase	    =       round(__SCREAMING_SNAKE_CASE					,				ndigits=7				)

	return rounded_peter_win_probability


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





"""simple docstring"""


from __future__ import annotations

import math

import numpy as np
from numpy.linalg import norm


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			return math.sqrt(sum(pow(a - b       ,					2 ) for a, b in zip(_UpperCamelCase       ,					_UpperCamelCase ) ) )


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			if dataset.ndim != value_array.ndim:
						__lowerCAmelCase							       =     (
						    "Wrong input data's dimensions... "
						    f"dataset : {dataset.ndim}, value_array : {value_array.ndim}"
						)
						raise ValueError(_UpperCamelCase )

			try:
						if dataset.shape[1] != value_array.shape[1]:
									__lowerCAmelCase							       =     (
									    "Wrong input data's shape... "
									    f"dataset : {dataset.shape[1]}, value_array : {value_array.shape[1]}"
									)
									raise ValueError(_UpperCamelCase )
			except IndexError:
						if dataset.ndim != value_array.ndim:
									raise TypeError("Wrong shape" )

			if dataset.dtype != value_array.dtype:
						__lowerCAmelCase							       =     (
						    "Input data have different datatype... "
						    f"dataset : {dataset.dtype}, value_array : {value_array.dtype}"
						)
						raise TypeError(_UpperCamelCase )

			__lowerCAmelCase							       =     []

			for value in value_array:
						__lowerCAmelCase							       =     euclidean(_UpperCamelCase       ,					dataset[0] )
						__lowerCAmelCase							       =     dataset[0].tolist()

						for dataset_value in dataset[1:]:
									__lowerCAmelCase							       =     euclidean(_UpperCamelCase       ,					_UpperCamelCase )

									if dist > temp_dist:
												__lowerCAmelCase							       =     temp_dist
												__lowerCAmelCase							       =     dataset_value.tolist()

						answer.append([vector, dist] )

			return answer


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			return np.dot(_UpperCamelCase       ,					_UpperCamelCase ) / (norm(_UpperCamelCase ) * norm(_UpperCamelCase ))


if __name__ == "__main__":
	import doctest

	doctest.testmod()




