Randomness is used in [[algorithm|algorithms]] to protect against adversarial inputs or, more generally, when how the algorithm will be used is unknown and there is risk that users might provide worst-case inputs. [[quicksort]] and [[Simplex]] are classic examples of algorithms that use randomness. Of course, algorithms whose job is to generate random numbers, like random number generators, also use randomness.