Lecture 15B
Serving PhysicsSim
DataMonitorDesign
Run Data Server
Run Data Client
Data S
erver Code
Physics Sim Code
Data Client Code

Lectures

1A: Introduction
1B: Java Intro
2A: BuildingBlocks
2B: Objects
3A: More Objects
3B: Exceptions
       & Threads
4A: Waves
4B: Nuclear &
       Particle
5A: AWT
5B: More AWT
      & Graphics
6A:Detectors &
      Simulation
6B: LHC/Atlas &
     RandomSims    
7A: Swing
7B: Java2D
8A: Java Apps
8B: Dialogs &
    MoreClasses
9A: Java I/O
9B: Utilities,
        Unicode
10A: More
    Threading
10B: File
    Handling
11A: Array,Print,
    Images
11B: SimplePhysics
    Simulation
12A: Tips &
    Techniques
12B: More Tips &
    Techniques
13A: Satellite
    
Simulations
13B: Intro to Java
    Networking
14A: Java Servers
14B: HTTP Server
15A: ServerClient
15B: ServerClient
   Expt.Simulation
16A: Course
          Review
16B: ExerciseTest
        Discussion

    Contacts
    Description
    Exercises
    Index
    Outline
    Q&A
    Resources
    StudentInfoForm
    Student Pages
    What's New

 

Home : Lectures : Lecture 15B Title Page
Lecture 15B: Server/Client Physics Simulation

Buffon's Needle

by Michael J. Hurben

The Java applet should have appeared here. Since it has not, this means (a) your browser is not capable of viewing Java applets (In which case you should consider downloading a new browser from Netscape or Microsoft) or (b) you need to check your browser settings to enable Java.

"Buffon's Needle refers to a simple Monte Carlo method for the estimation of the value of pi, 3.14159265... The idea is very simple. Suppose you have a tabletop with a number of parallel lines drawn on it, which are equally spaced (say the spacing is 1 inch, for example). Suppose you also have a pin or needle, which is also an inch long. If you drop the needle on the table, you will find that one of two things happens: (1) The needle crosses or touches one of the lines, or (2) the needle crosses no lines. The idea now is to keep dropping this needle over and over on the table, and to record the statistics. Namely, we want to keep track of both the total number of times that the needle is randomly dropped on the table (call this N), and the number of times that it crosses a line (call this C). If you keep dropping the needle, eventually you will find that the number 2N/C approaches the value of pi! " continue at M. Hurbens Buffon's Needle page.

Source Code

 

 

Home Lectures Resources Index Contacts Students


Physics Simulations with JavaTM
KTH, Kurskod: 5A1418
Curator: Clark S. Lindsey