12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sec. 16.3 Numerical <strong>Algorithm</strong>s 553ii−11−11−i−iFigure 16.6 Examples of the 4th <strong>and</strong> 8th roots of unity.advantage of symmetries, such as the one we see for evaluating x <strong>and</strong> −x. But weneed <strong>to</strong> find even more symmetries between points if we want <strong>to</strong> do more than cutthe work in half. We have <strong>to</strong> find symmetries between, say, pairs of values. Andthen further symmetries between pairs of pairs, <strong>and</strong> so on.Recall that a complex number z has a real component <strong>and</strong> an imaginary component.We can consider the position of z on a number line if we use the y dimensionfor the imaginary component. Now, we will define a primitive nth root of unity if1. z n = 1 <strong>and</strong>2. z k ≠ 1 for 0 < k < n.z 0 , z 1 , ..., z n−1 are the nth roots of unity. For example, when n = 4, then z = i orz = −i. In general, we have the identities e iπ = −1, <strong>and</strong> z j = e 2πij/n = −1 2j/n .The significance is that we can find as many points on a unit circle as we wouldneed (see Figure 16.6). But these points are special in that they will allow us <strong>to</strong> dojust the right computation necessary <strong>to</strong> get the needed symmetries <strong>to</strong> speed up theoverall process of evaluating many points at once.The next step is <strong>to</strong> define how the computation is done. Define an n × n matrixA z with row i <strong>and</strong> column j asA z = (z ij ).The idea is that there is a row for each root (row i for z i ) while the columns correspond<strong>to</strong> the power of the exponent of the x value in the polynomial. For example,when n = 4 we have z = i. Thus, the A z array appears as follows.A z =1 1 1 11 i −1 −i1 −1 1 −11 −i −1 iLet a = [a 0 , a 1 , ..., a n−1 ] T be a vec<strong>to</strong>r that s<strong>to</strong>res the coefficients for the polynomialbeing evaluated. We can then do the calculations <strong>to</strong> evaluate the polynomial

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!