Solution to Puzzle No. 5 - complex multiplication
For the question see "Puzzle No. 5 - complex multiplication" in issue 5.
We can calculate p and q using just three multiplications:-
the three products used being
In fact this is not the only way to calculate p and q using three multiplications. There are many variations on the above idea, but all of them are essentially the same. If you struggled to get the solution to this issue's puzzle, why not have a go at experimenting to see how many ways you can calculate p and q using just three multiplications.
The time taken to multiply n by another number m of similar size is roughly proportional to (log n)2, whereas the time taken to add n to m is about log n. Hence the above procedure can save a lot of computational time in any program that has to perform many complex multiplications. A good example would be the programs used to generate fractal images.