Optimizing success of random searches in various search environments