MapReduce version and non MR version using itertools and numpy