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 25: Line 25:
 
               // guaranteed to be random.
 
               // guaranteed to be random.
 
  }
 
  }
 +
 +
==Trivia==
 +
The comic also has a philosophical bent, by showcasing the limits of knowledge for an external observer. Someone who is calling this function, but unable to see its source code, will never be able to tell with 100% confidence whether the function is flawed. Even if he runs the function 10 times, and it always returns 4, there is always the possibility that it could be a fluke. As he runs the function more and more times, he can develop more confidence in the theory that the function is faulty. But unless he breaks the barrier and examines the source code itself, she will never be able to declare the function to be faulty with 100% confidence.
 +
 +
Despite the extreme example given, this is actually a practical problem which likely exists in the real world. If the function was more sophisticated but still had a 5% bias towards one number under certain circumstances, this would be extremely hard to notice & prove. More likely, the API users would continue to believe that the RNG is working as intended, without realizing the flaw inherent in it; anyone who grumbles about seeing 4 very frequently may even be accused of not understanding the non-uniform nature of randomness. Given the extremely large number of APIs & libraries present, and that not all of them are fully examined & understood by 3rd party experts, such flaws are likely present in our world as well. These flaws may even have been purposely introduced by a malicious agent or entity seeking to exploit them.
  
 
{{comic discussion}}
 
{{comic discussion}}

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)