Is it possible to determine if a number is infinitely long? For example, is the $ \sqrt 5 $ infinitely long?
i.e As a decimal number, will it continue forever or will it come to an end?
Is there a way that we can calculate this?
Is it possible to determine if a number is infinitely long? For example, is the $ \sqrt 5 $ infinitely long?
i.e As a decimal number, will it continue forever or will it come to an end?
Is there a way that we can calculate this?
On
Hint: the decimal expansion of a number $\,x\,$ is finite iff all decimals can be "shifted" to the left of the decimal point by multiplying with $\,10\,$ enough many times. In other words, if there exists a non-negative integer $\,n\,$ such that $\,10^n \cdot x\,$ is an integer.
On
It's not hard to show that a number has a terminating decimal expansion if and only if it has the form $a\over 10^n$ where $a$ is an integer and $n$ is a natural number. Showing that ${a\over 10^n}$ has a terminating decimal expansion is easy: just take the usual decimal representation of $a$, and move the decimal point $n$ spaces to the left. If you do this, you clearly get a terminating decimal, and it's a good exercise to show that in fact this is a representation of $a\over 10^n$.
In the other direction, suppose I have a finite decimal expansion of a number $x=0.d_1d_2...d_n$. (OK, I'm assuming here that the number is between $0$ and $1$, but this is just for notational simplicity.) Now we have $$10^nx=d_1d_2...d_n,$$ and so $$x={d_1d_2...d_n\over 10^n}.$$ (Note that when I write "$d_1d_2...d_n$" I don't mean the product of the $d_i$s, I mean the number formed out of those digits.) For example, $0.345={345\over 10^3}$.
Things get more interesting when we ask about not finite, but more generally eventually repeating decimal expansions (like $0.33333...$). It turns out that a number has an eventually repeating decimal expansion if and only if it's rational; this is a good exercise. Note that this has the neat consequence that if a number has a repeating expansion in one base, then it has a repeating expansion in every base; by contrast, the number ${1\over 3}$ has an infinite decimal expansion but a finite base-$3$ expansion (namely, $0.1$).
Yes, there is a way. Numbers whose decimal expansions terminate are always rational numbers. In fact, we can say something better than that: Rational numbers, i.e., fractions, are the numbers whose decimal expansions either terminate, or fall into repetition. For example, $\frac3{25}=0.12$, while $\frac7{11}=0.636363...$, where the pattern "$63$" repeats endlessly.
Irrational numbers, in contrast, are the ones with decimal expansions that don't terminate or become periodic. How to tell that a number is irrational, which $\sqrt5$ is for example, is an interesting question. There are some numbers, that nobody knows whether they're rational or irrational.
However, a number like $\sqrt5$ is a known type. Square roots of integers, if they're not integers themselves, are always irrational. Therefore, the decimal expansion of $\sqrt5$ goes on forever, without terminating or falling into a periodic pattern.