




'''simple docstring'''





from itertools import product


def 					UpperCamelCase_(     snake_case							:	int							,    snake_case							:	int					):

							'''simple docstring'''






							snake_case_      =				sides_number
							snake_case_      =				max_face_number * dice_number
							snake_case_      =				[0] * (max_total + 1)

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

							return totals_frequencies


def 					UpperCamelCase_(     ):

							'''simple docstring'''






							snake_case_      =				total_frequency_distribution(
							    sides_number=4							,    dice_number=9					)
							snake_case_      =				total_frequency_distribution(
							    sides_number=6							,    dice_number=6					)

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

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

							snake_case_      =				round(snake_case							,    ndigits=7					)

							return rounded_peter_win_probability


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









'''simple docstring'''





from __future__ import annotations

import numpy as np


def 					UpperCamelCase_(     snake_case							:	np.ndarray					):

							'''simple docstring'''






							snake_case_ ,				snake_case_      =				np.shape(snake_case					)
							if rows != columns:
														snake_case_      =				(
														    "'table' has to be of square shaped array but got a "
														    f'{rows}x{columns} array:\n{table}'
														)
														raise ValueError(snake_case					)

							snake_case_      =				np.zeros((rows, columns)					)
							snake_case_      =				np.zeros((rows, columns)					)
							for i in range(snake_case					):
														for j in range(snake_case					):
																					snake_case_      =				sum(lower[i][k] * upper[k][j] for k in range(snake_case					)					)
																					if upper[j][j] == 0:
																												raise ArithmeticError("No LU decomposition exists"					)
																					snake_case_      =				(table[i][j] - total) / upper[j][j]
														snake_case_      =				1
														for j in range(snake_case							,    snake_case					):
																					snake_case_      =				sum(lower[i][k] * upper[k][j] for k in range(snake_case					)					)
																					snake_case_      =				table[i][j] - total
							return lower, upper


if __name__ == "__main__":
		import doctest

		doctest.testmod()




