OneStopGate.Com
OnestopGate   OnestopGate
   Sunday, November 17, 2024 Login  
OnestopGate
Home | Overview | Syllabus | Tutorials | FAQs | Downloads | Recommended Websites | Advertise | Payments | Contact Us | Forum
OneStopGate

GATE Resources
Gate Articles
Gate Books
Gate Colleges 
Gate Downloads 
Gate Faqs
Gate Jobs
Gate News 
Gate Sample Papers
Training Institutes

GATE Overview
Overview
GATE Eligibility
Structure Of GATE
GATE Coaching Centers
Colleges Providing M.Tech/M.E.
GATE Score
GATE Results
PG with Scholarships
Article On GATE
Admission Process For M.Tech/ MCP-PhD
GATE Topper 2012-13
GATE Forum




GATE 2025 Exclusive
Organizing Institute
Important Dates
How to Apply
Discipline Codes
GATE 2025 Exam Structure

GATE 2025 Syllabus
Aerospace Engg..
Agricultural Engg..
Architecture and Planning
Chemical Engg..
Chemistry
Civil Engg..
Computer Science / IT
Electronics & Communication Engg..
Electrical Engg..
Engineering Sciences
Geology and Geophysics
Instrumentation Engineering
Life Sciences
Mathematics
Mechanical Engg..
Metallurgical Engg..
Mining Engg..
Physics
Production & Industrial Engg..
Pharmaceutical Sciences
Textile Engineering and Fibre Science

GATE Study Material
Aerospace Engg..
Agricultural Engg..
Chemical Engg..
Chemistry
Civil Engg..
Computer Science / IT
Electronics & Communication Engg..
Electrical Engg..
Engineering Sciences
Instrumentation Engg..
Life Sciences
Mathematics
Mechanical Engg..
Physics
Pharmaceutical Sciences
Textile Engineering  and Fibre Science

GATE Preparation
GATE Pattern
GATE Tips N Tricks
Compare Evaluation
Sample Papers 
Gate Downloads 
Experts View

CEED 2013
CEED Exams
Eligibility
Application Forms
Important Dates
Contact Address
Examination Centres
CEED Sample Papers

Discuss GATE
GATE Forum
Exam Cities
Contact Details
Bank Details

Miscellaneous
Advertisment
Contact Us


Home » GATE Study Material » Mathematics » Numerical Analysis » Numerical Integration » Monte Carlo Pi

Monte Carlo Pi

Looking for GATE Preparation Material? Join & Get here now!

** Gate 2013 Question Papers.. ** CEED 2013 Results.. ** Gate 2013 Question Papers With Solutions.. ** GATE 2013 CUT-OFFs.. ** GATE 2013 Results.. **

Monte Carlo Pi

Background

    We start the familiar example of finding the area of a circle.  Figure 1 below shows a circle with radius [Graphics:Images/MonteCarloPiMod_gr_1.gif] inscribed within a square. The area of the circle is  [Graphics:Images/MonteCarloPiMod_gr_2.gif],  and the area of the square is [Graphics:Images/MonteCarloPiMod_gr_3.gif].  The ratio of the area of the circle to the area of the square is   
    
        [Graphics:Images/MonteCarloPiMod_gr_4.gif]  

        

[Graphics:Images/MonteCarloPiMod_gr_5.gif]

  
        Figure 1.  [Graphics:Images/MonteCarloPiMod_gr_6.gif]  


    If we could compute ratio, then we could multiple it by four to obtain the value [Graphics:Images/MonteCarloPiMod_gr_7.gif].  One particularly simple way to do this is to pick lattice points in the square and count how many of them lie inside the circle, see Figure 2.  Suppose for example that the points [Graphics:Images/MonteCarloPiMod_gr_8.gif] are selected, then there are 812 points inside the circle and 212 points outside the circle and the percentage of points inside the circle is  [Graphics:Images/MonteCarloPiMod_gr_9.gif].  Then the area of the circle is approximated with the following calculation  
    
    [Graphics:Images/MonteCarloPiMod_gr_10.gif]  

        

[Graphics:Images/MonteCarloPiMod_gr_11.gif]

    
        Figure 2.  [Graphics:Images/MonteCarloPiMod_gr_12.gif]  

 

