Find the conditioning of the function

800 Views Asked by At

Evaluate the function $f(x)=x+\frac{1}{x}$. Check for what values of $x$ is $f(x)$ ill conditioned.

I had this question in a test and using the formula of the condition, $C(x)=|\frac{x f'(x)}{f(x)}|$, I came to the conclusion that the function is well conditioned for all $x$ but the right answer is that the function is well conditioned for any value other than $x=0$, I am not sure what I am doing wrong.

My solution:

$f(x)=x+\frac{1}{x}$

$f'(x)=1-\frac{1}{x^2}$

$C(x)=|\frac{x f'(x)}{f(x)}|$ where $C(x)$.

$C(x)= |\frac{x(1-\frac{1}{x^2})}{x+\frac{1}{x}}| = |\frac{x-\frac{1}{x}}{x+\frac{1}{x}}|= |\frac{x^2-1}{x^2+1}|$

$C(x)= |\frac{x^2-1}{x^2+1}|$

And $C(0)=1$ which is a small value so why is $f(x)$ ill conditioned at $x=0$?

2

There are 2 best solutions below

0
On BEST ANSWER

So the method that was used was correct but the function is well conditioned for all values of $x \neq 0$ and here is the calculation:

$f(x)=x+\frac{1}{x}$

$f'(x)=1-\frac{1}{x^2}$

$C(x)=|\frac{x f'(x)}{f(x)}|$ where $C(x)$.

$C(x)= |\frac{x(1-\frac{1}{x^2})}{x+\frac{1}{x}}| = |\frac{x-\frac{1}{x}}{x+\frac{1}{x}}|$

$C(x)= |\frac{x(1-\frac{1}{x^2})}{x(1+\frac{1}{x^2})}|$ (We cannot cancel out the zeros since $\frac{0}{0}$ is undefined)

for $x=0, C(x)$ is undefined and is well conditioned for all $x ∈R$.

1
On

The answer that you have been given is not correct. You have correctly computed the relative condition number $C$ for the function $f$ at every point where $f$ is defined and $$\forall x \not = 0 \: : \: C(x) = \frac{|x^2-1|}{x^2+1}.$$ You have that $$C(x) \leq 1$$ so $f$ is well-conditioned in the relative sense for all $x \not = 0$. The absolute condition number of a (differentiable) function $f$ is $$K(x) = |f'(x)|.$$ Your function is ill-conditioned in the absolute sense near $x = 0$ because $$f'(x) = 1 - \frac{1}{x^2} \rightarrow -\infty, \quad x \rightarrow 0, \quad x \not = 0.$$

Many textbooks focus on relative condition numbers and omit absolute condition numbers. Relative condition numbers are natural when using floating point numbers because real numbers can be represented with a small relative error. Absolute condition numbers should not be neglected because absolute errors tend to be important in real applications. Example: It does not matter if an artillery shell travels 5 km or 50 km. The only thing that matters is the absolute distance from the target to the point of impact. Is this distance less than the kill radius of the exploding shell or not?