random search functional