



def       A_   (						__a  :					int			,		__a  :					int = 1_000		):

				"""simple docstring"""
				if (not isinstance(__a			,		__a		)) or (digit_position <= 0):
								raise ValueError("""Digit position must be a positive integer"""		)
				elif (not isinstance(__a			,		__a		)) or (precision < 0):
								raise ValueError("""Precision must be a nonnegative integer"""		)

				# compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
				# accurate
				a__					   =		(
				    4 * _subsum(__a			,		1			,		__a		)
				    - 2 * _subsum(__a			,		4			,		__a		)
				    - _subsum(__a			,		5			,		__a		)
				    - _subsum(__a			,		6			,		__a		)
				)

				# return the first hex digit of the fractional part of the result
				return hex(int((sum_result % 1) * 16		)		)[2:]

def       A_   (						__a  :					int			,		__a  :					int			,		__a  :					int		):

				"""simple docstring"""
				a__					   =		0.0
				for sum_index in range(digit_pos_to_extract + precision		):
								a__					   =		8 * sum_index + denominator_addend
								if sum_index < digit_pos_to_extract:
												# if the exponential term is an integer and we mod it by the denominator
												# before dividing, only the integer part of the sum will change;
												# the fractional part will not
												a__					   =		pow(
												    16			,		digit_pos_to_extract - 1 - sum_index			,		__a		)
								else:
												a__					   =		pow(16			,		digit_pos_to_extract - 1 - sum_index		)
								total += exponential_term / denominator
				return total


if __name__ == "__main__":
	import doctest

	doctest.testmod()







from __future__ import annotations

import random







class 		__UpperCAmelCase:





     """simple docstring"""



     __UpperCAmelCase						:			Optional[int]							=     6

     def __init__(   self			:							int     )      ->      Optional[Any]:






         """simple docstring"""
         a__  			=							list(range(1    ,					Dice.NUM_SIDES + 1     )     )






     def 					__SCREAMING_SNAKE_CASE		(   self			:							Union[str, Any]     )      ->      List[str]:






         """simple docstring"""
         return random.choice(self.sides     )






def 							__lowerCAmelCase			(UpperCAmelCase_ ,     UpperCAmelCase_ = 2		):
    a__  			=							[Dice() for i in range(UpperCAmelCase_		)]
    a__  			=							[0] * (len(UpperCAmelCase_		) * Dice.NUM_SIDES + 1)
    for _ in range(UpperCAmelCase_		):
        count_of_sum[sum(dice.roll() for dice in dices		)] += 1
    a__  			=							[round((count * 100) / num_throws ,     2		) for count in count_of_sum]
    return probability[num_dice:]  # remove probability of sums that never appear


if __name__ == "__main__":
 import doctest

 doctest.testmod()






