Compensate for the inequities in marksmanship skills

Assignment Help Basic Computer Science
Reference no: EM131240168

In the land of Puzzlevania, Aaron, Bob, and Charlie had an argument over which one of them was the greatest puzzler of all time.  To end the argument once and for all, they agreed on a duel to the death.  Aaron was a poor shooter and only hit his target with a probability of 1/3.  Bob was a bit better and hit his target with a probability of ½.  Charlie was an expert marksman and never missed.  A hit means a kill and the person hit drops out of the duel. 

To compensate for the inequities in their marksmanship skills, the three decided that they would fire in turns, starting with Aaron, followed by Bob, and then by Charlie.  The cycle would repeat until there was one man standing, and that man would be the Greatest Puzzler of All Time.

An obvious and reasonable strategy is for each man to shoot at the most accurate shooter still alive, on the grounds this shooter is the deadliest and has the best chance of hitting back. 

Write a Java application to simulate the duel using this strategy.  Your application should use random numbers and the probabilities given in the problem to determine whether a shooter hits the target.  Create a class named Duelerthat contains the dueler's name and shooting accuracy, a boolean indicating whether the dueler is still alive and a method shootAtTarget(Dueler target) that sets the target to dead if the dueler hits his target (using a random number and the shooting accuracy) and does nothing otherwise. 

Once you can simulate a single duel, add a loop to your application that simulates 1,000 duels.  Count the number of times that each contestant wins and prints the probability of winning for each contestant (ie., for Aaron, your application might output "Aaron won 395/1,000 duels or 39.5%").

Reference no: EM131240168

Questions Cloud

Determine the critical pressure p* in bar : A gas expands isentropically through a converging nozzle from a large tank at 10 bar, 600K.
Federal electronic surveillance law : 1. Explain the significance of the division between "content" and "non-content" as it relates to federal electronic surveillance law. 2. Why have warrantless searches of passenger bags in the New York Subway have been allowed by the courts?
Determining the potential customers : ABC Inc. wants to build a new web site to sell their "clearance" products and they are planning to publish a proposed website site designed to obtain feedback from "potential customers".
What do think prospects are of successfully rehabilitating : Compare and contrast the characteristics of a serial murderer, spree murderer, and mass murderer. Using web resources, provide a criminal example of each one and discuss the motivations behind the crime(s). Are the motivations similar or different..
Compensate for the inequities in marksmanship skills : To compensate for the inequities in their marksmanship skills, the three decided that they would fire in turns, starting with Aaron, followed by Bob, and then by Charlie.  The cycle would repeat until there was one man standing, and that man would..
What is the probability of default in year 1 : Use DerivaGem to calculate the continuously compounded hazard rate each year. -  What is the probability of default in year 1?
Write the contrapositive for each of the following statement : If n is prime, then n is not divisible by any prime number between 1 and √n inclusive. (Assume that n is a fixed integer that is greater than 1.)
How would use differential analysis to arrive at decision : Discuss the relevant costs you would consider for this decision as well as irrelevant costs and sunk costs. How would you use differential analysis to arrive at this decision?
Calculate a hazard rate consistent with the spread : Given Table shows the five-year iTraxx index was 77 basis points on January 31, 2008. - calculate a hazard rate consistent with the spread.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Describe the structure of the world wide web

Describe the structure of the World Wide Web as interconnected hypertext documents and create and validate HTML documents - create presentations using Cascading Style Sheets and DHTML.

  Develop a class implementation for the source-sink

Develop a class implementation for the source-sink shortest-paths problem in Euclidean graphs that is based on the bidirectional search described in Exercise 21.35.

  Configuration and implementation of a cluster computing

Develop and submit a project plan including implementation steps for the configuration and implementation of a cluster computing solution to support a mission critical application

  Calculate present value of future earnings

Why do we need to calculate the present value of future earnings? A company can invest $100,000 to develop a new system, or it can put that amount into a second best alternative investment getting 10 percent.

  Payroll package

Jeff is an analyst.  The human resources department is very unhappy with their payroll package.  They want the information systems department to write them a new package as they think they have unique needs that can't be meet with a packaged solution..

  Design of a bus arbitration sequential circuit for computer

If all input variables are 0, it sets all output variables to 0. Design two such arbitration circuits, one that grants priority to the lowest indexed input that is 1 and a second that grants priority alternately to the lowest and highest indexed i..

  Can anybody give me a snippet or a little guide

Can anybody give me a snippet or a little guide?

  Degree of risk presented by construction project hazards

It is critical to the safety management process of construction projects that risk is evaluated and managed in a systematic manner. Describe a methodology for systematically assessing the degree of risk presented by construction project hazards.

  Project management and virtual teams

Reading and Research Assignment #1Topic: Project Management and Virtual Teams1. Search the Web and locate three (3) Web sites that relate to the topic. These sites could be white papers or research documents found on research databases, commercial or..

  Define a work breakdown structure

Summarize the project requirements and other assumptions (i.e., budget, human resources, workload, environmental dependencies, etc.). Define a work breakdown structure and describe the methodology behind constructing one.

  Can you help me access on this step

Open the Main Menu form in Design view. Add three buttons below the Forms label that will open the three forms in the database: Enter Customers, Enter Employees, and Enter Suppliers (in that order and to show all records).

  How can the principles of (a) classical conditioning theory

How can the principles of (a) classical conditioning theory and (b) instrumental conditioning theory be applied to the development of marketing strategies? Please write a page.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd