New algorithm for selecting a random reference histogram (G.Conesa)