Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: In the land of Puzzle vania, 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 1>2. 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 that this shooter is the deadliest and has the best chance of hitting back. Write a program to simulate the duel using this strategy.

Your program should use random numbers and the probabilities given in the problem to determine whether a shooter hits the target. Create a class named Duelist that contains the dueler's name and shooting accuracy, a Boolean indicating whether the dueler is still alive, and a method Shoot At Target ( Duelist 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 program that simulates 10,000 duels. Count the number of times that each contestant wins and print the probability of winning for each contestant (e.g., for Aaron your program might output "Aaron won 3,595>10,000 duels or 35.95%"). An alternate strategy is for Aaron to intentionally miss on his first shot. Modify the program to accommodate this new strategy and output the probability of winning for each contestant. Which strategy is better for Aaron: to intentionally miss on the first shot or to try and hit the best shooter? Who has the best chance of winning, the best shooter or the worst shooter?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92417686
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Suppose a 4 packets of a message each of size 10 mbit

Suppose a 4 packets of a message, each of size 10 Mbit arrive simultaneously at a switch preceding a transmission link of rate 5 Mbps connecting to the destination host. (a) What is the average queuing delay experienced ...

Question suppose a computer using set associative cache has

Question : Suppose a computer using set associative cache has 2^16 words of main memory and a cache of 128 blocks, and each cache block contains 8 words. Show steps, please type. a. If this cache is 2-way set associative ...

Suppose a coworker approaches you and asks what an ethical

Suppose a coworker approaches you and asks what an ethical hacker does. She does not understand the role that an ethical hacker plays in the security industry and assumes that such a hacker intentionally causes damage. E ...

Give a recursive algorithm that generates a similar series

Give a recursive algorithm that generates a similar series of coins for changing n cents. Don't use dynamic programming for this problem.

How could legislation impact on operations within your

How could legislation impact on operations within your organisation in relation to innovation, project management, and operational planning? Briefly outline any relevant requirements (e.g. intellectual property, WHS).

Question steve jobs was a strong charismatic leader who

Question: Steve Jobs was a strong, charismatic leader who co-founded Apple and is credited with much of the success of the company. Some believe that Tim Cook, who became CEO in 2011, embraces a more collaborative leader ...

Reduce setup timehammond inc has analyzed the setup time on

Reduce Setup Time Hammond Inc. has analyzed the setup time on its computer-controlled lathe. The setup requires changing the type of fixture that holds a part. The average setup time has been 135 minutes, consisting of t ...

Start by assigning to variable answers a list containing an

Start by assigning to variable answers a list containing an arbitrary sequence of strings 'Y' and 'N'. For example: answers= ['Y','N','N','Y','N','Y','Y','Y','N','N','N'] Write Python statements corresponding to the foll ...

Use the management studio to create a new database called

Use the Management Studio to create a new database called the default settings(If the database already exists, use the Management Studio to delete it and than create it.

Question suppose you are stranded on a desert island on

Question : Suppose you are stranded on a desert island on which queues are plentiful, but you need a stack. How can you implement a stack using two queues? What is the big-Oh running time of the stack operations?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As