Probability for three randomly chosen numbers to be in AP | function to calculate probability ; Driver code
function procal ( n ) { return ( 3.0 * n ) / ( 4.0 * ( n * n ) - 1 ) ; } let a = [ 1 , 2 , 3 , 4 , 5 ] ; let n = a . length ; document . write ( procal ( n ) ) ;