human
Give me a code to probability of obtaining Prime Numbers as product of values obtained by throwing N dices and the other steps required given the following:
Probability of obtaining Prime Numbers as product of values obtained by throwing N dices | Function to find the value of power ( X , N ).
Stores the value of ( X ^ N ).
Calculate the value of power ( x , N ).
If N is odd.
Update res.
Update x.
Update N.
Function to find the probability of obtaining a prime number as the product of N thrown dices.
Stores count of favorable outcomes.
Stores count of sample space.
Prthe required probability.
Driver code"
Solution in Python:
assistant
#Here is code to probability of obtaining Prime Numbers as product of values obtained by throwing N dices and the other steps required.
 def power ( x , N ) :
	res = 1
	while ( N > 0 ) :
		if ( N % 2 == 1 ) :
			res = ( res * x )
		x = ( x * x )
		N = N >> 1
	return res
def probablityPrimeprod ( N ) :
	N_E = 3 * N
	N_S = power ( 6 , N )
	print ( N_E , " ▁ / ▁ " , N_S )
if __name__ == ' _ _ main _ _ ' :
	N = 2
	probablityPrimeprod ( N )