Number domains and positional bases
By UK A Level Computer Science · independent study · myAudience

Original generated teaching illustration, built-in imagegen,2026-10-04; mathematical model,not documentary photograph. · Original generated artwork; operator provenance/rights and independent scientific acceptance pending.
Number domains and positional bases
Representation begins with a distinction between a mathematical value, a symbol sequence and a machine format. The decimal string 173, the binary sequence 10101101 and hexadecimal AD can denote the same integer under different positional conventions. A stored pattern does not announce its interpretation: 1010 might denote ten in unsigned binary, a character code fragment or flags. State the base, field width and meaning before calculating. This is the same contract discipline used in the earlier packing lesson, now applied to the representation itself.
Natural numbers include zero in this specification and are suitable for counts. Integers extend them with negative values. Rational numbers are ratios of integers with nonzero denominator, so every integer is rational; irrational numbers such as the square root of two are real but not rational. Real numbers contain both rational and irrational values. A finite computer format stores only finitely many distinct patterns, so it cannot exactly represent every member of any infinite number set. Being a real measurement does not imply that its mathematical value is exactly available in a machine register.
Ordinal use describes position in an ordering rather than the size of a quantity. A fifth object is not necessarily five units large, and ordinal labels alone do not justify averaging measured amounts. Conversely, a count of five components is a cardinal quantity. In a program both may use integers, but permissible operations depend on the application's interpretation. A negative index might be meaningful in a language while invalid as a count of objects. Representation and validation must therefore preserve semantic distinctions that a shared storage type does not enforce.
In base b, position k to the left of the units contributes digit times b to the power k. Binary permits only digits zero and one. The eight positions for 10101101 have weights 128,64,32,16,8,4,2,1; the ones contribute 128+32+8+4+1=173. Leading zeroes can preserve a declared width without changing a nonnegative value. A trailing zero instead multiplies an unsigned integer by the base, unless a fixed-width boundary discards a significant bit. Arithmetic claims about shifting need that width qualification.
To encode an integer, successive division by the base records remainders from least significant to most significant. For 173 in base two, each remainder identifies one bit and each quotient is the remaining higher-order value. Reading the remainders in reverse order gives 10101101. A proof follows from repeatedly applying n=bq+r with 0≤r<b. The process terminates for nonnegative n because a positive quotient decreases when b≥2. Zero needs an explicit representation rather than an empty numeral silently treated as no data.
Hexadecimal groups four binary positions because sixteen equals two to the fourth power. Split 10101101 into 1010 and 1101: these have values ten and thirteen, written A and D. Thus AD equals 10×16+13=173. Hex is compact notation, not compression of an already stored eight-bit value: writing two hex digits can still describe the same eight bits. A shorter printed label does not prove a smaller storage requirement, and a leading nibble may need zero padding to preserve a byte-oriented display.
A terminating expansion is a property of a value relative to a base and width, not a test of rationality. Decimal 0.1 equals one tenth and is rational. Its reduced denominator contains a factor of five, so multiplying by any power of two cannot yield an integer; no finite binary fraction is exactly one tenth. By contrast, three eighths terminates in binary as 0.011. A finite approximation of an irrational value is still a rational stored value. Explain which value was intended and which approximation was actually stored before assessing error.
Reading the diagram: The selected plate's eight cells provide a place-value proof: the teal one-bits align with weights 128,32,8,4,1, while the A/D brackets group the high and low nibbles. Its separate number-set panel places naturals inside integers inside rationals inside reals, with irrational examples elsewhere within reals. The picture is a mathematical classification and encoding demonstration, not a claim about a processor's physical wiring. In an unfamiliar problem, justify conversions with weights or quotient-remainder steps and diagnose interpretation errors before debating implementation speed.
Worked example: Encode decimal 173 in eight-bit unsigned binary and hexadecimal; explain whether decimal 0.1 being nonterminating in binary makes it irrational.
Choose powers 128,32,8,4,1; their sum 173 gives 10101101.
Group 1010 and 1101; these give A and D, so ADhex=10×16+13=173.
0.1=1/10 is rational. Any finite binary fraction has a denominator dividing a power of two, while reduced 1/10 retains a factor five.
Answer: 173 decimal=10101101 binary=ADhex. One tenth is rational despite its nonterminating binary expansion.
Check your understanding: A colleague interprets 00010110 as decimal 10110, says a fourth-place runner has measured speed 4, and classifies 0.1 as irrational. Repair each claim. Then convert 6 Bhex both ways and explain what extra contract is needed before treating that byte as a signed value.
Answer: Under an unsigned binary contract 00010110=16+4+2=22, not decimal 10110. Fourth place is an ordinal position and supplies no measured speed or units. One tenth is a rational ratio. 6 Bhex=6×16+11=107 and 01101011 binary; nibble conversion is 0110/1011 and the place-value sum 64+32+8+2+1=107 verifies it. Signed interpretation requires a specified scheme and width; eight-bit two’s complement happens to give 107 because the sign bit is zero, but that agreement does not make all high-bit patterns unsigned and signed equivalents.
Why: Require explicit representations and semantic units, two consistent conversion methods and a denominator argument rather than identifying irrationality from display length. A valid alternative derivation is acceptable; no official mark scheme or grade promise.