# Random numbers and real solutions to (x)squared+1=0

Discussion in 'Math' started by djsfantasi, Mar 31, 2012.

1. ### djsfantasi Thread Starter AAC Fanatic!

Apr 11, 2010
3,541
1,286
$x^{2}+1=0$

We are taught early that there is no solution to this equation. What was meant is that the is no real solution. x=(0+i) is the complex solution.

I once used that "fact" to program a random number generator, based on using Newton's Method to solve this equation and truncating the results as a seed back into the system.

Worked pretty well, but if you were to ask me today "why", I couldn't answer you. Perhaps as a challenge, some people here could examine the algorithm?

2. ### 1chance Member

Nov 26, 2011
42
185
If you were to solve this problem using the quadratic formula you would have a negative discriminant, thus generating a complex number. Using the square root principle also yields a negative radicand and therefore an "i" in your answer. I'm sure Steveb can give you a more in-depth answer. I like to keep it simple! (At least as simple as math can be P

3. ### djsfantasi Thread Starter AAC Fanatic!

Apr 11, 2010
3,541
1,286
I understand that the actual solution is a complex number. I am talking about applying a non-convergent case of Newton's method of numerical analysis in the real solution space.

I was just curious why this produced a statistically random number set.

4. ### 1chance Member

Nov 26, 2011
42
185
sorry, I misread your question and need to ponder this a bit.

5. ### steveb Senior Member

Jul 3, 2008
2,433
469
Personally, I would need to study that case more thoroughly to be sure. One thing we can say is that the process is deterministic and so at best you can have a psuedo-random sequence, but I assume that is what you mean.

The idea that you might get somewhat randomized sequences of numbers does not surprise me, and there are similar iterative maps that are used to generate random numbers, and also to study chaos theory.

My feeling is that your example is not completely random because the starting seed gives a hint about some information about the next number. For example a seed near zero is sure to give a very large number for the next value. Also, very large seeds are going to gradually lead to smaller numbers since numbers far away from the origin look alot like x^2=0 and it will initially try to converge in to the answer x=0. However, as it gets closer, it will get driven away. So, there is likely to be a cyclic nature and a random nature to the sequence of numbers.

It is certainly an interesting example to look at. Perhaps I'll study it a little more if I get some free time over the next couple of weeks. One question is whether any particular starting seeds lead to different characteristic behaviors. For example, might you get a perfectly cyclic pattern with any particular starting seeds. Or, might all starting seed eventually converge in to a pattern. I just don't know how to answer these questions without a thorough study and by applying formal chaos theory tests.

EDIT: On rereading your post, I see that you mentioned truncating the results to get randomization. So, yes I agree this is a useful technique to get better psuedo-random numbers. Many of the same concerns will still be relevant, and there are special tests that can be used to determine the quality of the method.

I'm not sure how to answer your basic question of why it works well, if it does work well. The act of truncating can make things look random all by itself. If you apply truncation to an interative algorithm that also seems to have random characteristics, then so much the better. A major pitfall of such algorithms is if particular seeds lead to repeating patterns much sooner than expected from the resolution limits of your number representations. If your method somehow avoids this pitfall, it's hard to give an explanation for why.

Last edited: Apr 2, 2012