Answers.Body: <p>Light gang switches, same the way you teach binary counting.  (Well, the same way that I was taught binary arithmetic back when knowing binary and hex were important.)</p>
  
  <p>EDIT: An <em>off</em> transistor (simulated by a light switch) is considered to be 0 (no voltage) and an <em>on</em> to be 1 (voltage passing).  Since "all zeros" is a valid configuration, 0 is a valid address where Important Bits can reside.  That's why many languages base arrays using 0.</p>
  
  <p>EDIT 2: It's also the basis of pointer arithmetic.  Your array has a base address at location <code>A</code>, so that's where the first element goes.  When you're referencing the elements in a loop, you add an offset <code>O</code> to get to each array element.  To access the first element, the  value of <code>O</code> must be <code>0</code>.</p>
  
  <p><a href="https://i.sstatic.net/AIcY4.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AIcY4.jpg" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-15T14:33:12.263Z
Answers.Text: @Buffy sorry.  I assumed that CS Educators all know the light-switch analogy.
Answers.UserDisplayName: RonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-15T14:38:58.020Z
Answers.Text: @Buffy ok.  I added (a hopefully clear) explanation.
Answers.UserDisplayName: RonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-15T14:49:12.283Z
Answers.Text: @Buffy interesting. This was *Standard Knowledge* 35 years ago when students had to learn pointer arithmetic and take at least one class in Assembly.
Answers.UserDisplayName: RonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-15T14:52:30.670Z
Answers.Text: Welcome to CSEducators. Come back often.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T06:37:12.860Z
Answers.Text: Using 0 and 1 for binary states is unrelated to the mathematical values of 0 and 1. We could instead use "nothing" and "something" and the entire field of logic would remain correct. This is why programming now favors `true` and `false`, instead of "a non-zero integer" and "a zero integer". It disambiguates logical evaluations from mathematical ones and prevents developers mistakenly assuming one for the other.
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T06:39:47.337Z
Answers.Text: Maybe as a simpler example: while the logic (of an electrical device) links 0 to 0V, the same does not apply to e.g. an abstract logical statement ("all bald men wear hats"). 0 does not bind to any particular integer value. Similarly, setting a temperature switch to 0 does not inherently mean that it's now 0° (before you argue that a temperature switch is still electrical: non-electrical switches exist too!). There are only fringe cases in which the logical 0 corresponds to a mathematical 0. The logical 0 is not defined by the mathematical 0, their fringe correlation is coincidental.
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-31T14:16:10.220Z
Answers.Text: I use the three light switches in my room to show binary counting... never occurred to me to use it for array indexes.  Bravo.  :-)
Answers.UserDisplayName: codingCat
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-15T14:08:39.407Z
Answers.LastActivityDate: 2018-01-15T14:56:20.677Z
Answers.LastEditDate: 2018-01-15T14:56:20.677Z
Answers.UserDisplayName: RonJohn
Answers.Body: <p>Subtraction paradox:  In North-American football, if a runner goes from the 3 yard line to the 4 yard-line, there is a (4-3) = 1 yard gain.  However, if your math teacher assigns problems 3-4 (integers), you have to do two problems.  So in what engineers call an "analog" system, the Result = Stop - Start; but for integers it can be more complex.</p>
  
  <p>So in North American football, the yard line starts at "0" which is called the "Goal Line" typically.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T06:27:43.787Z
Answers.Text: `if a runner goes from the 3 yard line to the 4 yard-line, there is a (4-3) = 1 yard gain. However, if your math teacher assigns problems 3-4 (integers)` The core difference here is that the former denotes the distance between points, and the latter denotes the points themselves. 2017 and 2018 are two distinct years (points), but the timespan (distance) between NYE 2017 and NYE 2018 is _one year_. This does not actually answer why 0-based indexing is used, as you're simply comparing two inherently different things. (_"from 3 to 4"_ vs _"3 and 4"_)
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T12:15:52.480Z
Answers.Text: One must use 0 as a base, however.
Answers.UserDisplayName: JosephDoggie
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T13:34:30.113Z
Answers.Text: `One must use 0 as a base`. I don't quite agree, 0-indexing is not universally superior to 1-indexing. As I mentioned in my earlier comment, it depends on what you're actually expressing (points, the distance between them, ...). There are many cases where the 0th element is a literal "nothing", thus precluding 0 from being relevant (especially when pertaining to physical objects).
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-30T14:23:57.723Z
Answers.Text: I think this is what is called a fence-post error: You have questions 3,and 4. These are the posts. It is an error in this case to count the fence panels ($4-3$). You are not measuring the distance between the posts (number of panels), you are counting the posts. See also inclusive and exclusive ranges. Some languages use inclusive lower and exclusive upper, as this choice has **less** problems than other choices.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-31T16:45:55.637Z
Answers.Text: Note that in North American football, the "Goal Line" is the same as a zero-yard line, which is zero-based.  For the math problems, you aren't doing problem 2, but if you subtract 4-2 = 2 you get the right answer.  Thinking about 'how' this works is difficult, at least for me, and I have a Ph.D. in Electrical Engineering, focusing on computer simulations using eigen-spaces.
Answers.UserDisplayName: JosephDoggie
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-29T17:55:54.347Z
Answers.Text: The 3-4 is not a subtraction it is a range (inclusive range). It is 3→4 or {3,4}.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-14T19:23:38.037Z
Answers.LastActivityDate: 2018-09-14T19:23:38.037Z
Answers.UserDisplayName: JosephDoggie
Answers.Body: <p>Since this question was posted, I have come to realise that a ruler is not a metaphor for this think. It is the think. Zero indexing is simply measuring the distance from the start. There are many examples of this in the other answers.</p>
  <p>We need to not see the index as on ordinal number, but as the distance from the start.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-31T14:19:23.083Z
Answers.Text: I'm surprised that it never occurred to me to use a rule for this exact reason.  When I explain the concept in class, I say the address of the array is the location of the first position, and the index is the distance from that position.
Answers.UserDisplayName: codingCat
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-29T18:06:22.103Z
Answers.LastActivityDate: 2022-05-29T18:06:22.103Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>Some train stations (but not many) have a platform 0:</p>
  
  <p><a href="https://www.youtube.com/watch?v=SPQRNmXVP8s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=SPQRNmXVP8s</a></p>
  
  <p>If you are lucky enough to live in one of these towns, then it may be a very good example.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-18T22:52:07.337Z
Answers.LastActivityDate: 2020-02-18T22:52:07.337Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <h2>An example from thermodynamics: the study of heat and temperature.</h2>
  
  <p>In thermodynamics there are 4 laws, numbered from zero. Look to see when your pupils study this in physics (science). You now have cross curricular linking, which is also good.</p>
  
  <p>Like Asimov's 0th law of robotics, the zeroth low of thermodynamics was added after the other 3: “The zeroth law was not initially recognized as a law, as its basis in thermodynamical equilibrium was implied in the other laws. The first, second, and third laws had been explicitly stated prior and found common acceptance in the physics community. Once the importance of the zeroth law for the definition of temperature was realized, it was impracticable to renumber the other laws, hence it was numbered the zeroth law.” — <a href="https://en.wikipedia.org/wiki/Thermodynamics#Laws_of_thermodynamics" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Thermodynamics#Laws_of_thermodynamics</a></p>
  
  <blockquote>
    <ul>
    <li><p>Zeroth law of thermodynamics: If two systems are in thermal equilibrium with a third system, they are in thermal equilibrium with
    each other. This law helps define the notion of temperature.</p></li>
    <li><p>First law of thermodynamics: When energy passes, as work, as heat, or with matter, into or out from a system, the system's internal
    energy changes in accord with the law of conservation of energy.
    Equivalently, perpetual motion machines of the first kind are
    impossible.</p></li>
    <li><p>Second law of thermodynamics: In a natural thermodynamic process, the sum of the entropies of the interacting thermodynamic systems
    increases. Equivalently, perpetual motion machines of the second kind
    are impossible.</p></li>
    <li><p>Third law of thermodynamics: The entropy of a system approaches a constant value as the temperature approaches absolute zero. With the
    exception of non-crystalline solids (glasses) the entropy of a system
    at absolute zero is typically close to zero, and is equal to the
    logarithm of the product of the quantum ground states.</p></li>
    </ul>
  </blockquote>
  
  <p>Extract from <a href="https://en.wikipedia.org/wiki/Laws_of_thermodynamics" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Laws_of_thermodynamics</a>
  Text is available under the Creative Commons Attribution-ShareAlike License</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-04T07:50:17.203Z
