randomized algorithms n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Randomized “Algorithms” PowerPoint Presentation
Download Presentation
Randomized “Algorithms”

Loading in 2 Seconds...

play fullscreen
1 / 6

Randomized “Algorithms” - PowerPoint PPT Presentation


  • 120 Views
  • Uploaded on

Randomized “Algorithms”. Monte Carlo and Las Vegas Technuques. Randomized. Monte Carlo Might give an incorrect answer (approximate) but always give an answer Las Vegas Might never give an answer (quit or run forever) Each uses some randomized technique to attack a problem.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

Randomized “Algorithms”


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
    Presentation Transcript
    1. Randomized “Algorithms” Monte Carlo and Las Vegas Technuques

    2. Randomized • Monte Carlo • Might give an incorrect answer (approximate) but always give an answer • Las Vegas • Might never give an answer (quit or run forever) • Each uses some randomized technique to attack a problem

    3. Monte Carlo Integration float area(function f, float a, float b, float fMax, int n) { float x, y; int hits=0, trial; for (trial=0; trial<n; trial++) { x = a+random(b-a); y = random(fMax); if (f(x)>=y) hits++; } return((b-a)*fMax*hits/n); }

    4. Las Vegas and Ethernet bool success = false; while (!success) { status = message.send(); success = status == TRANSMITTED; if (!success) wait a bit; }

    5. Las Vegas Dining Philosophers • Discussed in class Monte Carlo Illumination • Discussed in class

    6. References • Some material from the textbook: Data Structures and Algorithm Analysis in Java (Second Edition) by Mark Allen Weiss • Additional images: www.wikipedia.com