human
Probability for three randomly chosen numbers to be in AP | Function to calculate probability.
Driver code"
Solution in Python:
assistant
#Here is code to probability for three randomly chosen numbers to be in AP and the other steps required.
 def procal ( n ) :
	return ( 3.0 * n ) / ( 4.0 * ( n * n ) - 1 )
a = [ 1 , 2 , 3 , 4 , 5 ]
n = len ( a )
print ( round ( procal ( n ) , 6 ) )