Simulation of Hotelling's law in 1 and 2 dimensional space