Middle-square method: Difference between revisions

Content deleted Content added
m The method: fmt., punct., style
m top: fmt.
Line 1:
[[Image:Middle-square method.svg|right|250px|thumb|One iteration of the middle-square method, showing a six 6-digit seed, which is then squared, and the resulting value has its middle six 6 digits as the output value (and also as the next seed for the sequence).]]
[[Image:Middle_square_method_2_digits.svg|right|250px|thumb|[[Directed graph]] of all 100 2-digit pseudorandom numbers obtained using the middle-square method with ''n''  =  2.]]
 
In [[mathematics]], the '''middle-square method''' is a method of generating [[pseudorandom number]]s. In practice it is not a good method, since its [[Pseudorandom number generator#Periodicity|period]] is usually very short and it has some severe weaknesses; repeated enough times, the middle-square method will either begin repeatedly generating the same number or cycle to a previous number in the sequence and loop indefinitely.