W1031 Positive Integers

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Binary counter

Background[edit]

The process of transforming information from a source format into another, particularly for storage or transmission, is termed encoding. The opposite process, transforming the stored form to the original format, is termed decoding. Because modern-day computers are digital and store data as a series of bits, where each bit can possess only the value of one or zero, all data that we store must ultimately be represented in this format.

Positive integers may be encoded simply by relying on the binary number system. Given n bits, we can encode any number from zero through .

An Egg
It is allowed on all hands, that the primitive way of breaking eggs before we eat them, was upon the larger end: but his present Majesty's grandfather, while he was a boy, going to eat an egg, and breaking it according to the ancient practice, happened to cut one of his fingers. Whereupon the Emperor his father published an edict, commanding all his subjects, upon great penalties, to break the smaller end of their eggs. - Jonathan Swift, Gulliver's Travels