Answers.Text: @Aurora0001 I added in a bit on asimov. (also I think you should make an answer on asimov)
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T10:18:30.007Z
Answers.Text: Similarly, [Asimov's Laws](https://en.wikipedia.org/wiki/Three_Laws_of_Robotics#Zeroth_Law_added) start from zero (although chronologically, the zeroth law was added later).
Answers.UserDisplayName: Aurora0001
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T10:15:27.293Z
Answers.LastActivityDate: 2017-05-28T08:45:43.193Z
Answers.LastEditDate: 2017-05-28T08:45:43.193Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>This one in related to computing, but sufficiently different, as it related to the social side. You can link it in by teaching the social side before indexing.</p>
  
  <blockquote>
    <ul>
    <li>The freedom to run the program as you wish, for any purpose (freedom 0).</li>
    <li>The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a
    precondition for this.</li>
    <li>The freedom to redistribute copies so you can help your neighbour (freedom 2).</li>
    <li>The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance
    to benefit from your changes. Access to the source code is a
    precondition for this.</li>
    </ul>
  </blockquote>
  
  <p>Extract from <a href="https://www.gnu.org/philosophy/free-sw.en.html" rel="nofollow noreferrer">https://www.gnu.org/philosophy/free-sw.en.html</a> (Creative Commons Attribution-NoDerivatives 4.0 International License).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-23T14:26:22.137Z
Answers.Text: You are missing 5 freedoms.  And the fact that a bunch of computing folks used an 0 indexed array as is kinda... expected.  OP is looking for non-computing examples, like military time and people's age (as mentioned in other answers/comments)
Answers.UserDisplayName: ivanivan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-23T17:01:59.143Z
Answers.Text: @ivanivan can you tell us about the 5 freedoms, I know not of this. And added answer on 24hour time.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-23T19:57:32.673Z
Answers.Text: the freedoms you list are from the Free Software Foundation - Stallman and co.  However, the Open Source Definition lists other requirements/freedoms needed for a license to be considered Open - https://opensource.org/osd-annotated.  Remember, Stallman insists that all software be free, the Open Source Initiative wants as much as possible to be free, but not at the expense of extremism
Answers.UserDisplayName: ivanivan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-30T14:15:55.223Z
Answers.Text: @ivanivan the Free Software foundation also have a longer version: these 3 points are only a summary. The freedoms in the rest of the [Free Software definition](https://www.gnu.org/philosophy/free-sw.en.html), and the [Open Source definition](https://opensource.org/osd-annotated) do not add any extra freedoms. They only add clarification. The Free Software definition has 3 levels: the name "Free Software" (where free refers to freedom not price), the 4 freedoms, and the detailed explanation. The Open Source definition only has a detailed explanation, so is harder to grok.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T10:23:25.643Z
Answers.LastActivityDate: 2017-05-28T08:47:58.413Z
Answers.LastEditDate: 2017-05-28T08:47:58.413Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>I realize this post is old. However, what helped me and what may help others is that 0 is indeed on the number line. The best analogy I can give to support this cause is related to a bank account.</p>
  <p>If you are -\$5 in your account and you add \$10. Your total sum is \$5. Placing this on the number line (as seen below) -5 becomes your &quot;0&quot; as you count up by 10. If you start -5 as 1, your short \$1. If you skip 0 in your addition of 10, you gain \$1.</p>
  <p>-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5</p>
  <p>Simplifying things to its core has been my most successful tool in life.</p>
  <p>GL,</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-15T09:06:55.390Z
Answers.LastActivityDate: 2022-05-29T17:58:41.787Z
Answers.LastEditDate: 2022-05-29T17:58:41.787Z
Answers.UserDisplayName: spiffykat404
Answers.Body: <blockquote>
  <p>where can we find 0-indexing outside of CS and grounded in everyday human experience?</p>
  </blockquote>
  <p><strong>This is really begging the question (in the strict sense)</strong>: you assume that there's any need for it, whereas I boldly claim that there's none whatsoever, making the question moot. In fact, I think it's really counterproductive, and is an attempt to solve a non-existent problem.</p>
  <p>As far as educational theories go, such a question is very loaded. Are you sure that such everyday human experience will have any other applicability to the problem? It's like trying to teach quantum mechanics while referring to everyday human experience: it's totally futile, since there's no everyday human experience that has any resemblance to what happens on quantum level, and if there is then the resemblance is wholly superficial.</p>
  <p>See, the heart of the problem is whether there is any way to continue deduction based on human experience. If you refer to human experience, the students will naturally try to rely on what they know from &quot;real life&quot; as they go on in their studies, and they'll try to rely on that <em>first</em>, before reaching into the &quot;unfamiliar&quot; but task-specific knowledge. In most cases, the real-life &quot;analogues&quot; are <strong>baggage</strong>, since any further deductions one makes based on them tend to be either outright invalid, or subtly broken.</p>
  <p>I personally don't think that there's much to 0-indexing. Tell the students that it's a convention no different from starting to count at 1. It's something we agreed to, and when you use some programming languages, the convention is 0-based. That's all there's to it. You can explain to the students that it's no different to agreeing to greet the teacher by saying &quot;hello&quot; or &quot;good [morning|afternoon]&quot; rather than &quot;yo brother, what's up?&quot;. It's entirely arbitrary, it's based on a-priori decision to treat the &quot;yo brother&quot; form of address as informal or disrespectful or what have you.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-01T06:39:23.443Z
Answers.Text: While I agree in general. It turns out that there are many good examples. And that it is not counting, it is measuring (see other answers). I think I will use your last paragraph as advice for a lot of thinks. I have sometimes just shown students that what they think is normal is not the only way (e.g. base 12/24/60 clocks, so why not binary).
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-31T17:07:15.037Z
Answers.LastActivityDate: 2020-08-31T17:14:32.973Z
Answers.LastEditDate: 2020-08-31T17:14:32.973Z
Answers.UserDisplayName: Kuba hasn't forgotten Monica
Answers.Body: <p>You can get at this concept very intuitively in strings before you ever get to arrays.  Take a string like "hello world" and ask them a subtle-sounding point: does the string begin here: <code>"*hello world"</code>, or here: <code>"h*ello world"</code>.  They'll certainly be able to identify the correct answer.</p>
  
  <p>Then ask, <em>"how far from the start of the string do we have to go to get to the 'h'?  Answer in a number of characters. Do we have to move 5 characters away? 3? 1?"</em>  Again, they should be able to identify 0.</p>
  
  <p>Now, it's time for the big reveal.  (My description here is in Java)</p>
  
  <p><em>"When I want to get at that first character, <code>h</code>, I do it with <code>myString.charAt(0)</code>.  Given what we just discussed, why do you think I would use <code>0</code>, and not <code>1</code>?"</em></p>
  
  <p>At this point, they will naturally move to the idea that it is at the beginning, and that we have moved no steps from the beginning.</p>
  
  <p><em>"Excellent.  This is an example of an</em> <strong><em>index value.</em></strong>  <em>And, in Java, when we do index values, we don't count from '1', we actually count the DISTANCE from the start.  So, if we want the first character, we move no distance.  And how far do we move to get the 3rd character? ..."</em></p>
  
  <p>When you later get to arrays, you can remind them of the concept, and just say that it is being used again here.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T21:26:15.200Z
Answers.Text: I like this. You can get more real-life examples based on counting the DISTANCE. e.g. If you knock on the first door in an apartment block and ask where Alice lives, they say 'go down 3 doors', that's like indexing into the array of apartments. And if Alice lives in the first then you don't move, ie you go down 0 doors.
Answers.UserDisplayName: Rory
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T11:08:20.380Z
Answers.LastActivityDate: 2017-06-15T15:37:37.950Z
Answers.LastEditDate: 2017-06-15T15:37:37.950Z
Answers.UserDisplayName: Ben I.
Answers.Body: <p>Ages in the United States (<a href="https://en.wikipedia.org/wiki/East_Asian_age_reckoning" rel="noreferrer">it's not the same around the world</a>).</p>
  
  <p>For the first year of life, children are 0 years old. Only after completion of a year is the age changed to 1. By this logic, a child in his/her second year of life is 1 just as the second element of an array is found at index 1.</p>
  
  <p><strong>Edit</strong>: another example is the counting of centuries. An event occurring in the 100s would be in the second century.</p>
  
  <p><strong>Edit #2</strong>: watching the Champions League Final, I just thought of another: the timing of soccer. A goal scored during the 20th minute is scored while 19:xx is on the clock.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T11:22:57.693Z
Answers.Text: I thing this answer is exactly it. Just like a ruler, and @Choirbean's string answer: we measure from 0, but (usually) count from 1. In arrays we are giving the distance, a measure.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T18:46:24.897Z
Answers.Text: I really like the idea of thinking of the index not as a count per se but as a measurement from the origin.
Answers.UserDisplayName: Peter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-24T22:09:32.793Z
Answers.Text: I think this is the right answer to the original question, but want to add for the OP something unrelated that I've found useful: the words that languages and libraries use can make this much easier or harder to grasp. Whenever I'm dealing with 0-based indexes, I mentally translate to skip and take, which makes them perfectly clear. If you can find a library that uses these terms as your first introduction to the concept, it might make it easier to learn.
Answers.UserDisplayName: ShawnMartin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-30T08:22:31.637Z
Answers.Text: "For the first year of life, children are 0 years old. " but we would say that they were in their first year of life
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T07:40:34.477Z
Answers.LastActivityDate: 2017-06-03T19:15:34.200Z
Answers.LastEditDate: 2017-06-03T19:15:34.200Z
Answers.UserDisplayName: Peter
Answers.Body: <p>I don't see <strong>anything</strong> confusing in 0-based indexing. In fact, it seems that 0-based indexing is not less natural for humans than 1-based indexing. Humans use 1-based indexing just because of following some long-standing, but weird tradition.</p>
  
  <p>I remember that when I was a pre-school child (&lt;7 years old) and has not been yet influenced by social traditions of numbering (I didn't visit a kindergarten), I used a <strong>mixed numbering scheme</strong>. For example, when we had in our house a lot of guests sitting around a table, and I was crawling under the table, plotting some childish prank — and I needed to make an association between torsos (I see above the table when I'm out of under-the-table area) and pairs of legs (I see when I'm under the table); I don't remember what prank I was planning, but I strongly remember that to remember a position of a victim-guest, I used scheme like "<strong>three+one</strong>":<br>
  <img src="https://i.sstatic.net/FaMoz.png" alt="&quot;three+one&quot; numbering"> <sup>(picture based on <a href="//thenounproject.com/icon/880687/" rel="noreferrer">"Break" by Llisole</a> (<a href="//creativecommons.org/licenses/by/3.0/us/" rel="noreferrer">cc</a>))</sup><br>
  I.e. neither referring this guest as third, nor referring him as fourth was not enough intuitive for me. Indeed: "three" is a number of guests <em>before</em> him — not his position; "four" is a number of guests <em>including</em> him — not his position; probably, if I knew fractional numbers at that time, I'd referred him as "3½-th", but I didn't.<br>
  <sub>I remembered this episode well, because when I was running to another room to take equipment needed for prank, muttering "three plus one" to myself aloud (not to forget it), the same age girl who was one of guests shouted "four" — which annoyed me very much ("f@#k, I know how to add much larger numbers, but '3+1' is a position specification rather than just sum").</sub></p>
  
  <p>0-based stuff is preferrable everywhere, where <strong>gauges</strong> are used. You start time from zero (you say "0 hours" at midnight, not "1 hour"; "0 minutes" when a new hour starts, not "1 minute"; "0 seconds" when a new minute starts, not "1 second"), temperature from zero, distance from zero, etc. What really confuses is actual discrepancy between 0-based and 1-based, not the 0-based itself; for example, I needed some time at school to realize why people usually call it "<em>&lt;N+1></em>-th second" ("minute", "hour", etc) when it's still "0:00:<em>&lt;N></em>" on stopwatch:<br>
  <img src="https://i.sstatic.net/klYpB.png" alt="Time scale: time range from 0:00:&lt;N&gt; to 0:00:&lt;N+1&gt; is usually called as &lt;N+1&gt;-th second"><br>
  <sub>IMHO: Nothing would break if some day people will finally switch to 0-based indexing; even vice versa, it would become much more intuitive and comfortable — a stopwatch shows "0:00:<em>&lt;N></em>", so let's call it "<em>&lt;N></em>-th second" (not "<em>&lt;N+1></em>-th"); but some-why people had chosen this weird way of 1-based indexing long ago.</sub></p>
  
  <p>TL;DR: In 0-based indexing we count items <em>before (up to, but excluding)</em> current; in 1-based indexing we count items <em>through (up to and including)</em> current. Neither way is in fact intuitive (for a child that has free choice). Both ways need to be learned.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T12:58:03.413Z
Answers.LastActivityDate: 2017-05-27T14:42:45.387Z
Answers.LastEditDate: 2017-05-27T14:42:45.387Z
Answers.UserDisplayName: Sasha
Answers.Body: <p>Rulers start at zero:</p>
  
  <p><a href="https://i.sstatic.net/nx70f.jpg" rel="noreferrer"><img src="https://i.sstatic.net/nx70f.jpg" alt="enter image description here"></a></p>
  
  <p>At zero centimetres, you have nothing, whereas at one centimetres, you have one unit of length. Memory is similar: You start filling at the beginning (zero), hence, the first <em>x</em>-memory units contain <em>x</em> units of data, the next unit contains unit <em>x+1</em>. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T17:55:51.483Z
Answers.Text: I think comparing an array to a ruler is probably the nicest, most visual thing at hand. If you have a ruler with both inches and centimeters you also have a metaphor for different memory sizes for variable types.
Answers.UserDisplayName: ObscureOwl
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-29T18:05:16.150Z
Answers.Text: Since this question was posted, I have come to realise that a ruler is not a metaphor for this think. It is the think. Zero indexing is simply measuring the distance from the start. There are many examples of this in the other answers.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-31T14:14:26.280Z
Answers.Text: A great visual example
Answers.UserDisplayName: codingCat
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-25T18:13:49.663Z
Answers.Text: I don't think the ruler is a good metaphor at all. The ruler begins with the *first* centimetre, not the zeroth. And the first centimetre - that is, centimetre 1 - starts at zero and ends at one. There is unfortunately no way to reconcile these concepts. The ordinal number words (and equivalents in other languages) predate the invention of the number zero by millennia.
Answers.UserDisplayName: Steve
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-18T01:39:28.093Z
Answers.Text: It's not just rulers.  On a larger scale, most highway and railroad networks start with a [zero milestone](https://en.wikipedia.org/wiki/Kilometre_zero).
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T13:13:29.403Z
Answers.LastActivityDate: 2020-02-25T13:13:29.403Z
Answers.UserDisplayName: user2768
Answers.Body: <p>Exponents representing the values of the digits in positional number systems. </p>
  
  <p>e.g. the-arabic-system / denary / the-system-you-learnt-in-primary-school.</p>
  
  <pre><code>10³  10² 10¹ 10⁰
  1000 100 10  1
  </code></pre>
  
  <p>or binary</p>
  
  <pre><code>2³ 2² 2¹ 2⁰
  8  4  2  1
  </code></pre>
  
  <p>The binary example in binary</p>
  
  <pre><code>10¹¹ 10¹⁰ 10¹ 10⁰
  1000 100  10  1
  </code></pre>
  
  <hr>
  
  <p>This was @GypsySpellweaver idea, see comment.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-06T06:30:07.273Z
Answers.Text: Same for polynomials: p(x) = a₀ x⁰ + a₁ x¹ + a₂ x² + … + aₙ xⁿ.
Answers.UserDisplayName: Sasha
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-30T16:06:43.633Z
Answers.Text: I think this is my favorite example, and moreso because it's likely to come up in an intro computing course before any other use-cases (arrays, etc.). It connects to basic knowledge students should already possess, so I've come to highlight it and foreshadow that we'll be using that a lot in later topics.
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-25T18:02:54.510Z
Answers.LastActivityDate: 2017-06-25T18:02:54.510Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>An analogy that will work well in Europe, but not in North America:</p>
  
  <p><a href="https://commons.wikimedia.org/wiki/File:Internal_lift_control_panel.jpg" rel="noreferrer"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Internal_lift_control_panel.jpg/320px-Internal_lift_control_panel.jpg" alt="Lift Control Panel"></a></p>
  
  <p><sup>Image licensed under the CC BY-SA 3.0 by <a href="https://commons.wikimedia.org/wiki/User:Bidgee" rel="noreferrer">Bidgee</a> of Wikimedia Commons.</sup></p>
  
  <p>Floors (in European countries) are typically numbered with 0 (or G) as the ground floor, then 1 as the first floor above ground, etc. This could easily be compared to a list/array of floors, with <code>floors[0]</code> being ground, <code>floors[1]</code> being the first floor, and so on.</p>
  
  <p>Note that this analogy won't work particularly well in North American countries, as their convention is to number the ground floor as 1. Nevertheless, the visual element of a building and lift numbered from zero could serve as an intriguing example to illustrate zero-based indexing.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-06T14:29:51.450Z
Answers.Text: The problem with this is, that, while they are numbered 0, 1, and so on, the floor with number one is also called the first floor (at least in Germany and other European countries I know of), while in an array the first element is not indexed with 1.
Answers.UserDisplayName: Raimund Krämer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-03T10:56:04.110Z
Answers.Text: @RaimundKrämer well, that's a defect of the way we talk about arrays, probably stemming back to Fortran days. I avoid using _erstes_, _zweites_ etc. to refer to array elements, and say instead _Startelement_ and _Nachfolgerelement_. In English, I use list terminology: the _head_ and the _head of tail_. (Naming more than the frontmost two, the last, or the middle elements is seldom necessary.)
Answers.UserDisplayName: leftaroundabout
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-31T14:07:39.010Z
Answers.Text: <colorful curse redacted>, you beat me to it. An elevator was the first example I thought about.  :-)
Answers.UserDisplayName: codingCat
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T09:32:56.477Z
Answers.LastActivityDate: 2017-05-27T09:32:56.477Z
Answers.UserDisplayName: Aurora0001
Answers.Body: <h1>The clock (24 hours system)</h1>
  <p>If we look at the clock, we have two examples of counting hours. The 24 hour system starts at 0. The 12 hour system is interesting, neither starting at 0 or 1.</p>
  <h2>The 12-hour clock</h2>
  <p>In the 12-hour clock system we start at 12 and make our way up to 11.</p>
  <p>This needs some explanation. The 12 hour clock has a funny way of counting, that you may not have noticed. It goes <code>12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11</code>. (look carefully at a clock that has AM and PM indicators. Without these, then it is just a regular circular (mod 12) counting system.) <code>12am, 1am, 2am, 3am, 4am, 5am, 6am, 7am, 8am, 9am, 10am, 11am 12pm, 1pm, 2pm, 3pm, 4pm, 5pm, 6pm, 7pm, 8pm, 9pm, 10pm, 11pm</code></p>
  <h1>The 24-hour clock:</h1>
  <p>In the 24-hour clock things are simpler. Numbers just go up, until we get to the end of the day (mod 24). However we start with zero, this may be to keep it backward compatible with the 12-hour system, but also makes the time of day, be the elapsed time since the start of the day (see other answers that stat that starting at zero is just how you measure things).</p>
  <p><span class="math-container">$00\colon{}00\colon{}00$</span> → <span class="math-container">$23\colon{}59\colon{}59.99\dot9$</span></p>
  <hr />
  <p>Note I have finally found an advantage of daylight shifting time. In the summer noon is at 13:00, and midnight at 1-oclock. This makes the 12hour system start at 1: i.e 1, 2, 3 … 11, 12; (instead of 12, 1, 2, 3 … 11). However AM and PM are now wrong, as the meridian does not move.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-15T21:36:34.340Z
Answers.Text: @nocomprende strangely the 11th hour meant from 11pm. So the **12th** hour of the afternoon.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-23T14:00:41.890Z
Answers.Text: @nocomprende I just realised that the 11hour is like an octave. An octave is named because depending how you count there is ether 7 or 12 notes in an octave. The 2 biggest cases of error are, null references, not validating inputs, and out by one errors.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T18:55:26.083Z
Answers.Text: I think the idea is that the first hour of the day in the 24-hour clock is 00:00. Hence, what would be 12:01 am is in fact 00:01. See http://militarytimechart.com/
Answers.UserDisplayName: Peter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-05-27T10:59:44.757Z
Answers.LastActivityDate: 2020-08-30T13:50:22.673Z
Answers.LastEditDate: 2020-08-30T13:50:22.673Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>Think about human ages.  Babies that are newly born are at age 0.  That's zero-based indexing.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-01T13:52:16.623Z
Answers.Text: This is also true for anything that is measured. In the end I realised that zero indexing is not counting; it is measuring.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-23T23:02:56.167Z
Answers.LastActivityDate: 2020-02-23T23:02:56.167Z
Answers.UserDisplayName: ncmathsadist
Answers.Body: <p>Distances in boardgames with discrete spaces. For example: Chess, wargames, Dungeons &amp; Dragons played on a battlemap, etc. Counting movement, the space you start in counts as space zero (or more accurately: if a piece stays in the same space, then it has moved zero distance).</p>
  <p>There are a number of situations in wargames and RPGs where two pieces might share the same space; and if one shoots at the other, then the distance between them is considered to be zero. Many D&amp;D magic spells have a range listed as zero to reflect this (thinking past editions here; current edition explicitly says &quot;Self&quot; or &quot;Touch&quot; in these cases).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-27T16:48:57.873Z
Answers.LastActivityDate: 2020-06-27T16:48:57.873Z
Answers.UserDisplayName: Daniel R. Collins
Answers.Body: <h1>UK school years</h1>
  
  <p>We used to have years <code>1,2, 1,2,3,4, 1,2,3,4,5,6th form</code>.</p>
  
  <p>We then changed to <code>1,2,3,4,5,6,7,8,9,10,11,12,13</code> (years 12 and 13 are 6th form, no one know where this name comes from).</p>
  
  <p>Then we added reception year, to get <code>R,1,2,3,4,5,6,7,8,9,10,11,12,13</code>.<br>
  <code>R</code> is just a different symbol for <code>0</code>. (In the US K is used for 0.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-14T19:55:40.110Z
Answers.Text: In the U.S. there would be 'K' and 13 would mean college, 'K' has been around for quite a while -- everything else is the same!
Answers.UserDisplayName: JosephDoggie
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-15T10:01:19.457Z
Answers.Text: @JosephDoggie In UK years 12 and 13, can be college, but some(may be most) schools, have a 6th form. This Does the same as the early college years, but at a school. After these 2 years, a lot of pupils go on to university (or work, or more college).
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-12T00:26:29.203Z
Answers.Text: In the US, there's also sometimes Pre-K, which I guess would be -1.
Answers.UserDisplayName: Solomon Ucko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-12T09:22:59.060Z
Answers.Text: @SolomonUcko same in UK, (I love -1 indexed arrays)
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-08-26T18:30:05.870Z
Answers.LastActivityDate: 2018-09-15T10:02:30.763Z
Answers.LastEditDate: 2018-09-15T10:02:30.763Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>For anyone old enough (&gt;30years):</p>
  <p>In the UK a few years back we had only a few TV channels, first 1, then 2, they slowly increased to 5: BBC1, BBC2, ITV, channel 4, and eventually channel 5 The TVs typically had 10 numbered slots (sometimes 8). We would but the channels into the slots 1 = BBC1, 2 =  BBC2, 3 = ITV, 4 = channel-4, 5 = channel-5. So where to put the video recorder ( a device to record TV shows for later viewing). If we use slot 6 and the TV companies finally add a 6th channel, then we will have to move it, so if the TV has a slot zero, then we put it in there.</p>
  <hr />
  <p>Eventually we suddenly got a load more, with digital TV (Freeview).
  This story ignores, payed for channels (satellite and cable).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-29T14:07:58.203Z
Answers.Text: This numbering system was far from universal on UK TVs. A Hitachi model we had in the early 90s had 12 presets, but they were numbered up from 1 to 12. Some models I encountered later c.2000 would treat channel 0 as the AV/SCART input, but only a subset did this.
Answers.UserDisplayName: Kaz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-29T17:44:32.250Z
Answers.Text: @Kaz. True, I have updated the answer.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-05T07:21:04.780Z
Answers.Text: I quickly read all the answers and it seems that no one mentioned 21th century starts from 2000, another typical example of 0 based index
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-01T17:44:43.050Z
Answers.Text: @Qiulang 邱朗 Your comment is attached to an answer, not to the question.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-01T17:47:46.213Z
Answers.Text: @Qiulang 邱朗 There is already an answer and comment that refutes it, and explains why. https://cseducators.stackexchange.com/a/691/204
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-05-27T10:48:23.780Z
Answers.LastActivityDate: 2024-07-01T17:41:34.063Z
Answers.LastEditDate: 2024-07-01T17:41:34.063Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>A common example I use is centuries/years. We start with the first century on a range of 0-100 years. Or the first year of a century, which always ends in 00. It describes the amount of x that has passed, not the n-th x.</p>
  
  <p>The word "first" is the confusing thing for beginners I feel. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-15T21:42:34.170Z
Answers.Text: There was no your zero, therefore the end of a century ends in 00. 2000 was the last year of the 20th century. Most people get this wrong, the rest of us let it pass for a year, then have a 2nd party.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-27T23:00:10.687Z
Answers.Text: I sometimes say "oneth" to avoid the ambiguity of "first".
Answers.UserDisplayName: Ellen Spertus
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-06T11:55:33.027Z
Answers.Text: @ctrl-alt-delor actually, it’s the perfect example of what a mess is created when not using index zero. ”Most people get this wrong” by intuitively assuming that a century should start with year zero and end with year 99 and are “wrong”, because there was no year zero. But we still live in the 21st century whose index (year number) starts with a 20 (except for the last one) and the third millennium whose index (year number) starts with a two (except for the last one). And if that one guy was truly born 24.12.1, your 2nd party was wrong as well (otherwise, that number is totally meaningless).
Answers.UserDisplayName: Holger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T06:33:10.797Z
Answers.Text: @ctrl-alt-delor: You are correct. However, this 0-based system is actually used to express the age of a person, and people are not known to struggle with that. The difference is that when you're at "age 0", we omit the year count altogether: "He is 3 months old", not "He is 0 years and 3 months old". When you 0-index, and you're at index 0, that often entails deferring to a more precise (non-0) measurement.
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T07:11:34.727Z
Answers.Text: @Flater yes you bring up an interesting point. In Europe and US, we measure age, so 3 years old, means that you are between 3 and 4 years old, that is have been alive 3 years, but no more than 4 (Well maybe an extra ¾ day, see leap year). In some parts of the world, they say what year you are in. Therefore a new born is 1, (in 1st year). This is similar to school year, before we added year zero (K in US, R in UK). In any respect the systems are all self consistent. but can result in an out by one error if the 2 people communicating are using a different system.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-25T13:31:00.500Z
Answers.Text: @ctrl-alt-delor so the year zero was part of the -1th century? Or was the first century 101 years long? That's a cool fact.
Answers.UserDisplayName: W. Vrielink
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-26T09:17:58.627Z
Answers.Text: @Karnat Good question. No there rely was no year zero, I see my comment was not clear, but not only was the first year year 1, the year before was year -1 (no year zero). The person that invented it, did not know about zero. So we get -3, -2, -1, 1, 2, 3. Dates and time are hard  https://www.youtube.com/watch?v=-O4mYiP2zPQ https://www.youtube.com/watch?v=-5wpm-gesOY
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-15T16:27:34.600Z
Answers.LastActivityDate: 2017-06-15T16:27:34.600Z
Answers.UserDisplayName: W. Vrielink
Answers.Body: <p>The <strong>ground floor</strong> is the <em>de facto</em> 0th floor.</p>
  <p>Humans are born at <strong>age 0</strong>.</p>
  <p><strong>Military time</strong> starts at <strong>0</strong>:00. Despite the day having 24 hours, it is not correct to write 24:00.</p>
  <p>As a side-note, Japanese TV uses <strong>0-indexed 12-hour notation</strong>. That means 11 AM is followed by 0 PM, not 12 PM.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-01T21:35:06.717Z
Answers.Text: Counting 12,1,2,3,4,5,6,7,8,9,10,11 is what is strange. Measuring from 0 is, (what is a good word for this, oh yes) measuring.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-30T14:20:34.813Z
Answers.Text: Nice note about Japanese TV. However the rest is already covered in other answer. If you were to write about just Japaneses TV, then I would upvote.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-31T17:10:27.440Z
Answers.Text: In Japan, they also use the implied modulo system, where it's common to indicate hours with numbers 24 or greater. For example, a bar might be open from 20 till 26. It makes it clear that the closing time is past midnight. I love that system!
Answers.UserDisplayName: Kuba hasn't forgotten Monica
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-21T16:25:33.030Z
Answers.LastActivityDate: 2020-06-21T16:25:33.030Z
Answers.UserDisplayName: haley
Body: <p>It can be perplexing for students to begin counting at 0 when they enter a CS class. I made it a point over and over to talk about "Day 0" and "Week 0" in the opening days and weeks just to build familiarity with the idea. Even so, I sought when explaining this idea to ground it in some real-life/non-CS example where we as humans use 0-indexing naturally and possibly without knowing it. </p>
  
  <p>Question: <strong>where can we find 0-indexing outside of CS and grounded in everyday human experience?</strong></p>
  
  <p>I'll share the one example I can think of below (<a href="https://stackoverflow.blog/2011/07/01/its-ok-to-ask-and-answer-your-own-questions/">Q&amp;A style</a>), but I'd love to hear more, potentially better, examples.</p>
  
  <p>[Note: This question relates to <a href="https://cseducators.stackexchange.com/questions/211/lesson-idea-arrays-pointers-and-syntactic-sugar">another I just posed</a>.]</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-04T07:56:51.520Z
Comments.Text: @GypsySpellweaver love the positional (Arabic number system) ($10^n 10^2 10^1 10^0$). You should add this as an answer. I think this question will benefit from lots of answers, as different pupils will grok different analogies.
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-04T08:00:23.633Z
Comments.Text: @richard That's one that needs decent algebra to fathom, but can fit if the class is right.
Comments.UserDisplayName: Gypsy Spellweaver
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-21T03:27:02.580Z
Comments.Text: ob xkcd: https://xkcd.com/163/
Comments.UserDisplayName: Ellen Spertus
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-27T23:02:58.047Z
Comments.Text: another cartoon: http://i.imgur.com/uqhv4mB.png
Comments.UserDisplayName: Ellen Spertus
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-27T10:12:05.053Z
Comments.Text: The index of an array is a measure of the distance from the start. (not what you asked for, but another way to explain it).
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-27T10:32:38.070Z
Comments.Text: There are a few here: https://en.wikipedia.org/wiki/Zero-based_numbering
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-27T19:13:51.677Z
Comments.Text: When playing board games, my six year old starts counting from zero, for the square her counter is on.
Comments.UserDisplayName: Miles
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-28T09:05:51.413Z
Comments.Text: Was there a, very good, answer about azimov's laws of robotics here? Or did I dream it?
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-28T10:04:56.763Z
Comments.Text: If you thing zero-indexing is weird (see answer below for why it is not), then consider temperature: °F and °C have a strange starting point, −459.67°F and −273.15°C.
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-29T18:41:19.233Z
Comments.Text: One is the first natural number, but nought is the zeroth.
Comments.UserDisplayName: Miles
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-30T13:44:47.483Z
Comments.Text: As seen by the majority of the comments, the key is to separate `index` from `count`. `index` relates to distance or movement, which has zero as the beginning, while `count` relates to quantity, which has a (possibly) natural beginning of one. If the students have the proper level of mathematics, you can also use the powers-of-10 (the first, lowest, digit is x*10^0.
Comments.UserDisplayName: Gypsy Spellweaver
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-30T08:27:22.003Z
Comments.Text: Why not just explain the hardware reason why array indexes start at zero *in some languages*?  There isn't a good abstract reason why the compiler writers did this, and suggesting there is is likely to be a block for some students.
Comments.UserDisplayName: Dikran Marsupial
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-30T08:58:12.233Z
Comments.Text: @DikranMarsupial it is just distance.Try using a language that indexes starting at 1. You end up subtracting 1 doing the calculation then adding 1. It is a complete pain. e.g find the centre index.
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-30T10:05:04.467Z
Comments.Text: @ctrl-alt-delor I have used languages which index starting at 1.  The two languages I program in most are C/C++ and MATLAB.  The point is that it is better to be honest when teaching and give the real reason why something is the way it is, rather than give a post-hoc fiction.  I personally don't find it a problem, unless people try to fudge it (e.g. "Numerical Recipes in C" where they did pretty much exactly that IIRC and made it much harder to integrate into C programs).
Comments.UserDisplayName: Dikran Marsupial
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-31T14:09:42.660Z
Comments.Text: I love this question.  This is the type of thing I am always looking for, and encouraging my students to develop, but it never would have occurred to me to ask it here.  :-)
Comments.UserDisplayName: codingCat
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-15T04:45:54.980Z
Comments.Text: My apartment complex has multiple buildings with multiple floors, ten flats each floor. The flats are numbered 0–9. The schema is: [building number][floor][unit number]. So Apartment 110 is building 1, first floor, flat 0; Apartment 332, building 3, third floor, flat 3. I won't say that the *reason* I live where I do is the zero indexing, but it pleases me.
Comments.UserDisplayName: verbose
Tags: <lesson-ideas><arrays><abstraction>
Title: Real life examples of 0-indexing
ThreadText: # Real life examples of 0-indexing
  
  (Asked by: username_0 on 2017-05-27)
  
  It can be perplexing for students to begin counting at 0 when they enter a CS class. I made it a point over and over to talk about "Day 0" and "Week 0" in the opening days and weeks just to build familiarity with the idea. Even so, I sought when explaining this idea to ground it in some real-life/non-CS example where we as humans use 0-indexing naturally and possibly without knowing it.
  
  Question: **where can we find 0-indexing outside of CS and grounded in everyday human experience?**
  
  I'll share the one example I can think of below ([Q&A style](https://stackoverflow.blog/2011/07/01/its-ok-to-ask-and-answer-your-own-questions/)), but I'd love to hear more, potentially better, examples.
  
  [Note: This question relates to [another I just posed](https://cseducators.stackexchange.com/questions/211/lesson-idea-arrays-pointers-and-syntactic-sugar).]
  
  **Tags:** lesson-ideas, arrays, abstraction
  
  > **Comments:**
  > **username_1**: The index of an array is a measure of the distance from the start. (not what you asked for, but another way to explain it).  
  > **username_1**: There are a few here: https://en.wikipedia.org/wiki/Zero-based_numbering  
  > **username_4**: When playing board games, my six year old starts counting from zero, for the square her counter is on.  
  > **username_1**: Was there a, very good, answer about azimov's laws of robotics here? Or did I dream it?  
  > **username_1**: If you thing zero-indexing is weird (see answer below for why it is not), then consider temperature: °F and °C have a strange starting point, −459.67°F and −273.15°C.  
  > **username_4**: One is the first natural number, but nought is the zeroth.  
  > **username_2**: As seen by the majority of the comments, the key is to separate `index` from `count`. `index` relates to distance or movement, which has zero as the beginning, while `count` relates to quantity, which has a (possibly) natural beginning of one. If the students have the proper level of mathematics, you can also use the powers-of-10 (the first, lowest, digit is x*10^0.  
  > **username_1**: @username_2 love the positional (Arabic number system) ($10^n 10^2 10^1 10^0$). You should add this as an answer. I think this question will benefit from lots of answers, as different pupils will grok different analogies.  
  > **username_2**: @richard That's one that needs decent algebra to fathom, but can fit if the class is right.  
  > **username_3**: ob xkcd: https://xkcd.com/163/  
  > **username_3**: another cartoon: http://i.imgur.com/uqhv4mB.png  
  > **username_5**: Why not just explain the hardware reason why array indexes start at zero *in some languages*?  There isn't a good abstract reason why the compiler writers did this, and suggesting there is is likely to be a block for some students.  
  > **username_1**: @username_5 it is just distance.Try using a language that indexes starting at 1. You end up subtracting 1 doing the calculation then adding 1. It is a complete pain. e.g find the centre index.  
  > **username_5**: @username_1 I have used languages which index starting at 1.  The two languages I program in most are C/C++ and MATLAB.  The point is that it is better to be honest when teaching and give the real reason why something is the way it is, rather than give a post-hoc fiction.  I personally don't find it a problem, unless people try to fudge it (e.g. "Numerical Recipes in C" where they did pretty much exactly that IIRC and made it much harder to integrate into C programs).  
  > **username_6**: I love this question.  This is the type of thing I am always looking for, and encouraging my students to develop, but it never would have occurred to me to ask it here.  :-)  
  > **username_7**: My apartment complex has multiple buildings with multiple floors, ten flats each floor. The flats are numbered 0–9. The schema is: [building number][floor][unit number]. So Apartment 110 is building 1, first floor, flat 0; Apartment 332, building 3, third floor, flat 3. I won't say that the *reason* I live where I do is the zero indexing, but it pleases me.  
  
  ---
  
  ## 21 answers
  
  ### Answer by username_16 on 2017-05-27. Score: 49
  
  You can get at this concept very intuitively in strings before you ever get to arrays. Take a string like "hello world" and ask them a subtle-sounding point: does the string begin here: `"*hello world"`, or here: `"h*ello world"`. They'll certainly be able to identify the correct answer.
  
  Then ask, *"how far from the start of the string do we have to go to get to the 'h'? Answer in a number of characters. Do we have to move 5 characters away? 3? 1?"* Again, they should be able to identify 0.
  
  Now, it's time for the big reveal. (My description here is in Java)
  
  *"When I want to get at that first character, `h`, I do it with `myString.charAt(0)`. Given what we just discussed, why do you think I would use `0`, and not `1`?"*
  
  At this point, they will naturally move to the idea that it is at the beginning, and that we have moved no steps from the beginning.
  
  *"Excellent. This is an example of an* ***index value.*** *And, in Java, when we do index values, we don't count from '1', we actually count the DISTANCE from the start. So, if we want the first character, we move no distance. And how far do we move to get the 3rd character? ..."*
  
  When you later get to arrays, you can remind them of the concept, and just say that it is being used again here.
  
  > **Comments:**
  > **username_17**: I like this. You can get more real-life examples based on counting the DISTANCE. e.g. If you knock on the first door in an apartment block and ask where Alice lives, they say 'go down 3 doors', that's like indexing into the array of apartments. And if Alice lives in the first then you don't move, ie you go down 0 doors.  
  
  ---
  
  ### Answer by username_0 on 2017-05-27. Score: 44
  
  Ages in the United States ([it's not the same around the world](https://en.wikipedia.org/wiki/East_Asian_age_reckoning)).
  
  For the first year of life, children are 0 years old. Only after completion of a year is the age changed to 1. By this logic, a child in his/her second year of life is 1 just as the second element of an array is found at index 1.
  
  **Edit**: another example is the counting of centuries. An event occurring in the 100s would be in the second century.
  
  **Edit #2**: watching the Champions League Final, I just thought of another: the timing of soccer. A goal scored during the 20th minute is scored while 19:xx is on the clock.
  
  > **Comments:**
  > **username_1**: I thing this answer is exactly it. Just like a ruler, and @Choirbean's string answer: we measure from 0, but (usually) count from 1. In arrays we are giving the distance, a measure.  
  > **username_0**: I really like the idea of thinking of the index not as a count per se but as a measurement from the origin.  
  > **username_18**: I think this is the right answer to the original question, but want to add for the OP something unrelated that I've found useful: the words that languages and libraries use can make this much easier or harder to grasp. Whenever I'm dealing with 0-based indexes, I mentally translate to skip and take, which makes them perfectly clear. If you can find a library that uses these terms as your first introduction to the concept, it might make it easier to learn.  
  > **username_5**: "For the first year of life, children are 0 years old. " but we would say that they were in their first year of life  
  
  ---
  
  ### Answer by username_12 on 2017-05-27. Score: 38
  
  An analogy that will work well in Europe, but not in North America:
  
  [![Lift Control Panel](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Internal_lift_control_panel.jpg/320px-Internal_lift_control_panel.jpg)](https://commons.wikimedia.org/wiki/File:Internal_lift_control_panel.jpg)
  
  Image licensed under the CC BY-SA 3.0 by [Bidgee](https://commons.wikimedia.org/wiki/User:Bidgee) of Wikimedia Commons.
  
  Floors (in European countries) are typically numbered with 0 (or G) as the ground floor, then 1 as the first floor above ground, etc. This could easily be compared to a list/array of floors, with `floors[0]` being ground, `floors[1]` being the first floor, and so on.
  
  Note that this analogy won't work particularly well in North American countries, as their convention is to number the ground floor as 1. Nevertheless, the visual element of a building and lift numbered from zero could serve as an intriguing example to illustrate zero-based indexing.
  
  > **Comments:**
  > **username_25**: The problem with this is, that, while they are numbered 0, 1, and so on, the floor with number one is also called the first floor (at least in Germany and other European countries I know of), while in an array the first element is not indexed with 1.  
  > **username_26**: @username_25 well, that's a defect of the way we talk about arrays, probably stemming back to Fortran days. I avoid using _erstes_, _zweites_ etc. to refer to array elements, and say instead _Startelement_ and _Nachfolgerelement_. In English, I use list terminology: the _head_ and the _head of tail_. (Naming more than the frontmost two, the last, or the middle elements is seldom necessary.)  
  > **username_6**: <colorful curse redacted>, you beat me to it. An elevator was the first example I thought about.  :-)  
  
  ---
  
  ### Answer by username_1 on 2017-05-27. Score: 24
  
  # The clock (24 hours system)
  
  If we look at the clock, we have two examples of counting hours. The 24 hour system starts at 0. The 12 hour system is interesting, neither starting at 0 or 1.
  
  ## The 12-hour clock
  
  In the 12-hour clock system we start at 12 and make our way up to 11.
  
  This needs some explanation. The 12 hour clock has a funny way of counting, that you may not have noticed. It goes `12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11`. (look carefully at a clock that has AM and PM indicators. Without these, then it is just a regular circular (mod 12) counting system.) `12am, 1am, 2am, 3am, 4am, 5am, 6am, 7am, 8am, 9am, 10am, 11am 12pm, 1pm, 2pm, 3pm, 4pm, 5pm, 6pm, 7pm, 8pm, 9pm, 10pm, 11pm`
  
  # The 24-hour clock:
  
  In the 24-hour clock things are simpler. Numbers just go up, until we get to the end of the day (mod 24). However we start with zero, this may be to keep it backward compatible with the 12-hour system, but also makes the time of day, be the elapsed time since the start of the day (see other answers that stat that starting at zero is just how you measure things).
  
  $00\colon{}00\colon{}00$ → $23\colon{}59\colon{}59.99\dot9$
  
  ---
  
  Note I have finally found an advantage of daylight shifting time. In the summer noon is at 13:00, and midnight at 1-oclock. This makes the 12hour system start at 1: i.e 1, 2, 3 … 11, 12; (instead of 12, 1, 2, 3 … 11). However AM and PM are now wrong, as the meridian does not move.
  
  > **Comments:**
  > **username_0**: I think the idea is that the first hour of the day in the 24-hour clock is 00:00. Hence, what would be 12:01 am is in fact 00:01. See http://militarytimechart.com/  
  > **username_1**: @nocomprende strangely the 11th hour meant from 11pm. So the **12th** hour of the afternoon.  
  > **username_1**: @nocomprende I just realised that the 11hour is like an octave. An octave is named because depending how you count there is ether 7 or 12 notes in an octave. The 2 biggest cases of error are, null references, not validating inputs, and out by one errors.  
  
  ---
  
  ### Answer by username_19 on 2017-05-27. Score: 11
  
  I don't see **anything** confusing in 0-based indexing. In fact, it seems that 0-based indexing is not less natural for humans than 1-based indexing. Humans use 1-based indexing just because of following some long-standing, but weird tradition.
  
  I remember that when I was a pre-school child (<7 years old) and has not been yet influenced by social traditions of numbering (I didn't visit a kindergarten), I used a **mixed numbering scheme**. For example, when we had in our house a lot of guests sitting around a table, and I was crawling under the table, plotting some childish prank — and I needed to make an association between torsos (I see above the table when I'm out of under-the-table area) and pairs of legs (I see when I'm under the table); I don't remember what prank I was planning, but I strongly remember that to remember a position of a victim-guest, I used scheme like "**three+one**":  
  !["three+one" numbering](https://i.sstatic.net/FaMoz.png) (picture based on ["Break" by Llisole](//thenounproject.com/icon/880687/) ([cc](//creativecommons.org/licenses/by/3.0/us/)))  
  I.e. neither referring this guest as third, nor referring him as fourth was not enough intuitive for me. Indeed: "three" is a number of guests *before* him — not his position; "four" is a number of guests *including* him — not his position; probably, if I knew fractional numbers at that time, I'd referred him as "3½-th", but I didn't.  
  I remembered this episode well, because when I was running to another room to take equipment needed for prank, muttering "three plus one" to myself aloud (not to forget it), the same age girl who was one of guests shouted "four" — which annoyed me very much ("f@#k, I know how to add much larger numbers, but '3+1' is a position specification rather than just sum").
  
  0-based stuff is preferrable everywhere, where **gauges** are used. You start time from zero (you say "0 hours" at midnight, not "1 hour"; "0 minutes" when a new hour starts, not "1 minute"; "0 seconds" when a new minute starts, not "1 second"), temperature from zero, distance from zero, etc. What really confuses is actual discrepancy between 0-based and 1-based, not the 0-based itself; for example, I needed some time at school to realize why people usually call it "*<N+1>*-th second" ("minute", "hour", etc) when it's still "0:00:*<N>*" on stopwatch:  
  ![Time scale: time range from 0:00:<N> to 0:00:<N+1> is usually called as <N+1>-th second](https://i.sstatic.net/klYpB.png)  
  IMHO: Nothing would break if some day people will finally switch to 0-based indexing; even vice versa, it would become much more intuitive and comfortable — a stopwatch shows "0:00:*<N>*", so let's call it "*<N>*-th second" (not "*<N+1>*-th"); but some-why people had chosen this weird way of 1-based indexing long ago.
  
  TL;DR: In 0-based indexing we count items *before (up to, but excluding)* current; in 1-based indexing we count items *through (up to and including)* current. Neither way is in fact intuitive (for a child that has free choice). Both ways need to be learned.
  
  
  ---
  
  ### Answer by username_20 on 2020-02-25. Score: 10
  
  Rulers start at zero:
  
  [![enter image description here](https://i.sstatic.net/nx70f.jpg)](https://i.sstatic.net/nx70f.jpg)
  
  At zero centimetres, you have nothing, whereas at one centimetres, you have one unit of length. Memory is similar: You start filling at the beginning (zero), hence, the first *x*-memory units contain *x* units of data, the next unit contains unit *x+1*.
  
  > **Comments:**
  > **username_21**: I think comparing an array to a ruler is probably the nicest, most visual thing at hand. If you have a ruler with both inches and centimeters you also have a metaphor for different memory sizes for variable types.  
  > **username_1**: Since this question was posted, I have come to realise that a ruler is not a metaphor for this think. It is the think. Zero indexing is simply measuring the distance from the start. There are many examples of this in the other answers.  
  > **username_6**: A great visual example  
  > **username_22**: I don't think the ruler is a good metaphor at all. The ruler begins with the *first* centimetre, not the zeroth. And the first centimetre - that is, centimetre 1 - starts at zero and ends at one. There is unfortunately no way to reconcile these concepts. The ordinal number words (and equivalents in other languages) predate the invention of the number zero by millennia.  
  > **username_23**: It's not just rulers.  On a larger scale, most highway and railroad networks start with a [zero milestone](https://en.wikipedia.org/wiki/Kilometre_zero).  
  
  ---
  
  ### Answer by username_1 on 2017-06-25. Score: 9
  
  Exponents representing the values of the digits in positional number systems.
  
  e.g. the-arabic-system / denary / the-system-you-learnt-in-primary-school.
  
  ```
  10³  10² 10¹ 10⁰
  1000 100 10  1
  
  ```
  
  or binary
  
  ```
  2³ 2² 2¹ 2⁰
  8  4  2  1
  
  ```
  
  The binary example in binary
  
  ```
  10¹¹ 10¹⁰ 10¹ 10⁰
  1000 100  10  1
  
  ```
  
  ---
  
  This was @username_2 idea, see comment.
  
  > **Comments:**
  > **username_19**: Same for polynomials: p(x) = a₀ x⁰ + a₁ x¹ + a₂ x² + … + aₙ xⁿ.  
  > **username_24**: I think this is my favorite example, and moreso because it's likely to come up in an intro computing course before any other use-cases (arrays, etc.). It connects to basic knowledge students should already possess, so I've come to highlight it and foreshadow that we'll be using that a lot in later topics.  
  
  ---
  
  ### Answer by username_27 on 2020-02-23. Score: 4
  
  Think about human ages. Babies that are newly born are at age 0. That's zero-based indexing.
  
  > **Comments:**
  > **username_1**: This is also true for anything that is measured. In the end I realised that zero indexing is not counting; it is measuring.  
  
  ---
  
  ### Answer by username_24 on 2020-06-27. Score: 3
  
  Distances in boardgames with discrete spaces. For example: Chess, wargames, Dungeons & Dragons played on a battlemap, etc. Counting movement, the space you start in counts as space zero (or more accurately: if a piece stays in the same space, then it has moved zero distance).
  
  There are a number of situations in wargames and RPGs where two pieces might share the same space; and if one shoots at the other, then the distance between them is considered to be zero. Many D&D magic spells have a range listed as zero to reflect this (thinking past editions here; current edition explicitly says "Self" or "Touch" in these cases).
  
  
  ---
  
  ### Answer by username_1 on 2017-08-26. Score: 3
  
  # UK school years
  
  We used to have years `1,2, 1,2,3,4, 1,2,3,4,5,6th form`.
  
  We then changed to `1,2,3,4,5,6,7,8,9,10,11,12,13` (years 12 and 13 are 6th form, no one know where this name comes from).
  
  Then we added reception year, to get `R,1,2,3,4,5,6,7,8,9,10,11,12,13`.  
  `R` is just a different symbol for `0`. (In the US K is used for 0.)
  
  > **Comments:**
  > **username_11**: In the U.S. there would be 'K' and 13 would mean college, 'K' has been around for quite a while -- everything else is the same!  
  > **username_1**: @username_11 In UK years 12 and 13, can be college, but some(may be most) schools, have a 6th form. This Does the same as the early college years, but at a school. After these 2 years, a lot of pupils go on to university (or work, or more college).  
  > **username_28**: In the US, there's also sometimes Pre-K, which I guess would be -1.  
  > **username_1**: @username_28 same in UK, (I love -1 indexed arrays)  
  
  ---
  
  ### Answer by username_1 on 2017-05-27. Score: 2
  
  For anyone old enough (>30years):
  
  In the UK a few years back we had only a few TV channels, first 1, then 2, they slowly increased to 5: BBC1, BBC2, ITV, channel 4, and eventually channel 5 The TVs typically had 10 numbered slots (sometimes 8). We would but the channels into the slots 1 = BBC1, 2 = BBC2, 3 = ITV, 4 = channel-4, 5 = channel-5. So where to put the video recorder ( a device to record TV shows for later viewing). If we use slot 6 and the TV companies finally add a 6th channel, then we will have to move it, so if the TV has a slot zero, then we put it in there.
  
  ---
  
  Eventually we suddenly got a load more, with digital TV (Freeview).
  This story ignores, payed for channels (satellite and cable).
  
  > **Comments:**
  > **username_29**: This numbering system was far from universal on UK TVs. A Hitachi model we had in the early 90s had 12 presets, but they were numbered up from 1 to 12. Some models I encountered later c.2000 would treat channel 0 as the AV/SCART input, but only a subset did this.  
  > **username_1**: @username_29. True, I have updated the answer.  
  > **username_30**: I quickly read all the answers and it seems that no one mentioned 21th century starts from 2000, another typical example of 0 based index  
  > **username_1**: @username_30 Your comment is attached to an answer, not to the question.  
  > **username_1**: @username_30 There is already an answer and comment that refutes it, and explains why. https://cseducators.stackexchange.com/a/691/204  
  
  ---
  
  ### Answer by username_31 on 2017-06-15. Score: 2
  
  A common example I use is centuries/years. We start with the first century on a range of 0-100 years. Or the first year of a century, which always ends in 00. It describes the amount of x that has passed, not the n-th x.
  
  The word "first" is the confusing thing for beginners I feel.
  
  > **Comments:**
  > **username_1**: There was no your zero, therefore the end of a century ends in 00. 2000 was the last year of the 20th century. Most people get this wrong, the rest of us let it pass for a year, then have a 2nd party.  
  > **username_3**: I sometimes say "oneth" to avoid the ambiguity of "first".  
  > **username_32**: @username_1 actually, it’s the perfect example of what a mess is created when not using index zero. ”Most people get this wrong” by intuitively assuming that a century should start with year zero and end with year 99 and are “wrong”, because there was no year zero. But we still live in the 21st century whose index (year number) starts with a 20 (except for the last one) and the third millennium whose index (year number) starts with a two (except for the last one). And if that one guy was truly born 24.12.1, your 2nd party was wrong as well (otherwise, that number is totally meaningless).  
  > **username_10**: @username_1: You are correct. However, this 0-based system is actually used to express the age of a person, and people are not known to struggle with that. The difference is that when you're at "age 0", we omit the year count altogether: "He is 3 months old", not "He is 0 years and 3 months old". When you 0-index, and you're at index 0, that often entails deferring to a more precise (non-0) measurement.  
  > **username_1**: @username_10 yes you bring up an interesting point. In Europe and US, we measure age, so 3 years old, means that you are between 3 and 4 years old, that is have been alive 3 years, but no more than 4 (Well maybe an extra ¾ day, see leap year). In some parts of the world, they say what year you are in. Therefore a new born is 1, (in 1st year). This is similar to school year, before we added year zero (K in US, R in UK). In any respect the systems are all self consistent. but can result in an out by one error if the 2 people communicating are using a different system.  
  > **username_31**: @username_1 so the year zero was part of the -1th century? Or was the first century 101 years long? That's a cool fact.  
  > **username_1**: @Karnat Good question. No there rely was no year zero, I see my comment was not clear, but not only was the first year year 1, the year before was year -1 (no year zero). The person that invented it, did not know about zero. So we get -3, -2, -1, 1, 2, 3. Dates and time are hard  https://www.youtube.com/watch?v=-O4mYiP2zPQ https://www.youtube.com/watch?v=-5wpm-gesOY  
  
  ---
  
  ### Answer by username_33 on 2020-06-21. Score: 2
  
  The **ground floor** is the *de facto* 0th floor.
  
  Humans are born at **age 0**.
  
  **Military time** starts at **0**:00. Despite the day having 24 hours, it is not correct to write 24:00.
  
  As a side-note, Japanese TV uses **0-indexed 12-hour notation**. That means 11 AM is followed by 0 PM, not 12 PM.
  
  > **Comments:**
  > **username_1**: Counting 12,1,2,3,4,5,6,7,8,9,10,11 is what is strange. Measuring from 0 is, (what is a good word for this, oh yes) measuring.  
  > **username_1**: Nice note about Japanese TV. However the rest is already covered in other answer. If you were to write about just Japaneses TV, then I would upvote.  
  > **username_15**: In Japan, they also use the implied modulo system, where it's common to indicate hours with numbers 24 or greater. For example, a bar might be open from 20 till 26. It makes it clear that the closing time is past midnight. I love that system!  
  
  ---
  
  ### Answer by username_8 on 2018-01-15. Score: 1
  
  Light gang switches, same the way you teach binary counting. (Well, the same way that I was taught binary arithmetic back when knowing binary and hex were important.)
  
  EDIT: An *off* transistor (simulated by a light switch) is considered to be 0 (no voltage) and an *on* to be 1 (voltage passing). Since "all zeros" is a valid configuration, 0 is a valid address where Important Bits can reside. That's why many languages base arrays using 0.
  
  EDIT 2: It's also the basis of pointer arithmetic. Your array has a base address at location `A`, so that's where the first element goes. When you're referencing the elements in a loop, you add an offset `O` to get to each array element. To access the first element, the value of `O` must be `0`.
  
  [![enter image description here](https://i.sstatic.net/AIcY4.jpg)](https://i.sstatic.net/AIcY4.jpg)
  
  > **Comments:**
  > **username_8**: @username_9 sorry.  I assumed that CS Educators all know the light-switch analogy.  
  > **username_8**: @username_9 ok.  I added (a hopefully clear) explanation.  
  > **username_8**: @username_9 interesting. This was *Standard Knowledge* 35 years ago when students had to learn pointer arithmetic and take at least one class in Assembly.  
  > **username_9**: Welcome to CSEducators. Come back often.  
  > **username_10**: Using 0 and 1 for binary states is unrelated to the mathematical values of 0 and 1. We could instead use "nothing" and "something" and the entire field of logic would remain correct. This is why programming now favors `true` and `false`, instead of "a non-zero integer" and "a zero integer". It disambiguates logical evaluations from mathematical ones and prevents developers mistakenly assuming one for the other.  
  > **username_10**: Maybe as a simpler example: while the logic (of an electrical device) links 0 to 0V, the same does not apply to e.g. an abstract logical statement ("all bald men wear hats"). 0 does not bind to any particular integer value. Similarly, setting a temperature switch to 0 does not inherently mean that it's now 0° (before you argue that a temperature switch is still electrical: non-electrical switches exist too!). There are only fringe cases in which the logical 0 corresponds to a mathematical 0. The logical 0 is not defined by the mathematical 0, their fringe correlation is coincidental.  
  > **username_6**: I use the three light switches in my room to show binary counting... never occurred to me to use it for array indexes.  Bravo.  :-)  
  
  ---
  
  ### Answer by username_11 on 2018-09-14. Score: 1
  
  Subtraction paradox: In North-American football, if a runner goes from the 3 yard line to the 4 yard-line, there is a (4-3) = 1 yard gain. However, if your math teacher assigns problems 3-4 (integers), you have to do two problems. So in what engineers call an "analog" system, the Result = Stop - Start; but for integers it can be more complex.
  
  So in North American football, the yard line starts at "0" which is called the "Goal Line" typically.
  
  > **Comments:**
  > **username_10**: `if a runner goes from the 3 yard line to the 4 yard-line, there is a (4-3) = 1 yard gain. However, if your math teacher assigns problems 3-4 (integers)` The core difference here is that the former denotes the distance between points, and the latter denotes the points themselves. 2017 and 2018 are two distinct years (points), but the timespan (distance) between NYE 2017 and NYE 2018 is _one year_. This does not actually answer why 0-based indexing is used, as you're simply comparing two inherently different things. (_"from 3 to 4"_ vs _"3 and 4"_)  
  > **username_11**: One must use 0 as a base, however.  
  > **username_10**: `One must use 0 as a base`. I don't quite agree, 0-indexing is not universally superior to 1-indexing. As I mentioned in my earlier comment, it depends on what you're actually expressing (points, the distance between them, ...). There are many cases where the 0th element is a literal "nothing", thus precluding 0 from being relevant (especially when pertaining to physical objects).  
  > **username_1**: I think this is what is called a fence-post error: You have questions 3,and 4. These are the posts. It is an error in this case to count the fence panels ($4-3$). You are not measuring the distance between the posts (number of panels), you are counting the posts. See also inclusive and exclusive ranges. Some languages use inclusive lower and exclusive upper, as this choice has **less** problems than other choices.  
  > **username_11**: Note that in North American football, the "Goal Line" is the same as a zero-yard line, which is zero-based.  For the math problems, you aren't doing problem 2, but if you subtract 4-2 = 2 you get the right answer.  Thinking about 'how' this works is difficult, at least for me, and I have a Ph.D. in Electrical Engineering, focusing on computer simulations using eigen-spaces.  
  > **username_1**: The 3-4 is not a subtraction it is a range (inclusive range). It is 3→4 or {3,4}.  
  
  ---
  
  ### Answer by username_1 on 2022-05-29. Score: 1
  
  Since this question was posted, I have come to realise that a ruler is not a metaphor for this think. It is the think. Zero indexing is simply measuring the distance from the start. There are many examples of this in the other answers.
  
  We need to not see the index as on ordinal number, but as the distance from the start.
  
  > **Comments:**
  > **username_6**: I'm surprised that it never occurred to me to use a rule for this exact reason.  When I explain the concept in class, I say the address of the array is the location of the first position, and the index is the distance from that position.  
  
  ---
  
  ### Answer by username_1 on 2020-02-18. Score: 1
  
  Some train stations (but not many) have a platform 0:
  
  <https://www.youtube.com/watch?v=SPQRNmXVP8s>
  
  If you are lucky enough to live in one of these towns, then it may be a very good example.
  
  
  ---
  
  ### Answer by username_1 on 2017-05-27. Score: 1
  
  ## An example from thermodynamics: the study of heat and temperature.
  
  In thermodynamics there are 4 laws, numbered from zero. Look to see when your pupils study this in physics (science). You now have cross curricular linking, which is also good.
  
  Like Asimov's 0th law of robotics, the zeroth low of thermodynamics was added after the other 3: “The zeroth law was not initially recognized as a law, as its basis in thermodynamical equilibrium was implied in the other laws. The first, second, and third laws had been explicitly stated prior and found common acceptance in the physics community. Once the importance of the zeroth law for the definition of temperature was realized, it was impracticable to renumber the other laws, hence it was numbered the zeroth law.” — <https://en.wikipedia.org/wiki/Thermodynamics#Laws_of_thermodynamics>
  
  > * Zeroth law of thermodynamics: If two systems are in thermal equilibrium with a third system, they are in thermal equilibrium with
  >   each other. This law helps define the notion of temperature.
  > * First law of thermodynamics: When energy passes, as work, as heat, or with matter, into or out from a system, the system's internal
  >   energy changes in accord with the law of conservation of energy.
  >   Equivalently, perpetual motion machines of the first kind are
  >   impossible.
  > * Second law of thermodynamics: In a natural thermodynamic process, the sum of the entropies of the interacting thermodynamic systems
  >   increases. Equivalently, perpetual motion machines of the second kind
  >   are impossible.
  > * Third law of thermodynamics: The entropy of a system approaches a constant value as the temperature approaches absolute zero. With the
  >   exception of non-crystalline solids (glasses) the entropy of a system
  >   at absolute zero is typically close to zero, and is equal to the
  >   logarithm of the product of the quantum ground states.
  
  Extract from <https://en.wikipedia.org/wiki/Laws_of_thermodynamics>
  Text is available under the Creative Commons Attribution-ShareAlike License
  
  > **Comments:**
  > **username_12**: Similarly, [Asimov's Laws](https://en.wikipedia.org/wiki/Three_Laws_of_Robotics#Zeroth_Law_added) start from zero (although chronologically, the zeroth law was added later).  
  > **username_1**: @username_12 I added in a bit on asimov. (also I think you should make an answer on asimov)  
  
  ---
  
  ### Answer by username_1 on 2017-05-27. Score: 1
  
  This one in related to computing, but sufficiently different, as it related to the social side. You can link it in by teaching the social side before indexing.
  
  > * The freedom to run the program as you wish, for any purpose (freedom 0).
  > * The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a
  >   precondition for this.
  > * The freedom to redistribute copies so you can help your neighbour (freedom 2).
  > * The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance
  >   to benefit from your changes. Access to the source code is a
  >   precondition for this.
  
  Extract from <https://www.gnu.org/philosophy/free-sw.en.html> (Creative Commons Attribution-NoDerivatives 4.0 International License).
  
  > **Comments:**
  > **username_13**: You are missing 5 freedoms.  And the fact that a bunch of computing folks used an 0 indexed array as is kinda... expected.  OP is looking for non-computing examples, like military time and people's age (as mentioned in other answers/comments)  
  > **username_1**: @username_13 can you tell us about the 5 freedoms, I know not of this. And added answer on 24hour time.  
  > **username_13**: the freedoms you list are from the Free Software Foundation - Stallman and co.  However, the Open Source Definition lists other requirements/freedoms needed for a license to be considered Open - https://opensource.org/osd-annotated.  Remember, Stallman insists that all software be free, the Open Source Initiative wants as much as possible to be free, but not at the expense of extremism  
  > **username_1**: @username_13 the Free Software foundation also have a longer version: these 3 points are only a summary. The freedoms in the rest of the [Free Software definition](https://www.gnu.org/philosophy/free-sw.en.html), and the [Open Source definition](https://opensource.org/osd-annotated) do not add any extra freedoms. They only add clarification. The Free Software definition has 3 levels: the name "Free Software" (where free refers to freedom not price), the 4 freedoms, and the detailed explanation. The Open Source definition only has a detailed explanation, so is harder to grok.  
  
  ---
  
  ### Answer by username_14 on 2021-06-15. Score: 1
  
  I realize this post is old. However, what helped me and what may help others is that 0 is indeed on the number line. The best analogy I can give to support this cause is related to a bank account.
  
  If you are -\$5 in your account and you add \$10. Your total sum is \$5. Placing this on the number line (as seen below) -5 becomes your "0" as you count up by 10. If you start -5 as 1, your short \$1. If you skip 0 in your addition of 10, you gain \$1.
  
  -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5
  
  Simplifying things to its core has been my most successful tool in life.
  
  GL,
  
  
  ---
  
  ### Answer by username_15 on 2020-08-31. Score: 0
  
  > where can we find 0-indexing outside of CS and grounded in everyday human experience?
  
  **This is really begging the question (in the strict sense)**: you assume that there's any need for it, whereas I boldly claim that there's none whatsoever, making the question moot. In fact, I think it's really counterproductive, and is an attempt to solve a non-existent problem.
  
  As far as educational theories go, such a question is very loaded. Are you sure that such everyday human experience will have any other applicability to the problem? It's like trying to teach quantum mechanics while referring to everyday human experience: it's totally futile, since there's no everyday human experience that has any resemblance to what happens on quantum level, and if there is then the resemblance is wholly superficial.
  
  See, the heart of the problem is whether there is any way to continue deduction based on human experience. If you refer to human experience, the students will naturally try to rely on what they know from "real life" as they go on in their studies, and they'll try to rely on that *first*, before reaching into the "unfamiliar" but task-specific knowledge. In most cases, the real-life "analogues" are **baggage**, since any further deductions one makes based on them tend to be either outright invalid, or subtly broken.
  
  I personally don't think that there's much to 0-indexing. Tell the students that it's a convention no different from starting to count at 1. It's something we agreed to, and when you use some programming languages, the convention is 0-based. That's all there's to it. You can explain to the students that it's no different to agreeing to greet the teacher by saying "hello" or "good [morning|afternoon]" rather than "yo brother, what's up?". It's entirely arbitrary, it's based on a-priori decision to treat the "yo brother" form of address as informal or disrespectful or what have you.
  
  > **Comments:**
  > **username_1**: While I agree in general. It turns out that there are many good examples. And that it is not counting, it is measuring (see other answers). I think I will use your last paragraph as advice for a lot of thinks. I have sometimes just shown students that what they think is normal is not the only way (e.g. base 12/24/60 clocks, so why not binary).  
  
  ---
  
  