Monte Carlo Method for [Graphics:Images/MonteCarloPiMod_gr_13.gif]

    Monte Carlo methods can be thought of as statistical simulation methods that utilize a sequences of random numbers to perform the simulation.  The name "Monte Carlo'' was coined by Nicholas Constantine Metropolis (1915-1999) and inspired by Stanslaw Ulam (1909-1986), because of the similarity of statistical simulation to games of chance, and because Monte Carlo is a center for gambling and games of chance.  In a typical process one compute the number of points in a set A that lies inside box R.  The ratio of the number of points that fall inside A to the total number of points tried is equal to the ratio of the two areas (or volume in 3 dimensions).  The accuracy of the ratio [Graphics:Images/MonteCarloPiMod_gr_14.gif] depends on the number of points used, with more points leading to a more accurate value.

    A simple Monte Carlo simulation to approximate the value of  [Graphics:Images/MonteCarloPiMod_gr_15.gif]  could involve randomly selecting points  [Graphics:Images/MonteCarloPiMod_gr_16.gif]  in the unit square and determining the ratio  [Graphics:Images/MonteCarloPiMod_gr_17.gif],  where [Graphics:Images/MonteCarloPiMod_gr_18.gif] is number of points that satisfy  [Graphics:Images/MonteCarloPiMod_gr_19.gif].  In a typical simulation of sample size [Graphics:Images/MonteCarloPiMod_gr_20.gif] there were [Graphics:Images/MonteCarloPiMod_gr_21.gif] points satisfying  [Graphics:Images/MonteCarloPiMod_gr_22.gif],  shown in Figure 3.  Using this data, we obtain
    
    [Graphics:Images/MonteCarloPiMod_gr_23.gif]  and   [Graphics:Images/MonteCarloPiMod_gr_24.gif]  
    
        

[Graphics:Images/MonteCarloPiMod_gr_25.gif]

  
        Figure 3.  [Graphics:Images/MonteCarloPiMod_gr_26.gif]   

    Every time a Monte Carlo simulation is made using the same sample size [Graphics:Images/MonteCarloPiMod_gr_27.gif] it will come up with a slightly different value.  The values converge very slowly of the order  [Graphics:Images/MonteCarloPiMod_gr_28.gif].  This property is a consequence of the Central Limit Theorem.

Remark.  Another interesting simulation for approximating  [Graphics:Images/MonteCarloPiMod_gr_29.gif]  is known as Buffon's Needle problem.  The reader can find many references to it in books, articles and on the internet.  

Mathematica Subroutine (Monte Carlo Pi).

[Graphics:Images/MonteCarloPiMod_gr_30.gif]

Area Under a Curve

    Monte Carlo simulation can be used to approximate the area  [Graphics:Images/MonteCarloPiMod_gr_49.gif] under a curve  [Graphics:Images/MonteCarloPiMod_gr_50.gif]  for  [Graphics:Images/MonteCarloPiMod_gr_51.gif].  First, we must determine the rectangular box [Graphics:Images/MonteCarloPiMod_gr_52.gif] containing [Graphics:Images/MonteCarloPiMod_gr_53.gif] as follows.
    
        [Graphics:Images/MonteCarloPiMod_gr_54.gif]  where  [Graphics:Images/MonteCarloPiMod_gr_55.gif].  
        
Second, randomly pick points  [Graphics:Images/MonteCarloPiMod_gr_56.gif]  in [Graphics:Images/MonteCarloPiMod_gr_57.gif], where [Graphics:Images/MonteCarloPiMod_gr_58.gif] are chosen from independent uniformly distributed random variables over  [Graphics:Images/MonteCarloPiMod_gr_59.gif], respectively.   Third, calculate the ratio [Graphics:Images/MonteCarloPiMod_gr_60.gif] as follows:

         [Graphics:Images/MonteCarloPiMod_gr_61.gif], where [Graphics:Images/MonteCarloPiMod_gr_62.gif] is number of points that lie in  [Graphics:Images/MonteCarloPiMod_gr_63.gif].  

The area is computed using the approximation,  [Graphics:Images/MonteCarloPiMod_gr_64.gif],  and we can use the formula  

        [Graphics:Images/MonteCarloPiMod_gr_65.gif].     
    
An "estimate" for the accuracy of the above computation is
    
        [Graphics:Images/MonteCarloPiMod_gr_66.gif].  

 

