Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>Machine Learning</h1>
<p>Calculate the Variance.</p>
<div id="demo"></div>
<script>
// Calulate the Mean (m)
let m = (7+8+8+9+9+9+10+11+14+14+15)/11;
// Calculate the Sum of Sqares (ss)
let ss = (7-m)**2 + (8-m)**2 + (8-m)**2 + (9-m)**2 + (9-m)**2 + (9-m)**2 + (10-m)**2 + (11-m)**2 + (14-m)**2 + (14-m)**2 + (15-m)**2;
// Calculate the Variance
let variance = ss / 11;
// Diplay the Variance
document.getElementById("demo").innerHTML = variance;
</script>
</body>
</html>