Randomization function: Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 125.22.36.90 to version by DSisyphBot. False positive? Report it. Thanks, ClueBot NG. (1575736) (Bot)
Tag: possible vandalism
Line 12:
==Requirements==
 
these are nothing ,these are the functions written on basic of computers.
===Randomness===
In theory, randomization functions are assumed to be truly random, and yield an unpredictably different function every time the algorithm is executed. The randomization technique would not work if, at every execution of the algorithm, the randomization function always performed the same mapping, or a mapping entirely determined by some externally observable parameter (such as the program's startup time). With such a "pseudo-randomization" function, one could in principle construct a sequence of calls such that the function would always yield a "bad" case for the underlying deterministic algorithm. For that sequence of calls, the average cost would be closer to the worst-case cost, rather than the average cost for random inputs.
 
In practice, however, the main concern is that some "bad" cases for the deterministic algorithm may occur in practice much more often than it would be predicted by chance. For example, in a naive variant of quicksort, the worst case is when the input items are already sorted — which is a very common occurrence in many applications. For such algorithms, even a fixed pseudo-random permutation may be good enough. Even though the resulting "pseudo-randomized" algorithm would still have as many "bad" cases as the original, they will be certain peculiar orders that would be quite unlikely to arise in real applications. So, in practice one often uses randomization functions that are derived from [[pseudo-random number generator]]s, preferably [[random seed|seeded]] with external "random" data such as the program's startup time.
 
===Uniformity===