Random number generation toward sorting algorithms