calculate mean and variance with map reduce