Message Boards Message Boards

[✓] What do these solutions from Solve mean?

GROUPS:

When I compute the following (with Mathematica 11.2):

Solve[(1 + r)^81 == 1.45, r]

I get a long list of solutions, all negative reals and complex numbers, apart from the one positive real answer I was expecting.

The solution list begins...

{{r -> -4.46763}, {r -> -4.45283}, {r -> -4.30803}, {r -> -4.11268}, {r -> -3.94294}....etc.

These values of r do not even remotely solve the equation, as far as I can see. Apart from anything else, they make the LHS negative, so it cannot be equal to the RHS, which is positive.

What is the meaning of these solutions? Is this just a bug in Mathematica? Or is there some sense in which they are solutions?

POSTED BY: Marc Widdowson
Answer
14 days ago

Yes, this is strange! To eliminate complex solutions, you coud compute:

Res = Solve[(1 + r)^81 == 1.45, r, Reals]
Map[1.45 - (1 + r)^81 /. # &, Res] // Chop

which gives r=-1 as a multiple solution and, finally, the correct one : 0.00459774. To avoid problems of precision, I tried:

Res = Solve[(1 + r)^81 == Rationalize[1.45], r, Reals]

then Mathematica give an unique solution (a pure fonction). But I don't have any explanation!

POSTED BY: Claude Mante
Answer
14 days ago

One needs much more precision for these high powers. For all the complex solutions use:

Solve[(1 + r)^81 == 1.45`40, r]

Or for the real solution:

Solve[(1 + r)^81 == 1.45`40, r, Reals]

where 40 is the number of digits which should be high here for these high powers (81!).

POSTED BY: Sander Huisman
Answer
14 days ago

Ah, I see. So those negative reals are artefacts of the lack of precision, and should be complex. Thank you.

POSTED BY: Marc Widdowson
Answer
14 days ago

Thank you very much. That provides a little more insight.

POSTED BY: Marc Widdowson
Answer
14 days ago

Some further observations

Solve[(1 + r)^n == C, r]

gives n solutions. E.g. there are 81 solutions in the example above.

Solve[(1 + r)^4 == 1, r]

gives

{{r -> -2}, {r -> -1 - i}, {r -> -1 + i}, {r -> 0}}

which are in fact all valid solutions, in this case.

POSTED BY: Marc Widdowson
Answer
14 days ago

What about 1 + r = x; x^81 == 1.45 , so

In[16]:= x = N[Power[1.45`30, (81)^-1], 30]

Out[16]= 1.00459774172863829263717967674

and then r = x - 1

POSTED BY: Hans Dolhaine
Answer
13 days ago

Group Abstract Group Abstract