12.07.2015 Views

Linear Algebra

Linear Algebra

Linear Algebra

SHOW MORE
SHOW LESS

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

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

Topic: Speed of Calculating Determinants 329A(ROW, COL). Now the program does a row pivot.−PIVINV · ρ ROW + ρ i(This code fragment is for illustration only and is incomplete. Still, analysis ofa finished version that includes all of the tests and subcases is messier but givesessentially the same conclusion.)PIVINV=1.0/A(ROW,COL)DO 10 I=ROW+1, NDO 20 J=I, NA(I,J)=A(I,J)-PIVINV*A(ROW,J)20 CONTINUE10 CONTINUEThe outermost loop (not shown) runs through N − 1 rows. For each row,the nested I and J loops shown perform arithmetic on the entries in A that arebelow and to the right of the pivot entry. Assume that the pivot is found inthe expected place, that is, that COL = ROW . Then there are (N − ROW ) 2entries below and to the right of the pivot. On average, ROW will be N/2.Thus, we estimate that the arithmetic will be performed about (N/2) 2 times,that is, will run in a time proportional to the square of the number of equations.Taking into account the outer loop that is not shown, we get the estimate thatthe running time of the algorithm is proportional to the cube of the number ofequations.Finding the fastest algorithm to compute the determinant is a topic of currentresearch. Algorithms are known that run in time between the second andthird power.Speed estimates like these help us to understand how quickly or slowly analgorithm will run. Algorithms that run in time proportional to the size ofthe data set are fast, algorithms that run in time proportional to the square ofthe size of the data set are less fast, but typically quite usable, and algorithmsthat run in time proportional to the cube of the size of the data set are stillreasonable in speed for not-too-big input data. However, algorithms that run intime (greater than or equal to) the factorial of the size of the data set are notpractical for input of any appreciable size.There are other methods besides the two discussed here that are also usedfor computation of determinants. Those lie outside of our scope. Nonetheless,this contrast of the two methods for computing determinants makes the pointthat although in principle they give the same answer, in practice the idea is toselect the one that is fast.ExercisesMost of these problems presume access to a computer.1 Computer systems generate random numbers (of course, these are only pseudorandom,in that they are generated by an algorithm, but they pass a number ofreasonable statistical tests for randomness).(a) Fill a 5×5 array with random numbers (say, in the range [0..1)). See if it issingular. Repeat that experiment a few times. Are singular matrices frequentor rare (in this sense)?

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

Saved successfully!

Ooh no, something went wrong!