An implementation of the gap statistic of Tibshirani, Walther and Hastie in Mathematica