<?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=Snaxmcgee</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=Snaxmcgee"/>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php/Special:Contributions/Snaxmcgee"/>
		<updated>2026-04-11T07:42:36Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=Talk:3062:_Off_By_One&amp;diff=368831</id>
		<title>Talk:3062: Off By One</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=Talk:3062:_Off_By_One&amp;diff=368831"/>
				<updated>2025-03-13T16:47:20Z</updated>
		
		<summary type="html">&lt;p&gt;Snaxmcgee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--&amp;gt;&lt;br /&gt;
But what about floats? [[User:GreyFox|GreyFox]] ([[User talk:GreyFox|talk]]) 20:01, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is this dithering? [[User:Hcs|Hcs]] ([[User talk:Hcs|talk]]) 21:19, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Could be. --[[User:PRR|PRR]] ([[User talk:PRR|talk]]) 22:19, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
This language has a huge off by one error: the docs don't explicitly say if the random range is inclusive. EDIT: the comic description above now includes this, thx --[[User:Snaxmcgee|Snaxmcgee]] ([[User talk:Snaxmcgee|talk]]) 22:22, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
But if it's adjusted both on store and on read, then there is a chance (of about 1 in 22) that the value after read will be exactly the same as the value before store. This does not eliminate pre-existing off-by-one errors, and in fact, introduces new ones if the adjustment on read is off by one from the adjustment on store, when there was no off-by-one error in the original code. And what's worse - with a single store-read cycle, the value can never be off by 40 to 50. It can be off by up to 10, or by between 80 to 100, in either direction. --[[User:NeatNit|NeatNit]] ([[User talk:NeatNit|talk]]) 22:42, 12 March 2025 (UTC)&lt;br /&gt;
:I was ''just'' adjusting the explanation to imply this sort of thing (without having read your comment, just yet). Given the assumption that n=n±(40+rand(11)) at every stage (I'm assuming 'inclusive', Snaxmcgee!), two steps of 'intentional adjustment' might result in: -100 (x1), -99 (x2), -98 (x3), -97 (x4), -96 (x5), -95 (x6), -94 (x7), -93 (x8), -92 (x9), -91 (x10), -90 (x11), -89..-80 (x10..x1), -10 (x2), -9 (x4), -8 (x6), -7 (x8), -6 (x10), -5 (x12), -4 (x14), -3 (x16), -2 (x18), -1 (x20), ±0 (x22), +1..+10 (x20..x2), +80..+90..+100 (x1..x11..x1).&lt;br /&gt;
:This gives a chance of being entirely correct as 22/484 (4.5454...%) and ''each'' off-by-one as ''very'' slightly less (though ±1, in total is almost twice as likely!).&lt;br /&gt;
:Adding further steps (skipping odd step-cummulations, at least at first, until you get to nine of them and everything entirely stops being discontinuous) just spreads out an increased number of highs right next to zero deflection... [[Special:Contributions/172.70.86.129|172.70.86.129]] 23:38, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Obligatory quote:&lt;br /&gt;
 There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.&lt;br /&gt;
::See here for a full story of this quote: https://twitter.com/codinghorror/status/506010907021828096&lt;br /&gt;
::--[[Special:Contributions/162.158.129.64|162.158.129.64]] 08:28, 13 March 2025 (UTC)&lt;br /&gt;
:::And 3 hard things in distributed computing: 3. Delivering messages exactly one time, 2. Making sure things happen in the correct order, and 3. Delivering messages exactly one time [[User:Jamcdonald|Jamcdonald]] ([[User talk:Jamcdonald|talk]])&lt;br /&gt;
::::Presumably 1 is not losing data? --[[User:NeatNit|NeatNit]] ([[User talk:NeatNit|talk]]) 10:19, 13 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the comic, Cueball clearly says the adjustment amounts is ‘’between’’ 40 and 50, yet this explanation says the adjustment is from 40 to 50, ironically making an off-by-1 error on both ends of the range. Neither integers 40 nor 50 are “between 40 and 50”. [[Special:Contributions/172.71.154.39|172.71.154.39]] 10:43, 13 March 2025 (UTC)&lt;br /&gt;
:English language is imprecise with its use of &amp;quot;between&amp;quot;, but it's usually taken as inclusive.  Most people, when asked, &amp;quot;Pick a number between 1 and 10,&amp;quot; will assume that 1 and 10 are both valid choices.  Even in computing, you have things like Excel's RANDBETWEEN function to generate random integers between two bounds, which is inclusive. {{unsigned ip|104.23.187.72|13:28, 13 March 2025}}&lt;br /&gt;
::Interestingly, in German such ranges are defined as including the borders, in Dutch they're defined as excluding the borders. (hence the Dutch t/m (&amp;quot;tot en met&amp;quot; - &amp;quot;up to, and including&amp;quot;) [[Special:Contributions/104.23.170.81|104.23.170.81]] 15:28, 13 March 2025 (UTC)&lt;br /&gt;
::Yes, see {{wiktionary|between#Usage notes}} as one overview. Between as in &amp;quot;within the bounds defined by&amp;quot; is different from &amp;quot;amongst those things of which these items are the defining outer examples&amp;quot;. Especially, but not exclusively, when that's just two distinct items which have ''no'' valid intermediate states betwixt the two to choose from (&amp;quot;you have to choose between me and my sister&amp;quot; isn't usually satisfactoraily answerable by choosing a different sibling, or perhaps parent, of the two). [[Special:Contributions/172.69.195.54|172.69.195.54]] 15:24, 13 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
It's easy to make an off-by-one error without using a computer at all. Ask a friend how many fenceposts are needed for a 100-foot fence if the rails are ten feet long. [[Special:Contributions/172.71.30.199|172.71.30.199]] 12:58, 13 March 2025 (UTC)&lt;br /&gt;
:And how wide are the posts..? ;) [[Special:Contributions/141.101.98.6|141.101.98.6]] 15:27, 13 March 2025 (UTC)&lt;br /&gt;
::If I ever answer this question 100, it's obviously because in my mind each post (or more accurately, the distance between the grooves cut into the post) is a foot wide, which is slightly larger than usual but not totally unreasonable size, and not because I fell for the trick.--[[User:Snaxmcgee|Snaxmcgee]] ([[User talk:Snaxmcgee|talk]]) 16:47, 13 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
I don't understand - what's all this got to do with water balloons? [[Special:Contributions/172.70.86.129|172.70.86.129]] 15:37, 13 March 2025 (UTC)&lt;br /&gt;
:(ISWYDT...) [[Special:Contributions/173.70.195.206|171.68.193.204]] 16:47, 14 February 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Snaxmcgee</name></author>	</entry>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=Talk:3062:_Off_By_One&amp;diff=368830</id>
		<title>Talk:3062: Off By One</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=Talk:3062:_Off_By_One&amp;diff=368830"/>
				<updated>2025-03-13T16:32:56Z</updated>
		
		<summary type="html">&lt;p&gt;Snaxmcgee: Someone else referenced this comment so now there's a bunch of confusion. I'm undoing it's removal but editing to clarify. Undo revision 368789 by 172.70.176.15 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--&amp;gt;&lt;br /&gt;
But what about floats? [[User:GreyFox|GreyFox]] ([[User talk:GreyFox|talk]]) 20:01, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is this dithering? [[User:Hcs|Hcs]] ([[User talk:Hcs|talk]]) 21:19, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Could be. --[[User:PRR|PRR]] ([[User talk:PRR|talk]]) 22:19, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
This language has a huge off by one error: the docs don't explicitly say if the random range is inclusive. EDIT: the comic description above now includes this, thx --[[User:Snaxmcgee|Snaxmcgee]] ([[User talk:Snaxmcgee|talk]]) 22:22, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
But if it's adjusted both on store and on read, then there is a chance (of about 1 in 22) that the value after read will be exactly the same as the value before store. This does not eliminate pre-existing off-by-one errors, and in fact, introduces new ones if the adjustment on read is off by one from the adjustment on store, when there was no off-by-one error in the original code. And what's worse - with a single store-read cycle, the value can never be off by 40 to 50. It can be off by up to 10, or by between 80 to 100, in either direction. --[[User:NeatNit|NeatNit]] ([[User talk:NeatNit|talk]]) 22:42, 12 March 2025 (UTC)&lt;br /&gt;
:I was ''just'' adjusting the explanation to imply this sort of thing (without having read your comment, just yet). Given the assumption that n=n±(40+rand(11)) at every stage (I'm assuming 'inclusive', Snaxmcgee!), two steps of 'intentional adjustment' might result in: -100 (x1), -99 (x2), -98 (x3), -97 (x4), -96 (x5), -95 (x6), -94 (x7), -93 (x8), -92 (x9), -91 (x10), -90 (x11), -89..-80 (x10..x1), -10 (x2), -9 (x4), -8 (x6), -7 (x8), -6 (x10), -5 (x12), -4 (x14), -3 (x16), -2 (x18), -1 (x20), ±0 (x22), +1..+10 (x20..x2), +80..+90..+100 (x1..x11..x1).&lt;br /&gt;
:This gives a chance of being entirely correct as 22/484 (4.5454...%) and ''each'' off-by-one as ''very'' slightly less (though ±1, in total is almost twice as likely!).&lt;br /&gt;
:Adding further steps (skipping odd step-cummulations, at least at first, until you get to nine of them and everything entirely stops being discontinuous) just spreads out an increased number of highs right next to zero deflection... [[Special:Contributions/172.70.86.129|172.70.86.129]] 23:38, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Obligatory quote:&lt;br /&gt;
 There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.&lt;br /&gt;
::See here for a full story of this quote: https://twitter.com/codinghorror/status/506010907021828096&lt;br /&gt;
::--[[Special:Contributions/162.158.129.64|162.158.129.64]] 08:28, 13 March 2025 (UTC)&lt;br /&gt;
:::And 3 hard things in distributed computing: 3. Delivering messages exactly one time, 2. Making sure things happen in the correct order, and 3. Delivering messages exactly one time [[User:Jamcdonald|Jamcdonald]] ([[User talk:Jamcdonald|talk]])&lt;br /&gt;
::::Presumably 1 is not losing data? --[[User:NeatNit|NeatNit]] ([[User talk:NeatNit|talk]]) 10:19, 13 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the comic, Cueball clearly says the adjustment amounts is ‘’between’’ 40 and 50, yet this explanation says the adjustment is from 40 to 50, ironically making an off-by-1 error on both ends of the range. Neither integers 40 nor 50 are “between 40 and 50”. [[Special:Contributions/172.71.154.39|172.71.154.39]] 10:43, 13 March 2025 (UTC)&lt;br /&gt;
:English language is imprecise with its use of &amp;quot;between&amp;quot;, but it's usually taken as inclusive.  Most people, when asked, &amp;quot;Pick a number between 1 and 10,&amp;quot; will assume that 1 and 10 are both valid choices.  Even in computing, you have things like Excel's RANDBETWEEN function to generate random integers between two bounds, which is inclusive. {{unsigned ip|104.23.187.72|13:28, 13 March 2025}}&lt;br /&gt;
::Interestingly, in German such ranges are defined as including the borders, in Dutch they're defined as excluding the borders. (hence the Dutch t/m (&amp;quot;tot en met&amp;quot; - &amp;quot;up to, and including&amp;quot;) [[Special:Contributions/104.23.170.81|104.23.170.81]] 15:28, 13 March 2025 (UTC)&lt;br /&gt;
::Yes, see {{wiktionary|between#Usage notes}} as one overview. Between as in &amp;quot;within the bounds defined by&amp;quot; is different from &amp;quot;amongst those things of which these items are the defining outer examples&amp;quot;. Especially, but not exclusively, when that's just two distinct items which have ''no'' valid intermediate states betwixt the two to choose from (&amp;quot;you have to choose between me and my sister&amp;quot; isn't usually satisfactoraily answerable by choosing a different sibling, or perhaps parent, of the two). [[Special:Contributions/172.69.195.54|172.69.195.54]] 15:24, 13 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
It's easy to make an off-by-one error without using a computer at all. Ask a friend how many fenceposts are needed for a 100-foot fence if the rails are ten feet long. [[Special:Contributions/172.71.30.199|172.71.30.199]] 12:58, 13 March 2025 (UTC)&lt;br /&gt;
:And how wide are the posts..? ;) [[Special:Contributions/141.101.98.6|141.101.98.6]] 15:27, 13 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
I don't understand - what's all this got to do with water balloons? [[Special:Contributions/172.70.86.129|172.70.86.129]] 15:37, 13 March 2025 (UTC)&lt;br /&gt;
:(ISWYDT...) [[Special:Contributions/173.70.195.206|171.68.193.204]] 16:47, 14 February 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Snaxmcgee</name></author>	</entry>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=Talk:3062:_Off_By_One&amp;diff=368780</id>
		<title>Talk:3062: Off By One</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=Talk:3062:_Off_By_One&amp;diff=368780"/>
				<updated>2025-03-12T22:22:01Z</updated>
		
		<summary type="html">&lt;p&gt;Snaxmcgee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--&amp;gt;&lt;br /&gt;
But what about floats? [[User:GreyFox|GreyFox]] ([[User talk:GreyFox|talk]]) 20:01, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is this dithering? [[User:Hcs|Hcs]] ([[User talk:Hcs|talk]]) 21:19, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Could be. --[[User:PRR|PRR]] ([[User talk:PRR|talk]]) 22:19, 12 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
This language has a huge off by one error: the docs don't explicitly say if the random range is inclusive. --[[User:Snaxmcgee|Snaxmcgee]] ([[User talk:Snaxmcgee|talk]]) 22:22, 12 March 2025 (UTC)&lt;/div&gt;</summary>
		<author><name>Snaxmcgee</name></author>	</entry>

	</feed>