Algorithm Monte Carlo Simulation.  Given that   [Graphics:Images/MonteCarloPiMod_gr_67.gif]  for  [Graphics:Images/MonteCarloPiMod_gr_68.gif].  Use Monte Carlo simulation to approximate the integral  

        [Graphics:Images/MonteCarloPiMod_gr_69.gif].  

Mathematica Subroutine (Monte Carlo Simulation).

[Graphics:Images/MonteCarloPiMod_gr_70.gif]

Caveat.  The above subroutine is for pedagogical purposes.  The standard implementation of Monte Carlo integration is done by selecting points only in the domain of the function, for a one dimensional integral we would use random numbers to select points [Graphics:Images/MonteCarloPiMod_gr_71.gif] in the interval [Graphics:Images/MonteCarloPiMod_gr_72.gif] and then use the approximation

        [Graphics:Images/MonteCarloPiMod_gr_73.gif].

This idea will be developed in the module Monte Carlo integration.




Discussion Center

Discuss/
Query

Papers/
Syllabus

Feedback/
Suggestion

Yahoo
Groups

Sirfdosti
Groups

Contact
Us

MEMBERS LOGIN
  
Email ID:
Password:

  Forgot Password?
 New User? Register!

INTERVIEW EBOOK
Get 9,000+ Interview Questions & Answers in an eBook. Interview Question & Answer Guide
  • 9,000+ Interview Questions
  • All Questions Answered
  • 5 FREE Bonuses
  • Free Upgrades
GATE RESOURCES
 
  • Gate Books
  • Training Institutes
  • Gate FAQs
  • GATE BOOKS
     
  • Mechanical Engineeering Books
  • Robotics Automations Engineering Books
  • Civil Engineering Books
  • Chemical Engineering Books
  • Environmental Engineering Books
  • Electrical Engineering Books
  • Electronics Engineering Books
  • Information Technology Books
  • Software Engineering Books
  • GATE Preparation Books
  • Exciting Offers



    GATE Exam, Gate 2009, Gate Papers, Gate Preparation & Related Pages


    GATE Overview | GATE Eligibility | Structure Of GATE | GATE Training Institutes | Colleges Providing M.Tech/M.E. | GATE Score | GATE Results | PG with Scholarships | Article On GATE | GATE Forum | GATE 2009 Exclusive | GATE 2009 Syllabus | GATE Organizing Institute | Important Dates for GATE Exam | How to Apply for GATE | Discipline / Branch Codes | GATE Syllabus for Aerospace Engineering | GATE Syllabus for Agricultural Engineering | GATE Syllabus for Architecture and Planning | GATE Syllabus for Chemical Engineering | GATE Syllabus for Chemistry | GATE Syllabus for Civil Engineering | GATE Syllabus for Computer Science / IT | GATE Syllabus for Electronics and Communication Engineering | GATE Syllabus for Engineering Sciences | GATE Syllabus for Geology and Geophysics | GATE Syllabus for Instrumentation Engineering | GATE Syllabus for Life Sciences | GATE Syllabus for Mathematics | GATE Syllabus for Mechanical Engineering | GATE Syllabus for Metallurgical Engineering | GATE Syllabus for Mining Engineering | GATE Syllabus for Physics | GATE Syllabus for Production and Industrial Engineering | GATE Syllabus for Pharmaceutical Sciences | GATE Syllabus for Textile Engineering and Fibre Science | GATE Preparation | GATE Pattern | GATE Tips & Tricks | GATE Compare Evaluation | GATE Sample Papers | GATE Downloads | Experts View on GATE | CEED 2009 | CEED 2009 Exam | Eligibility for CEED Exam | Application forms of CEED Exam | Important Dates of CEED Exam | Contact Address for CEED Exam | CEED Examination Centres | CEED Sample Papers | Discuss GATE | GATE Forum of OneStopGATE.com | GATE Exam Cities | Contact Details for GATE | Bank Details for GATE | GATE Miscellaneous Info | GATE FAQs | Advertisement on GATE | Contact Us on OneStopGATE |
    Copyright © 2024. One Stop Gate.com. All rights reserved Testimonials |Link To Us |Sitemap |Privacy Policy | Terms and Conditions|About Us
    Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | India Job Forum | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Free Classifieds | Jobs Assist | Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Web Hosting | Quick Site Kit | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Software Testing Interview Questions | Free Online Exams | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World
    C Interview Questions | C++ Interview Questions | Send Free SMS | Placement Papers | SMS Jokes | Cool Forwards | Romantic Shayari