Editing 221: Random Number

Jump to: navigation, search

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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 7: Line 7:
 
}}
 
}}
 
==Explanation==
 
==Explanation==
βˆ’
The comic specifies a function (in a {{w|C (programming language)|C}} similar syntax), which judging by its name should be designed to return a random number. Most functions of this form are random number ''generators'', meaning that on subsequent calls they return ''different'' random numbers. But the programmer has instead implemented a function that just returns the ''same'' random number each time, which, while it could indeed have been truly randomly chosen by rolling a die as the [[156: Commented|comment]] documented, is essentially worthless were it ever to be called more than once (with the expectation of different, i.e., random, results).  In other words, the results over time would not be random at all, but completely predictable and deterministic.
+
The comic specifies a function (in a {{w|C (programming language)|C-like}} syntax), which judging by its name should be designed to return a random number. Most functions of this form are random number ''generators'', meaning that on subsequent calls they return ''different'' random numbers. But the programmer has instead implemented a function that just returns the ''same'' random number each time, which, while it could indeed have been truly randomly chosen by rolling a die as the [[156: Commented|comment]] documented, is essentially worthless were it ever to be called more than once (with the expectation of different, i.e., random, results).  In other words, the results over time would not be random at all, but completely predictable and deterministic.
  
 
Alternatively, this could be seen as making fun of how people normally will erroneously think of "random numbers".  A mathematician will (or at least should) think about a random number as one that is independent of something (usually being independent of the next number in a list of numbers).  However a normal person will often think of a list of random numbers as just meaning it having "no pattern".  This difference is described in [https://simple.wikipedia.org/wiki/Hacker_koan#Uncarved_block an MIT koan]. (Just to drive this point home, if the first number of a list is "4", and the second number is independent of the first, then that means the second number can also be "4" (as well as the 3rd and 4th).  This obviously creates a "pattern", while still being random because of the independence)
 
Alternatively, this could be seen as making fun of how people normally will erroneously think of "random numbers".  A mathematician will (or at least should) think about a random number as one that is independent of something (usually being independent of the next number in a list of numbers).  However a normal person will often think of a list of random numbers as just meaning it having "no pattern".  This difference is described in [https://simple.wikipedia.org/wiki/Hacker_koan#Uncarved_block an MIT koan]. (Just to drive this point home, if the first number of a list is "4", and the second number is independent of the first, then that means the second number can also be "4" (as well as the 3rd and 4th).  This obviously creates a "pattern", while still being random because of the independence)

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)