Porting Allen Downey's "Think Stats" Python code to Scala.