Computer_Science
 Home | People | Curriculum | Projects | Resources | Media

dartboard image
High Performance Scientific Computing cs392
Lab 1 Fall 2007

Dart Strategy Study: Sequential Version

In this lab you are to design and implement a program to generate a set of random dart throws at a virtual dartboard and discover which strategy works better: throwing at the "20" or throwing at the "1" (and thus increasing the chances of hitting either "20" or "18" -- see dartboard graphic).

You will need to make some assumption in this simulation study, just be clear in your comments in the code. We can make some assumptions about the accuracy of the thrower such that higher accuracy translates into less chance of error (and more likley to hit near the intended spot on the dartboard). We can begin with simple assumptions and improve the model parameters and approach as we proceed. The goal is to determine if there exists a threshold in player accuracy/proficiency where one strategy beats the other.

Please proceed in the following sequence:

  1. Outline a model of how random numbers can be used to model targetted throws at a specific spot on the standard dartboard (see graphic). Some things to consider:
    • Cartesian or polar coordinates (it is a dartboard)
    • Representation data structures
    • Distribution type for the throwing error
  2. Implement a sequential program (C, C++, Python or FORTRAN if you dare) to simulate dart throws, ideally with a moveable target spot and a variable numbr of throws; be sure to include a mechanism to record execution time, ideally saved in a file of text (that can be imported into a spreadsheet)
  3. Conduct many sequential experiments recording the timing resultsrecording the timings for various values of N (input size) -- please note that N is very large (so you may need long int)
  4. Plot your results (Times vs N)
  5. Prepare a report and a brief presentation of your results, including some reflection on any unusual or unexpected results in the results (timing, statistics, or coding complecity)

You will be asked to demonstrate your work for the instructor and answer any questions. You will also draft a preliminary report of your findings that you will complete in Lab 2. You are welcome to collaborate, to do library research, even ask other science/math professors for help (at their convenience).

Haverford College Page maintained by John Dougherty.
Computer Science Department, Haverford College.