Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Middle-square method
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Pseudorandom number generator}} [[Image:Middle-square method.svg|right|250px|thumb|One iteration of the middle-square method, showing a 6-digit seed, which is then squared, and the resulting value has its middle 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]] and computer science, the '''middle-square method''' is a method of generating [[pseudorandom number]]s. In practice it is a highly flawed method for many practical purposes, 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)