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
1
vote
1 answer

Converting bases.

I would like to know a mathematical way to change between bases of any decimal number to another. I would like it to be able to be programmed. Examples of problems: $$\sqrt{2}_{10}=X_{\phi}$$ Here is what I…
1
vote
3 answers

Converting from base $2$ to base 3

Transform the binary expansion $y = 0.110110110\ldots$ into a ternary expansion. We are given that $y = 0.110110110\ldots_2$ and thus $1000_2y = 110_2+y \implies y = \frac{6}{7}$. Then we see that $\frac{6}{7}=0.857142\ldots$. How do I convert…
Puzzled417
  • 6,956
1
vote
1 answer

Quaternary numeral system: fractions

I have a question related to the expression of a real number in base 4. Consider the table here: it is clear to me how all columns of the table are obtained except the fourth one: how do they get the positional representation in quaternary base?
user299158
1
vote
2 answers

Delectable numbers in other bases

So there's a pretty useless number called the delectable number. A delectable number has nine digits, using the numbers 1-9 once in each digit. The first digit of a delectable number must be divisible by one. The first and second digits must be…
Mathime
  • 367
1
vote
2 answers

In what base does "100" equal "4 in base 10"

I was reading this answer to an amusing comic related question: https://math.stackexchange.com/a/166891/35132 and I understand that in the linked answer, the examples of how four may be expressed used base (expressed in decimal!!) is 10, 4, 3 for 4,…
Grezzo
  • 113
1
vote
1 answer

Hexadecimal numbers that does not look like decimal

Given a range of hexadecimal numbers, how do I determine the total number of them that do not look like decimal numbers? Background: I'm designing a system that auto-generates IDs that consist of four digit hexadecimal numbers but I want to exclude…
Lukman
  • 263
1
vote
1 answer

Uniqueness of binary representation

how to prove that binary number is always represent unique decimal number? (uniqueness of binary system) i.e every binary number determines unique decimal number i.e there is one-to-one relationship between binary and decimal.
1
vote
2 answers

Why does our number system have only 10 different symbols?

To be specific, I am just curious as to why does our number system have 10 different digits?Just for an example, why did it not end at 7? (it is the greatest prime number before 10, there are 7 days of week). Or similarly any other digit If we…
explorer
  • 149
1
vote
0 answers

Determine base required to accurately represent number

If you have an expression like 1/3, that can't be accurately represented in base 10. It would look like 0.3333333.... However, it can be represented in base 3 as 0.1. Is there a way to mathematically find a base that can accurately represent the…
Jonah
  • 111
1
vote
1 answer

What's it called when you treat intervals as numbers?

Often in physics you have to do maths with a finite amount of digits, e.g. $\pi = 3.14$, but this is not exact and without knowing the next digit this is only correct in the interval $[3.135,3.145]$. But does this mean that you can treat $\pi$ as an…
Frank Vel
  • 5,339
1
vote
0 answers

Digit-period in the representation of powers of $9$ on base $10$

Slightly inspired by this question: I have noticed that in the representation of powers of $9$ on base $10$, each digit repeats periodically as a function of the exponent. I assume that the same behavior can be observed in the representation of…
barak manos
  • 43,109
1
vote
2 answers

The perfect Number system

I was thinking of the number system presently in use(the decimal system) and its shortcomings. One of them is that all numbers cannot be represented accurately, for example the value of any irrational number. Although I know several attempts have…
0
votes
1 answer

How do I detect whether a rational number has a repetend when expressed with a different radix?

My original and basic question is: How do I detect whether a rational number has a repetend when expressed with a different radix? Here is my question restated as an example: Given 0.125(10), is there a way, without actually performing the …
trw
  • 1,063
0
votes
1 answer

Fractional parts in base number systems other than base-10?

A long-standing question I've asked myself over and over again is how one might express fractional parts of a whole in base number systems other than 10. Is it truly as simple as base-10's x/y system? Or is it even possible? If it is, how might a…
Bytewave
  • 103
0
votes
1 answer

Using significant figures to express stated errors?

The question reads, " express each of the following quantities using significant figures to imply the stated error". a) $2.3 \pm 0.001$ b) $1.989 \pm 0.0003$ I think the first one is 2.300 because the zero in the thousands place implies an error of…