Absolute C++
Absolute C++
6th Edition
ISBN: 9780133970784
Author: Walter Savitch, Kenrick Mock
Publisher: Addison-Wesley
bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 12PP

In the land of Puzzlevania, Aaron, Bob, and Charlie had an argument over which one of them was the greatest puzzle-solver of all time. To end the argument once and for all, they agreed on a duel to the death. Aaron was a poor shot 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. That man would be remembered for all time as the Greatest Puzzle-Solver 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 his target. You will likely want to create multiple subroutines and functions to complete the problem. Once you can simulate a 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 3595/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. What strategy is better for Aaron, to intentionally miss on the first shot or to try and hit the best shooter?

Blurred answer
Students have asked these similar questions
In a classroom election, two presidential candidates, namely, Lisa and Teddy, both garnered the same number of total votes. As such, they decided to play a custom dice game to determine the winner of the election. In this game, a player needs to roll a pair of dice. Teddy will win the game if the sum is odd whereas Lisa will be declared winner if the sum results to even. However, prior to the start of the game, Teddy complained that the custom dice game is biased because according to him, the probability of an even result is 6/11, and for odd - only 5/11. Verify Teddy's claim and evaluate the fairness of the game. A. The game is fair. B. The game is unfair to Lisa. C. The game is unfair to Teddy. D. More information is needed.   complete solution
In a classroom election, two presidential candidates, namely, Lisa and Teddy, both garnered the same number of total votes. As such, they decided to play a custom dice game to determine the winner of the election. In this game, a player needs to roll a pair of dice. Teddy will win the game if the sum is odd whereas Lisa will be declared winner if the sum results to even. However, prior to the start of the game, Teddy complained that the custom dice game is biased because according to him, the probability of an even result is 6/11, and for odd - only 5/11. Verify Teddy's claim and evaluate the fairness of the game. COMPLETE SOLUTION
The Monty Hall game is a statistical problem: there is a TV show (like the Monty Hall show) that allows contestants to choose between three doors, A, B, and C. Behind one of these doors is a new car (the winning door), and behind the other two are goats (the losing doors). After the contestant makes a choice, the game show host shows a goat behind one of the doors NOT chosen. The contestant is then given a choice to either switch to the other, non-opened door, or stick with their original guess. The interesting part of this “game" is the statistics involved –a person has a 1/3 chance of originally picking a winning door. The other door – that which is not revealed to have a goat but also was not originally chosen – actually has a 2/3 chance of being a winning door. Therefore, it is in the contestant's best interest to switch doors. You will create a program that simulates the Monty Hall game, where the computer plays the role of the host. The program must have no outputs, but 1) Ask…

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Which of the following expressions return true? After writing your answers on paper, open the Code Pad in Bl...

Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)

Give an example of a data constraint.

Database Concepts (8th Edition)

What will the following program display? public class Checkpoint { public static void main (String [] args) { i...

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Describe a method that can be used to gather a piece of data such as the users age.

Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)

Use a comment to state that a program performs a sample payroll calculation.

Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
6 Stages of UI Design; Author: DesignerUp;https://www.youtube.com/watch?v=_6Tl2_eM0DE;License: Standard Youtube License