Program to calculate Variance of first N Natural Numbers | Function to calculate Variance of first N natural numbers ; Driver Code
function find_Variance ( n ) { var numerator = n * n - 1 var ans = ( numerator * 1.0 ) / 12 return ans } var N = 5 ; document . write ( find_Variance ( N ) . toFixed ( 6 ) ) ;