Skip to main content

Exercises 1.5 Exercises

1.
Write in decimal form the following numbers: \(\frac{34}{10}, \frac{1}{10}, \frac{1}{9}, \frac{1}{8}.\)
2.
Explain why the number \(0.999...\) is equal to 1.
3.
Let \(x=0.777...\text{.}\) Set \(y=10x\) and write down the value of \(y-x\text{.}\) Conclude that \(x=\frac{7}{9}\text{.}\) Use the same idea to show that \(0.767676...=\frac{76}{99}\) and \(0.1767676...=\frac{176-1}{990}\text{.}\)
4.
Write in fraction form (i.e. as ratio of two integers) the following numbers: 32.01, 0.15, 0.0123, 0.111..., 0.333..., 0.123123123....
5.
Describe which fractions write with a finite number of digits in the decimal system and explain why they do.
6.
Evaluate in \(D_3\) the quantities
\begin{equation*} 7\times(8/7-1)-1 \end{equation*}
and
\begin{equation*} 10\times(11/10-1)-1\text{.} \end{equation*}
7.
Evaluate in \(D_3\) the quantity
\begin{equation*} 1.00 + 0.002 + 0.002 + 0.002 \end{equation*}
first summing from left to right and then from right to left.

This calculation shows that one should always sum numbers after sorting them from the smallest to the largest.
8.
Evaluate in \(D_3\) the value of the mathematically (but not numerically!) equivalent expressions
\begin{equation*} 1-\sqrt{1-a} \end{equation*}
and
\begin{equation*} \frac{a}{1+\sqrt{1-a}} \end{equation*}
for \(a=1.00\times10^{-3}\text{.}\)

Which one gives the most accurate result? Why?
9.
Let \(a=1.2\times10^{300}\) and \(b=3\times10^{300}\text{.}\) What happens if one tries to evaluate in double precision the quantity \(\sqrt{a^2+b^2}\text{?}\) How can one re-write \(\sqrt{a^2+b^2}\) so that the calculation is doable in double precision with these values for \(a\) and \(b\text{?}\)
10.
Consider the system \(B_3\), where the base is 2 and only three digits are kept. Find the expressions of \(1/3\) in \(B_3\) and evaluate the quantity \(3\times1/3\text{.}\)
11.
Find the expressions of \(1/3\) in single and double precision and explain why, although \(1/3\) has infinitely many digits in base 2, in both cases one finds that \(3\times1/3\) is identically equal to 1.
12.
Evaluate in double precision the quantities \(1+0.6\) and \(1+0.2+0.2+0.2\) and explain why they do not give the same result.