# Condition number, well conditioned or ill condition

Determine the condition number for taking the square root of a number $$x$$. Is this problem well-conditioned or ill-conditioned

I know that conditioning measures how sensitive a problem is to a small change in the initial data. The condition number $$k$$ of a problem $$P : R^m \rightarrow R^n$$ is the smallest number such

$$\frac{\left| \hat{x_i}-x_i\right|}{\left|x_i\right|} \leq \epsilon$$for all $$1 \leq i \leq m$$ then

$$\frac{||P(\hat x)-P(x)||}{||P(x)||} \le k \epsilon + 0(\epsilon)$$ where little $$0$$ is Landau.

I am not quite sure how to use this for my example.

If we let $$\hat {x} = \sqrt x (1+\epsilon)$$ then

$$\frac{||P(\hat x)-P(x)||}{||P(x)||} = \frac{||\sqrt x (1+\epsilon)-\sqrt x||}{||\sqrt x||}= \frac{||\sqrt x + \sqrt x\epsilon - \sqrt x||}{\sqrt x} = \sqrt x \frac{||\epsilon||}{\sqrt x} = || \epsilon ||$$

I found an answer with no detail saying that $$k = \frac{1}{2}$$ and that it was well-conditioned but I am not sure how my above calculation would how that.

Looking for some help with this, thanks!

• Hint: Consider $k$ as a ratio of the (relative) error in the function value $\sqrt{x}$ to the (relative) error in the argument $x$ and simplify, i.e. $$k \approx \frac{\frac{\sqrt{\hat x} - \sqrt{x}}{\sqrt{x}}}{ \frac{\hat x - x}{x}}$$ – hardmath Sep 24 '18 at 0:16
• @Hardmath wouldn't that simplify to $$\frac{x \sqrt {\hat x} - x \sqrt x}{\hat x \sqrt x - x\sqrt x}$$? how would that simplify to 1/2, could you show me this simplification? – user123 Sep 24 '18 at 0:21
• okay pulling that gives $$\frac{x}{\sqrt x} \frac{\sqrt {\hat x}-\sqrt x}{\hat x - x}$$ then what? – user123 Sep 24 '18 at 0:29
• @hardmath what would come next – user123 Sep 24 '18 at 0:43
• @hardmath okay so since $\hat x$ is close to $x$ we have $\frac{x}{\sqrt x \sqrt {\hat x}+x} = \frac{x}{x+x} = \frac{x}{2x} \approx. \frac{1}{2}$ – user123 Sep 24 '18 at 2:16