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
111
votes
6 answers

What would base $1$ be?

Base $10$ uses these digits: $\{0,1,2,3,4,5,6,7,8,9\};\;$ base $2$ uses: $\{0,1\};\;$ but what would base $1$ be? Let's say we define Base $1$ to use: $\{0\}$. Because $10_2$ is equal to $010_2$, would all numbers be equal? The way I have thought…
Justin
  • 2,565
  • 5
  • 20
  • 39
57
votes
8 answers

Why have we chosen our number system to be decimal (base 10)?

After learning about the binary number system (only 2 symbols, i.e. 0 and 1), I just thought why did we adopt the decimal number system (10 symbols) after all? I mean if you go to see, it's rather inefficient when compared to the octal (8 symbols)…
33
votes
3 answers

Changing a number between arbitrary bases

As an intro, I know how the numbers are represented, how to do it if I can calculate powers of the base, and then move between base $m$ to base $10$ to base $n$. I feel that this is overly "clunky" though, and would like to do it in such a way that…
soandos
  • 1,756
27
votes
6 answers

How do you say $10$ when it's in binary?

I always assumed $10$ was pronounced "ten" regardless of whether it's binary, decimal, or another system, just like how 5 is "five" in all systems that the digit exists exists. But someone told me that, if it's not base-10, it should be pronounced…
22
votes
6 answers

What would base 0 be? How would/could it work?

If I was trying to take the number $123$ in base $10$ and try and convert it into base zero I would do something like this: $123 = 100 + 20 + 3$ $10^{\log_0(100)} + 10^{\log_0(20)} + 10^{\log_0(3)}$ But $\log_0(x)$ is the same thing as…
21
votes
11 answers

Why do we generally round 5's up instead of down?

As an example, the number 15, rounded to the nearest tens, rounds to 20. I understand it's arbitrary, as 10 and 20 are equidistant from 15, I just wonder if there's any discernible logic behind the convention of rounding up. Even something like, 'It…
ivan
  • 3,237
15
votes
1 answer

two-dimensional number system without negative numbers

Is there any existing literature for the number system that looks like this? Like the complex number system, this system exists on a plane. But instead of $i$ and $-1$, it has two numbers-- called $q$ and $d$ here-- that form two new families of…
14
votes
3 answers

Which base of numerical system have $\frac 15 = 0.33333\ldots$?

Which base of numerical system have $\frac{1}{5} = 0.33333\ldots$? I need assistance in solving this one.
Abby
  • 141
10
votes
2 answers

Why do we use decimal system?

Why do we use decimal system? Some people give the answer that we have 10 fingers and it is therefore convenient for us to use decimal system, but I am not satisfy with this as I think this is too rough. Are there more reasonable or scientific…
JSCB
  • 13,456
  • 15
  • 59
  • 123
10
votes
3 answers

How to find the radix (base) of a number given its representation in another radix (base)?

What's the method to find the base of any given number? E.g. find $r$ such that $(121)_r=(144)_8$, where $r$ and $8$ are the bases. So how do I find the value of $r$?
9
votes
8 answers

Why do we add a zero to dividend during long division?

Suppose we want to divide 3 by 2. By Long Division we first write 1 as the first digit as the quotient, then we subtract 2 from 3, then we add a zero to the remainder 1, and then add a decimal point after the quotient 1, then write 5 after the…
Ram Keswani
  • 1,003
8
votes
1 answer

What do the little numbers in math mean, and how do they work?

Like these: $^{1 \ 2 \ 3 \ 4 \ 5 \ 6 \ 7 \ 8 \ 9}$. They are little numbers aside the regular sized unicode characters, and you see them pop up in equations as follows: $$1 + 1^9 \times 33^9(3) = {?}.$$ What do the tiny/little digits mean, and how…
8
votes
5 answers

what base number system is the hebrew language?

In the hebrew bible, there number system is based off of hebrew letters. There is a single digit used going all the way up to 10, then it uses two digits... Untill it gets to 20, which is a single digit again. The actual hebrew numbers go in…
Ephraim
  • 1,878
7
votes
1 answer

Is there a number system with matrix base?

I don't remember where but I have read that a number system can have a matrix as base. Is it true? What is the intuition behind having such a system?
7
votes
3 answers

What is the relationship between base and number of digits?

For instance, the number $1000$ takes $4$ digits in base $10$, $10$ digits in base $2$, $3$ digits in base $20$, and $2$ digits in base $1000$. What is the mathematical relationship between number of digits and base?
1
2 3
15 16