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.

886 questions
281
votes
10 answers

Is '$10$' a magical number or I am missing something?

It's a hilarious witty joke that points out how every base is '$10$' in its base. Like, \begin{align} 2 &= 10\ \text{(base 2)} \\ 8 &= 10\ \text{(base 8)} \end{align} My question is if whoever invented the decimal system had chosen $9$…
Shubham
  • 2,403
  • 3
  • 13
  • 8
146
votes
6 answers

What are the numbers before and after the decimal point referred to in mathematics?

Sorry for asking such a basic question - but is there an actual term for the numbers that appear before and after the decimal point? Example: 25.18 I know the 1 is in the tenths position, the 8 is in the hundredths position. are there singular…
Calvin Froedge
  • 1,661
  • 2
  • 10
  • 9
100
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,447
  • 4
  • 18
  • 38
91
votes
5 answers

Reversing an integer's digits is multiplicative for small digits

So my 7 year old son pointed out to me something neat about the number 12: if you multiply it by itself, the result is the same as if you took 12 backwards multiplied by itself, then flipped the result backwards. In other words: $$12 × 12 =…
74
votes
13 answers

What would have been our number system if humans had more than 10 fingers? Try to solve this puzzle.

Try to solve this puzzle: The first expedition to Mars found only the ruins of a civilization. From the artifacts and pictures, the explorers deduced that the creatures who produced this civilization were four-legged beings with a tentatcle…
Vishnu Vivek
  • 1,383
  • 5
  • 16
  • 24
67
votes
19 answers

What are the names of numbers in the binary system?

The names we use are very much related to the radix we use $0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9$ zero - one - two - three - four - five - six - seven - eight -nine We repeat the names $21$ twenty one, $22$ twenty two .. and so on. This is not…
user37421
  • 917
  • 1
  • 6
  • 13
63
votes
8 answers

Why do the French count so strangely?

Today I've heard a talk about division rules. The lecturer stated that base 12 has a lot of division rules and was therefore commonly used in trade. English and German name their numbers like they count (with 11 and 12 as exception), but not…
Martin Thoma
  • 9,359
  • 14
  • 56
  • 123
60
votes
10 answers

Can a number have infinitely many digits before the decimal point?

I asked my teacher if a number can have infinitely many digits before the decimal point. He said that this isn't possible, even though there are numbers with infinitely many digits after the decimal point. I asked why and he said that if you keep…
Landing
  • 611
  • 1
  • 5
  • 5
58
votes
8 answers

Is there a third dimension of numbers?

Is there a third dimension of numbers like real numbers, imaginary numbers, [blank] numbers?
awesomeguy
  • 699
  • 1
  • 6
  • 5
56
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)…
Samrat Patil
  • 663
  • 1
  • 5
  • 6
51
votes
1 answer

Pattern "inside" prime numbers

Update $(2020)$ I've observed a possible characterization and a possible parametrization of the pattern, and I've additionally rewritten the entire post with more details and better definitions. It remains to prove the observed possible…
Vepir
  • 11,937
  • 4
  • 27
  • 78
50
votes
12 answers

What could be better than base 10?

Most people use base 10; it's obviously the common notation in the modern world. However, if we could change what became the common notation, would there be a better choice? I'm aware that it very well may be that there is no intrinsically superior…
Cisplatin
  • 4,297
  • 7
  • 31
  • 54
50
votes
5 answers

What is the smallest positive multiple of 450 whose digits are all zeroes and ones?

What is the smallest positive multiple of 450 whose digits are all zeroes and ones? I tried guess and check but the numbers grew big fast. Thanks in advance!
45
votes
1 answer

Can a number be a palindrome in 4 consecutive number bases?

Edit $(2020)$: Update is included at the end of the post. $4$ consecutive bases? Are there numbers that are a palindrome in $4$ consecutive number bases? I'm not counting a one digit palindrome as a palindrome. (Discarding trivial…
39
votes
0 answers

Pattern in Pascal's triangle

Updated question This "reverse" pattern can be plotted as a function of a triangle, read by rows: $$ T(n,k) = (\delta)^k F\binom{n}{k} \left\lfloor f(t(k)) \right\rfloor ,\delta\in\{1,-1\}.$$ The $T(n,k)$ here represents an "(alternating)…
Vepir
  • 11,937
  • 4
  • 27
  • 78
1
2 3
59 60