From Example Problems
Jump to navigation Jump to search

The zeroth item is the initial item of a sequence, if that sequence is numbered beginning from zero rather than one. This kind of numbering is common in computer systems, and so hackers and computer scientists often use zeroth where others might use first, and so forth.

In computer programming

This habit is caused by design choices embedded in many influential programming languages, including C and Lisp. In both, sequence types (C arrays and Lisp lists and vectors) are indexed beginning with the zero subscript. Particularly in C, where arrays are closely tied to pointer arithmetic, this makes for a simpler implementation. In reality, the subscript refers to an offset from the first element of an array. Therefore, the first element would have an offset of zero. Referencing memory by an address and an offset is represented directly in hardware on virtually all computer architectures, so this design detail in C makes compilation easier and run times faster, at the cost of some human factors. In this context using "zeroth" as an ordinal is not strictly correct, but professional shorthand. Other higher-level languages have adopted array subscripts starting with one for a closer correspondence to the usual ordinal numbers.

Zero is the lowest unsigned integer value, one of the most fundamental types in programming and hardware design. In computer science, zero is thus often used as the base case for many kinds of numerical recursion. Proofs and other sorts of mathematical reasoning in computer science often begin with zero. For these reasons, in computer science it is not unusual to number from zero rather than one.

Hackers and computer scientists often like to call the first chapter of a publication "Chapter 0", especially if it is of an introductory nature. One of the classic instances was in the First Edition of K&R. In recent years this trait has also been observed among many pure mathematicians, where many constructions are defined to be numbered from 0.

Zero-based numbering tends to reduce fencepost errors, though it cannot eliminate them entirely, and may even introduce them.

Outside of computing

In mathematics, many sequences of numbers or of polynomials are indexed by nonnegative integers; among these are for example the Bernoulli numbers and the Bell numbers.

A common use of zeroth outside computing is in the name of the zeroth law of thermodynamics, a law that was formulated after the first, second and third laws.

In the realm of fiction, Isaac Asimov eventually added a 'Zeroth Law' to his famous Three Laws of Robotics.

Some buildings in the British English speaking world refer to the ground floor as floor 0, which is perhaps less confusing for speakers of American English.

While the ordinal of 0 is rarely used outside of communities closely connected to mathematics and computer science, there is one instance of it in classical music. The composer Anton Bruckner regarded his early Symphony in D minor to be unworthy of including in the canon of his works, and he wrote 'gilt nicht' on the score and a circle with a crossbar, intending it to mean "invalid". But posthumously, this work came to be known as Symphony No. 0 in D minor, even though it was actually written after Symphony No. 1 in C minor. There's an even earlier Symphony in F minor of Bruckner's that is sometimes called No. 00.

Note also the use of 00 hours in the 24-hour clock as beginning of the day.