explain the answer with clear handwriting please
Questions: 1. [10 pts] There are two players A and B. The probability that A wins a game is 0.4, and the probability that B wins a game is 0.6. We randomly choose one player between A and B and let the chosen player play 10 independent identical games. An amount Xin dollars) is rewarded to each win, where X has a continuous uniform distribution over (0,60). Let X be the total amount...
python question
Question 1 Write a Python program to play two games. The program should be menu driven and should use different functions to play each game. Call the file containing your program fun games.py. Your program should include the following functions: • function guess The Number which implements the number guessing game. This game is played against the computer and outputs the result of the game (win/lose) as well as number of guesses the user made to during the...
1. Two fair dice are thrown and the smallest of the face values, Z say, is noted (a) Give the probability mass function (pmf) of Z in table form: P(Z=2) (b) Calculate the expectation of 1/Z 2] (c) Consider the game, where a player throws two fair dice, and is paid Z dollars, with Z as above. To enter the game the player is required to pay 3 dollars What is the expected profit (or loss) of the player, if...
C++ Write a program that plays the rock, paper, scissors game. Rock beats scissors; scissors beats paper; paper beats rock. You must use these specific functions in your program. These are the prototypes: char generateP2toss(); int checkThrow(char, char); void printStatistics(int, int, int, int); void finalStatistics(int, int, int, int); void welcome(); Notes on these functions: generateP2toss() will generate the computer's toss (the computer is player2). It returns either an "r", "p", or "s/" checkThrow(char char) will check the throw by passing...
ITEMS SUMMARY 16, < Previous Nex The following program obtains three integers, x, y, and z, as input form the user. Complete the program so that it determines whether there is a subset of two or three of these numbers that sum to zero. If so, the program should print zero sum found. Otherwise, it should print no zero sum found. Check syntax X = int(input) 2 y int(input) int(input) In the word game Boggle, a word is scored according...
C++ Homework: This will be the first in a series of assignments to create a game called Zilch. In this assignment, you will create the basic structure of the program and demonstrate the ability to create programs with multiple files. It should serve as a refresher in the basics of C++ programming, especially in the handling of arrays. The initial assignments only establish a rough outline of the game. We will be adding the rules that make the game more...
Question 9 [10 points] Bob and Doug play a lot of Ping-Pong, but Doug is a much better player, and wins 90% of their games. To make up for this, if Doug wins a game he will spot Bob five points in their next game. If Doug wins again he will spot Bob ten points the next game, and if he still wins the next game he will spot him fifteen points, and continue to spot him fifteen points as...
Question 9 [10 points] Bob and Doug play a lot of Ping-Pong, but Doug is a much better player, and wins 70% of their games To make up for this, if Doug wins a game he will spot Bob five points in their next game. If Doug wins again he will spot Bob ten points the next game, and if he still wins the next game he will spot him fifteen points, and continue to spot him fifteen points as...
The game lets players know whether they have won, lost, or tied a particular game. Modify the game so the players are told the number of games they have won, lost or tied since the start of game play. Implement this change by adding three variables named $wins, $lost, and $ties to the program's Main Script Logic section, assigning each an initial value of 0. Next, modify the analyze_results method by adding programming logic that increments the values of $wins,...
I'm having trouble with this question, could someone please help? A person pays $2 to play a game rolling a single dice. If 1 or 2 comes up, the player wins nothing. If 3, 4, 5, or 6 comes up, then the player wins the difference between $2 and the number rolled. Fill in the following table, and calculate the expected value of the game. X 1 2 3 4 5 6 Total P(X) $ win P(X) x $ win...