There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There are three kinds of actuaries: those who can count, and those who can't.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Provide a constructor that enables an object of this class to be intialized when it is declared. Provide public methods that perform the following operations:
a) Add two Complex numbers
b) Subtract two Complex bummbers
c) Print Complex numbers in the form (a, b), where a is the real part and b is the imaginary part.
S Connor wrote:I'm simply questioning what the use of the concept sqrt(-1) is
if I am unable to calculate the square root of minus one?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Matthew Brown wrote:I'd say it depends by what you mean by "exists".
Modern mathematics is built upon a set of basic assumptions, called "axioms". We assert that they are true, and build everything else on top of that. In one approach, the whole of the real numbers are generated by stating that 0 and 1 exist, with a few other rules that allow you to combine them in various ways.
So when we get to complex numbers, we can simply state "there is a quantity i such that i^2 = -1" as an additional axiom. Then we see where that takes us - and as mentioned above, it turns out that it's incredibly useful in lots of applications.
So in that sense, as far as a mathematician is concerned it exists just as much as the number 1 does. But it's true that it might not map onto the real world in quite as intuitive a way.
S Connor wrote:
The computer calculates
numbera + numberb * sqrt(-1)
However Java responds with NaN to java.Math.sqrt(-1)
What do I do?
And incidentally, what is a Complex Number? What is it used for?
Are there any examples of how i is used that can be visualized?
Ivan Jozsef Balazs wrote:
But hey, reasoning among the real numbers we can not take the square root of -1.
The point is whether the so called complex numbers can be introduced with reasonable operations in a consistent way: they can.
Consider Paul's rocket mass heater. |