lecture04 - 4 Randomness and Simulation L Olson September 8...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
# 4 Randomness and Simulation L. Olson September 8, 2015 Department of Computer Science University of Illinois at Urbana-Champaign 1
Image of page 1

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

View Full Document Right Arrow Icon
randomness reproducibility designing an experiment 2
Image of page 2
the scientific method 3
Image of page 3

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

View Full Document Right Arrow Icon
accuracy How do I classify my method? Goal: determine how the error | f ( x ) - p n ( x ) | behaves relative to n (and f ). Goal: determine how the cost of computing p n ( x ) behave relative to n (and f ). for f ( x ) = 1 1 - x we have p n = n X k =0 x k = 1 + x + x 2 + . . . so e n = | f ( x ) - p n ( x ) | Is e n 1 / n r ? Is e n 1 / n ? Is e n 1 / n !? 4 approx. algorithm 两边同乘x, 两式相减
Image of page 4
timing mymethod() takes x seconds How long does it take in general? If the data input is of size n , how long should it take? n 2 ? n !? 10 n ? 5
Image of page 5

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

View Full Document Right Arrow Icon
big-o How to measure the impact of n on algorithmic cost? O ( · ) Let g ( n ) be a function of n . Then define O ( g ( n )) = { f ( n ) | ∃ c , n 0 > 0 : 0 f ( n ) cg ( n ) , n n 0 } That is, f ( n ) ∈ O ( g ( n )) if there is a constant c such that 0 f ( n ) cg ( n ) is satisfied. assume non-negative functions (otherwise add | · | ) to the definitions f ( n ) ∈ O ( g ( n )) represents an asymptotic upper bound on f ( n ) up to a constant example: f ( n ) = 3 n + 2 log n + 8 n + 85 n 2 ∈ O ( n 2 ) 6 in O(n^3)
Image of page 6
big-o (omicron) O ( · ) Let g ( n ) be a function of n . Then define O ( g ( n )) = { f ( n ) | ∃ c , n 0 > 0 : 0 f ( n ) cg ( n ) , n n 0 } That is, f ( n ) ∈ O ( g ( n )) if there is a constant c such that 0 f ( n ) cg ( n ) is satisfied. 7
Image of page 7

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

View Full Document Right Arrow Icon
big-omega Ω( · ) Let g ( n ) be a function of n . Then define Ω( g ( n )) = { f ( n ) | ∃ c , n 0 > 0 : 0 cg ( n ) f ( n ) , n n 0 } That is, f ( n ) Ω( g ( n )) if there is a constant c such that 0 cg ( n ) f ( n ) is satisfied.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern