# Number of correct digits of an expression.

1. Abstract of the question

Let's say there are two irrational numbers: $a$ and $b$. Now, when $a$ is raised to the $b$ power ($a^b$), then let's say the result of this is $x$.

So, we have: $$x=a^b$$

Now, let's say $\alpha$ is equal to the approximation of $a$ to certain number of digits after the decimal, $n$, and $\beta$ is the approximation of $b$ to a certain number of digits after the decimal, $m$.

Now, if we let: $$y=\alpha^{\beta}$$

$y$ will be the approximation to the result $x$, but with only first $c$ digits that are correct.

2. Problem

Given the approximation ($\alpha$) to $n$ correct digits after the decimal of the irrational number $a$, AND given the approximation ($\beta$) to $m$ correct digits after the decimal of the irrational number $b$ -> I want to find the value of $c$, the number of digits after the decimal of the approximated result $y$ that matches those from the real result $x$.

I know that this may sound very scary, but that is why below I give a clearer example that demonstrates my problem.

3. More friendly and comprehensive example of the problem

For an example, I will use the numbers $\sqrt{3}$ and $\sqrt{2}$. First, I will compute the real result given by wolframalpha:

$$\sqrt{3}^{\sqrt{2}}=2.1745814281919670041110624...$$

Now, I am going to use a poorer approximation of $\sqrt{3}$, which will be approximated to 5 digits after the decimal, and I am going to use a four-digit-after-the-decimal approximation of $\sqrt{2}$. So we have:

$$1.73205\approx\sqrt{3}$$ $$1.4142\approx\sqrt{2}$$

Then, I compute the result of $1.73205^{1.4142}$ instead of $\sqrt{3}^{\sqrt{2}}$, to get:

$$1.73205^{1.4142}=2.1745637940043789740808552...$$

Remember, that I approximated the square root of 3 to 5 digits after the decimal? In my formal problem statement, it is $n$. And I also approximated the square root of 2 to 4 digits, making $m$ from my formal problem equal to 4.

Now, when we compare the result of the real expression, and of the expression with approximations to $n$ digits of irrational number $a$ and $m$ digits of irrational number $b$, we see that only first four places after the decimal of the approximated result are matching those from the real result.

The number of matching digits in the result, that uses approximations, to the real result, is defined as $c$ in my formal problem statement, and THAT is what I want to find out, not only for this example, but for every irrational number $a$ and $b$, its approximations $\alpha$ and $\beta$, and number of digits approximated, $n$ and $m$ respectively, after the decimal, of the original numbers.

In this example case, $c=4$.

4. (Don't know what to call this section)

Now, when I showed an example, the sections 1 and 2 of this questions will hopefully look clearer and better to understand. I appreciate any help and I thank in advance.

There is a good rough answer and no really good answer. The classic approach to error analysis gives a good rough answer. You have an expression for $x$ and we assume the errors in $a$ and $b$ are small enough that we can ignore higher terms than linear. Then we get $\Delta x \approx \frac {\partial x}{\partial a}\Delta a + \frac {\partial x}{\partial b} \Delta b=b\frac xa\Delta a+x \log a \Delta b$. You can evaluate the right side and if it is less than $0.005,$ say, you can declare you have two decimals correct.
The reason there is no really good answer is the correct answer might be $2.999\ 999\ 999\ 123\ldots$. Then if you have a possible error of $0.000\ 000\ 1$ that can change many higher decimals. This is an artifact of the decimal number system and what people think you mean when you say you have two decimals correct. If you translate "two correct decimals" to "the quoted value is within $0.0051$ of the correct value (even if there are two different numbers with two decimals in that range and I might have the wrong one) and the second derivative isn't so large as to invalidate what we have done, you are OK. I would suggest that "two correct decimals" is an imprecise phrase and this is a reasonable way of making it precise.