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
37
votes
9 answers

Proof that every repeating decimal is rational

Wikipedia claims that every repeating decimal represents a rational number. According to the following definition, how can we prove that fact? Definition: A number is rational if it can be written as $\frac{p}{q}$, where $p$ and $q$ are integers…
jamaicanworm
  • 3,908
  • 10
  • 32
  • 50
36
votes
10 answers

How to write zero in the unary numeral system

In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$ I was only able to find a related question but none with an answer so…
Josi
  • 407
  • 1
  • 4
  • 7
33
votes
7 answers

Why do some divisibility rules work only in base 10?

Aside from the zero rule (a number ending with zero means it is divisible by the base number and its factors), why is it that other rules cannot apply in different bases? In particular for 3 one can just sum all digits and see if it is divisible.…
32
votes
2 answers

What mathematical structure models arithmetic with physical units?

In physics we deal with quantities which have a magnitude and a unit type, such as 4m, 9.8 m/s², and so forth. We might represent these as elements of $\Bbb R\times \Bbb Q^n$ (where there are $n$ different fundamental units), with $(4,…
MJD
  • 62,206
  • 36
  • 276
  • 489
31
votes
9 answers

Is $1+1 = 2$ true in any base?

So this may be one of the stupidest questions ever, but is the identity $$1 + 1 = 2$$ valid in any base? It seems so, since it's like, for a given base $b$ $$1 = 000\ldots 01 = (0\cdot b^n) + \ldots (1\cdot b^0) = b^0 = 1$$ Which means $1 + 1 = 2$…
Laplacian
  • 23,646
  • 9
  • 34
  • 53
29
votes
1 answer

Structures emerging in a discrete plot of palindromic numbers

Plotting Palindromic Numbers & Number Systems If we decide to plot Palindromic Numbers against Number Bases, and go far enough into the number line, things start to look interesting. In fact, the deeper we go into the number line, we get similar…
29
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,666
  • 4
  • 21
  • 29
26
votes
5 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…
AlbeyAmakiir
  • 371
  • 3
  • 8
26
votes
3 answers

What is the most efficient numerical base system?

I remember reading somewhere that base $e$ is the most "efficient" base system because of its ratio of possible characters to number length. For example, binary is "inefficient" because each represented number is very long when represented with only…
user14069
  • 1,185
  • 1
  • 15
  • 24
24
votes
8 answers

Fractions in binary?

How would you write a fraction in binary numbers; for example, $1/4$, which is $.25$? I know how to write binary of whole numbers such as 6, being $110$, but how would one write fractions?
Fernando Martinez
  • 6,458
  • 15
  • 69
  • 99
24
votes
7 answers

Does set $\mathbb{R}^+$ include zero?

I've been trying to find answer to this question for some time but in every document I've found so far it's taken for granted that reader know what $\mathbf ℝ^+$ is.
AndrejaKo
  • 979
  • 2
  • 7
  • 19
21
votes
3 answers

Is there a simple proof that $e^2$ is irrational using a positional numeral system?

My favorite proof that $e$ is irrational goes something like this. Observe that we can write any real number $r$ as $$ a \,+\, \frac{b_2}{2} \,+\, \frac{b_3}{3!} \,+\, \frac{b_4}{4!} \,+\, \frac{b_5}{5!} \,+\, \cdots $$ where $a\in\mathbb{Z}$ and…
Jim Belk
  • 46,369
  • 2
  • 122
  • 188
21
votes
5 answers

Can every real number be represented by a (possibly infinite) decimal?

Does every real number have a representation within our decimal system? The reason I ask is because, from beginning a mathematics undergraduate degree a lot of 'mathematical facts' I had previously assumed have been consistently modified, or…
WakeUpDonnie
  • 497
  • 1
  • 3
  • 8
21
votes
2 answers

What's the difference between hyperreal and surreal numbers?

The Wikipedia article on surreal numbers states that hyperreal numbers are a subfield of the surreals. If I understand correctly, both fields contain: real numbers a hierarchy of infinitesimal numbers like $\epsilon, \epsilon^2, \epsilon^3,…
21
votes
3 answers

Prove that the number 14641 is the fourth power of an integer in any base greater than 6?

Prove that the number $14641$ is the fourth power of an integer in any base greater than $6$? I understand how to work it out, because I think you do $$14641\ (\text{base }a > 6) = a^4+4a^3+6a^2+4a+1= (a+1)^4$$ But I can't understand why they had…
CCC
  • 911
  • 3
  • 13
  • 28
1
2
3
59 60