A function for generating random index inhomogeneity cases