Obvious and reasonable strategy

Assignment Help Basic Computer Science
Reference no: EM131235101

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 Dueler that 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: EM131235101

Questions Cloud

What is keiretsu : What is keiretsu? How does this form of industrial structure affect companies that compete with Japan or that are trying to enter the Japanese market?
How do you graph a market beta : How do you graph a "market beta"? - What should be on the x-axis, and what should be on the y-axis? - What is an individual data point?
What are the organization mission and vision : Write a 1,400- to 1,750-word report on your findings in which you answer the following questions: What are the organization's mission and vision? What are the organization's key values? What strategic planning model does your chosen organization curr..
How does the organizational structure affect communication : Departmentalization is the logical grouping of business units to operate efficiently. An organization can split its departments in many ways. Consider a company that develops software. How might it change if the software company developed software fo..
Obvious and reasonable strategy : 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.
Why the timer will operate at the same pulse rate : The timer is connected to 12 volts DC. If the voltage is reduced to 8 volts DC, the 555 will continue to operate at the same pulse rate. Explain why the timer will operate at the same pulse rate when the voltage is reduced.
How a crossing system differ from an electronic exchange : How does a crossing system differ from an electronic exchange? - What is a specialist? What is a market maker? When trading, what advantage do the two have over you?
Determining the troubleshooting basics : The desktop administration at a remote satellite office called you to let you know that after the installation of Windows, he noticed that the FLIP 3D is not working. Of course you prepare a list of questions to ask and have possible recommendatio..
How do shares disappear from the stock exchange : What are the institutional mechanisms by which funds disappear from the public financial markets back into the pockets of investors?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What do you recommend to management

You estimate that at least six weeks are needed to find and fix the problems. In addition, even more time is required to find and fix 15 additional, less severe bugs just uncovered by the QA team. What do you recommend to management?

  Deviations of the returns for goodman

Calculate the standard deviations of the returns for Goodman, Landry, and the Market Index. (Hint: Use the sample standard deviation formula given in the chapter, which corresponds to the STDEV function in Excel.)

  Example of the circle class

(The Rectangle class) Following the example of the Circle class in Section 9.2, design a class named Rectangle to represent a rectangle. The class contains:

  Segment of code that reads a string

Write a segment of code that reads a String from the keyboard andthen outputs each letter in the String twice. For example, if theinput String is "Welcome!" the code should output "WWeellccoommee!!" to the screen.

  What problem might s2 now face

Suppose resource manager cell RM1 departs from S2 to H1 reporting a high available rate, but right afterward an RM cell arrives at S2 from H2 reporting a low available rate for the second half of the circuit. What problem might S2 now face?

  Interoperability and health information exchange

Clearly describe interoperability and health information exchange within the public, clinical, ancillary software vendors, HIM, admitting,finance and administrators and the ICD-10 implementation.

  Base of the number system for this civilization

Many of the artifacts contain inscriptions that appear to be mathematical, and the first to be translated (with limited away-team gear) comes out as the equation

  Arrays for computer science

Initialize the array with the appropriate number of values.

  Classmates about improving efficiency

Can a different kitchen layout save your business? In this week's scenario, Chris and Erica are faced with efficiency challenges at the café. Talk to your classmates about improving efficiency in this week's discussion!

  Session variables to maintain the information

Clearly, this website requires some sort of back end to persist beyond a single session. You should use session variables to maintain the information.

  Internet changes consumer and supplier relationships

Considering a focus in area of E-Commerce (EC), how would you think Internet changes consumer and supplier relationships?

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