Jump to content
BrainDen.com - Brain Teasers
  • 0

A simple complex problem


Yoruichi-san
 Share

Question

I couldn't resist responding to happy chance...;P Not my own creation, but you don't need to know too about complex numbers to solve it, just the basic definition of i =sqrt(-1) should suffice.

So the straightforward method of computing the product (a+bi)(c+di) = (ac-bd)+i(bc+ad) requires four (real) multiplications and two additions. However, most computers require a significantly more time to compute multiplication than addition. Find an algorithm for computing (a+bi)(c+di) with only three multiplications.

Edited by rookie1ja
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

I can't do spoilers on iPad, but this answer is a bit of hoax, I judge.

So showing it doesn't disclose the real (npi) solution.

Normalizing the two numbers WRT their real parts reduces the multiplications to two.

Of course, it ALSO requires two divisions, hardly creating a more efficient algorithm.

a+bi x c+di = ac-bd +i (ad+bc) - four multiplications.

Normalize 

a+bi = a(1+Bi). 

c+di = c(1+Di)

Product = ac[1-BD +i(B+D)] - two multiplications.

Link to comment
Share on other sites

  • 0

To stretch the point, if you convert to polar coordinates (a mere 4 squares, 2 additions, 2 square roots and 2 arc tangents, it'll take only 1 multiplication and 1 addition.

Well, to recover a Cartesian result, add on 1 sine, 1 cosines and 2 more multiplications. Still only 3 multiplications instead of 4.

Link to comment
Share on other sites

  • 0

OK I think it can be done, but it will cost you

Let r1 = ac, r2 = bd. Two multiplications so far.

(a+bi)(c+di) = (r1-r2) + {(a+b)(c+d)-(r1+r2}i Third multiplication.

Yep, I think that is the solution, its the one I got, too. Like I said, I didn't create this problem, and I don't know that much about computers. But I think the point was that additions take, like, nearly an order of magnitude less than multiplication.

As for polar coordinates...this problem was actually suppose to be simple ;P.

Link to comment
Share on other sites

  • 0

I can't do spoilers on iPad, but this answer is a bit of hoax, I judge.

So showing it doesn't disclose the real (npi) solution.

Normalizing the two numbers WRT their real parts reduces the multiplications to two.

Of course, it ALSO requires two divisions, hardly creating a more efficient algorithm.

a+bi x c+di = ac-bd +i (ad+bc) - four multiplications.

Normalize

a+bi = a(1+Bi).

c+di = c(1+Di)

Product = ac[1-BD +i(B+D)] - two multiplications.

What does WRT mean?

Also, how does a+bi = a(1+bi)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...