Discussion Oct 17

Discussion Oct 17 - DEPENDENCE ON SIZE CPU time = t Total...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
ERROR TOLERANCE computed "exact" some answer answer tolerance   -    
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ERRORS Absolute error = approximate value true value Relative error = absolute error / true value
Background image of page 2
TRUNCATION ERRORS 2 3 1 2! 3! x x x e x = + + + + L 2 2 1 2! x S x = + + 1 1 S x = +
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
TRUNCATION ERRORS 2 1 2! ! n n x x S x n = + + + + K 1 tol n n S S + - <
Background image of page 4
ROUNDOFF ERRORS Machine resolution ε ε = 2 –52 2×10 –16 1 + ε / 2 == 1 >> 1 + (eps/2)*1.000001 == 1 ans = 0 >> 1 + (eps/2)/1.000001 == 1 ans = 1
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
machine epsilon: distance from 1  to  the next machine represented number >> 1 + (eps/2)*1.000001 == 1 ans = 0 >> 1 + (eps/2)/1.000001 == 1 ans = 1 ε real line 1+ ε 1 1+ ε /2
Background image of page 6
>> 1 + (eps/2)*1.000001 == 1 ans = 0 >> 1 + (eps/2)/1.000001 == 1 ans = 1 machine epsilon: distance from 1  to  the next machine represented number ε real line 1+ ε 1 1+ ε /2 2 ε δ= 2
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Big-O
Background image of page 8
BIG-O NOTATION A measure of ASYMPTOTIC COMPLEXITY O(N x ) O(N 0 )=O(1) O(N 1 ) O(N 2 )   . . . Order of
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
for i = 1:N y(i) = i; end
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 14
Background image of page 15
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: DEPENDENCE ON SIZE CPU time = t Total CPU time = t * N ~ O(N ) for i = 1:N for j = 1:N z(i,j) = i; end end DEPENDENCE ON SIZE CPU time = t ~ O(N ) Total CPU time = t * N * N Time = 100 N + 2 N 2 10 20 30 40 50 60 70 80 90 100 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 4 N Time 100 N 2 N DEPENDENCE ON SIZE LOG-LOG PLOTS Time ~ a N b log(Time) ~ log(a) + b log(N) 10-2 10-1 10 10 1 10 2 10 3 10-4 10-2 10 10 2 10 4 10 6 10 8 log(N) log(Time) slope = 2 slope = 1 RULES FOR USING BIG-O Ignore constants; e.g., O(c N ) = O( N ) Use only the highest-power term; e.g., O(a N 2 + bN + c log N + d) = O( N 2 ) MATLAB TIMING FUNCTIONS &gt;&gt; tic &gt;&gt; &gt;&gt; &gt;&gt; toc &gt;&gt; cputime...
View Full Document

Page1 / 15

Discussion Oct 17 - DEPENDENCE ON SIZE CPU time = t Total...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online