Questions tagged [number-systems]

Representations of numeric values in decimal, binary, octal, hexadecimal, and other bases; one's-complement and two's-complement signed numbers; scientific notation; floating-point numbers in digital computers; history of number systems; nonstandard number systems; algorithms for arithmetic within specific number systems or for conversions between number systems.

Number systems provide systematic ways to write numeric values such as the (base-ten) numbers $289$ or $2.125$. Some questions with this tag involve algorithms for converting base-ten numbers to or from another number system; conversions between other number systems; algorithms to perform arithmetic (addition, subtraction, multiplication, etc.) within a specific number system without converting the operands to base ten; symbols for writing numbers in systems other than base ten; ancient number systems (such as Roman numerals) and the historical development of number systems; and specialized or unusual number systems.

A base-$b$ number system represents an integer as a sequence of digits, each of which is an integer such that $0 \leq d < b$. Ordinary decimal numbers are written in base ten; other well-known bases include binary (base $2$), octal (base $8$), and hexadecimal (base sixteen). Optionally, the base or radix, $b$, may be appended as a subscript. The value of such a numeric representation is

$${\left(d_m d_{m-1} \cdots d_2 d_1 d_0\right)}_b = d_m b^m + d_{m-1} b^{m-1} + \cdots + d_2 b^2 + d_1 b^1 + d_0 b^0.$$

For example, $21_{16} = 33_{10} = 41_8 = 100001_2$, representing the same value as hexadecimal, decimal, octal, and binary numbers, respectively. The factors $b^0$, $b^1$, $b^2$, and so forth are the place values of the digits. A base-$b$ number with a fractional part is written by appending a decimal point and digits with place values $b^{-1}$, $b^{-2}$, $b^{-3}$, and so forth; for example, $$101.011_2 = 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0 + 0\cdot2^{-1} + 1\cdot2^{-2} + 1\cdot2^{-3} = 4 + 1 + \frac14 + \frac18 = 5.375_{10}.$$

In a mixed-radix number system, such as the factorial number system, the ratio between the places value of two digits depends on their distances from the decimal point. A number system can have a negative radix, for example the negabinary number system, which has the radix $-2$.

Digital computing has raised interest in various other number systems. In an $n$-digit $b$'s-complement base-$b$ representation, the integer $-x$ is represented by $b^n - x$, whereas in a $(b-1)$'s complement representation, $-x$ is represented by $(b^n - 1) - x$. Computers often use two's-complement (or sometimes one's-complement) binary numbers.

Very large or small numbers can be written in scientific notation, for example $1.234 \times 10^9$. Floating-point numbers in digital computers, typically using the IEEE 754 standard, serve a similar purpose.

More esoteric number systems of interest in computer science include:

  • Balanced base-$b$ number systems, which use both positive and negative digit values. The balanced ternary (base $3$) system with digit values $\{-1,0,1\}$ is an example of this kind of number system.
  • Redundant base-$b$ systems, which allow more than $n$ values of each digit. There may be many ways to represent a given number in such a number system.
  • Residue number systems, in which each digit position is assigned a fixed modulus and the digit in that position is the remainder when the number's value is divided by that modulus.

Other possible numbering systems include the Fibonacci base system and systems using a non-integer radix such as the $\phi$ number system.

949 questions
3
votes
1 answer

Is multiplication in mixed radix numeral systems complicated?

The wikipedia article on mixed radix numeral systems says Mixed-radix numbers of the same base can be manipulated using a generalization of manual arithmetic algorithms. This sounds like "naive long multiplication" in mixed radix systems won't be…
3
votes
0 answers

Roman Numerals. What are valid Subtractives? e.g. Is VL valid for 45?

"Standard" syntax for Roman Numerals seem to always show 45 = XLV. I wrote a little program to convert roman numerals to integers, so I started wondering what is valid in subtractive notation and what isn't. For example, 495 is much shorter as VD…
BitBlitz
  • 143
3
votes
2 answers

Roman to Decimal Number conversion

I am trying to convert CIIXMXCVCII to decimal number. However, I am not getting it completely if it's a valid roman number representation or not. I tried this online tool: http://www.tools4noobs.com/online_tools/roman_decimal/ which says it's…
3
votes
1 answer

Is 000 (multiple zeros) a valid representation of zero?

I noticed recently that both PHP and Qalculate! (a calculator) accept numbers like 00 or 00000 as meaning 0 (zero). I was curious if these are mathematically valid representations of zero or whether these programs are just sanitzing the input. The…
SpliFF
  • 133
  • 3
3
votes
1 answer

Rules governing overline usage in Roman numerals

In the modern usage of Roman numerals, how would a number such as 1,001,000 be converted to Roman numerals? Would it be $\overline{\mathrm M}$${\mathrm M}$ or $\overline{\mathrm {MI}}$? Is there a set of rules governing when to use ${\mathrm M}$…
Joel Christophel
  • 557
  • 2
  • 7
  • 20
3
votes
3 answers

what is the purpose of number system conversions e.g decimal to base 5?

I'm learning Number system conversion youtube. so far I know there are decimal, binary, octal, and Hex numbers. There is a purpose behind converting decimal to binary But what is the purpose of converting decimal to base 5 number?
3
votes
1 answer

Uniqueness of the infinite expansion in base $b$

If $b>1$ is an integer, is well know that the numbers $x\in (0,1]$, can be written as $$x = \sum_{k=1}^{\infty} \frac{a_k}{b^k}$$ for some integers $a_k \in \{0,1,\ldots ,b-1\} $. When $x=\frac{1}{b^n}$, for some $n\in \mathbb{N}$, there is two…
leo
  • 10,433
3
votes
3 answers

Why do we can't replace binary numbers with decimal like we do in hexadecimal and octal?

I am trying hard to understand this but can visualize it correctly. Will any one make me visualize it that if we have a byte(8 bits) why can't we convert it directly as we do in hex and octal?
Bilal
  • 31
3
votes
3 answers

Is it possible to write any rational number using base pi

Is it possible to write any rational number (say 1 or 2 or .15) using a number system that was base pi instead of a number system that used a rational number as its base?
3
votes
1 answer

Fractional number bases

I have a student doing any investigation in to fractional number bases. For example 10 in base (3/2) would be 2101. We can do it manually but to generate enough data to investigate any patterns and other fractional number bases would anybody know…
Cliff
  • 143
3
votes
1 answer

Does there exist a number system where the speed of multiplication is size independent?

There exist number systems where addition can be done without using carries which makes the addition of two small numbers as fast as the addition of two large numbers when using a computer. The redundant binary signed digit system has this…
gilianzz
  • 369
3
votes
0 answers

Having $\pi$ fingers and count

The number $\pi$ has infinite decimals whom appear to be randomly distributed. If we had $\pi$ fingers, and would therefore use $\pi$ as base instead of ten, could I then count integers on my fingers?
2
votes
1 answer

Numbering in base other than 10

On what basis the numbering less than 20, the fraction 17/6 (base 10) does not generate a regular tithe?
Paulo Argolo
  • 4,210
2
votes
2 answers

Converting Between Non-Decimal Bases?

How can a number in an arbitrary base be converted to another random base - for example from 9.2E9B03 base 17 to base 5? I would prefer a generalized procedure avoiding an intermediary base 10 conversion - which I already know how to do.
Gordon
  • 21
2
votes
1 answer

Proving Arithmetic

In mathematics if one is to prove a property of arithmetic, such as the associativity of addition, without going into greater detail about the numbers themselves, I feel like I'm missing something important. Should one first prove what a number is,…
1 2
3
15 16