human
Probability of getting two consecutive heads after choosing a random coin among two different types of coins | Function to return the probability of getting two consecutive heads.
Formula derived from Bayes 's theorem.
Driver code.
given the probability of getting a head for both the coins"
Solution in Python:
 What is a code to probability of getting two consecutive heads after choosing a random coin among two different types of coins and the other steps required?
assistant
#Here is code to probability of getting two consecutive heads after choosing a random coin among two different types of coins and the other steps required.
 def getProbability ( p , q ) :
	p /= 100
	q /= 100
	probability = ( p * p + q * q ) / ( p + q )
	return probability
if __name__ == " _ _ main _ _ " :
	p = 80
	q = 40
	print ( getProbability ( p , q ) )