<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kleinesfilmr%C3%B6llchen</id>
		<title>explain xkcd - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kleinesfilmr%C3%B6llchen"/>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php/Special:Contributions/Kleinesfilmr%C3%B6llchen"/>
		<updated>2026-05-29T17:27:27Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=221:_Random_Number&amp;diff=413858</id>
		<title>221: Random Number</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=221:_Random_Number&amp;diff=413858"/>
				<updated>2026-05-28T21:02:23Z</updated>
		
		<summary type="html">&lt;p&gt;Kleinesfilmröllchen: Clearer wording; explain that the comic contains code in the first place (not obvious to non-programmers); notes on randomness. Also hey, first edit after finally deciding to make an account here!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{comic&lt;br /&gt;
| number    = 221&lt;br /&gt;
| date      = February 9, 2007&lt;br /&gt;
| title     = Random Number&lt;br /&gt;
| image     = random_number.png&lt;br /&gt;
| titletext = &amp;lt;nowiki&amp;gt;RFC 1149.5&amp;lt;/nowiki&amp;gt; specifies 4 as the standard IEEE-vetted random number.&lt;br /&gt;
}}&lt;br /&gt;
==Explanation==&lt;br /&gt;
The comic contains computer code specifying a function (in a syntax similar to that of {{w|C (programming language)|C}}), 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 this function just returns the ''same'' random number each time. 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.&lt;br /&gt;
&lt;br /&gt;
Alternatively, this could be seen as making fun of what many people incorrectly consider &amp;quot;random numbers&amp;quot;.  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, the average person will often think of a list of random numbers as just &amp;quot;having no pattern&amp;quot;. 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 &amp;quot;4&amp;quot;, and the second number is independent of the first, then that means the second number can also be &amp;quot;4&amp;quot; (as well as the 3rd and 4th). This obviously creates a &amp;quot;pattern&amp;quot;, while still being random because of the independence. Four times &amp;quot;4&amp;quot; in a row&amp;lt;!-- assuming the dice rolls represent independent Laplace random variable experiments --&amp;gt; is not a likely outcome for dice rolls, with a probability of (1/6)⁴ or approximately 0.08%. It is much more likely, for instance, to find ''at least'' one &amp;quot;4&amp;quot; among the four dice rolls (4*1/6 or 66%), or a &amp;quot;4&amp;quot; only on the first roll (1/6 or 16.7%). All three outcomes are however possible.&lt;br /&gt;
&lt;br /&gt;
The {{w|IEEE}} is the organization responsible for maintaining a number of computer standards. An RFC, or {{w|Request for Comments}}, is a formal document put out to computing experts by {{w|IETF}} in the hopes of becoming a future standard. However, RFC 1149 was an {{w|April Fools' Day Request for Comments|April Fools' joke}}, [http://www.faqs.org/rfcs/rfc2549.html IP over Avian Carriers], defining how carrier pigeons can be used to transmit Internet packets. &amp;quot;&amp;lt;nowiki&amp;gt;RFC 1149.5&amp;lt;/nowiki&amp;gt;,&amp;quot; meanwhile, simply does not exist.&lt;br /&gt;
&lt;br /&gt;
==Trivia==&lt;br /&gt;
&lt;br /&gt;
* The well-known &amp;quot;helper website&amp;quot; ([http://gChq.github.io/CyberChef/#recipe=XKCD_Random_Number() CyberChef]) has a function that simulates XKCD's program.&lt;br /&gt;
* Esolangs.org features a [http://esolangs.org/wiki/user:XKCD_Random_Number challenge] that requires you to rewrite the program in XKCD's comic in another programming language, as either a function or a full program that prints the &amp;quot;4&amp;quot;.&lt;br /&gt;
* Security Researchers made AMD Zen CPUs return 4 when called for randomness via a microcode [https://www.theregister.com/2025/02/04/google_amd_microcode/ update]&lt;br /&gt;
&lt;br /&gt;
==Transcript==&lt;br /&gt;
[A computer program.]&lt;br /&gt;
 int getRandomNumber()&lt;br /&gt;
 {&lt;br /&gt;
    return 4; // chosen by fair dice roll.&lt;br /&gt;
              // guaranteed to be random.&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
{{comic discussion}}&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[Category:Computers]]&lt;br /&gt;
[[Category:Comics with lowercase text]]&lt;/div&gt;</summary>
		<author><name>Kleinesfilmröllchen</name></author>	</entry>

	</feed>