A Theoretical Framework for Global Optimization via Random Sampling