random search and gibbs sampler