In: Physics
In a tennis match, the first serve percentage is a key statistic. Having an accurate (and fast) first serve is seen as an important advantage to winning a match. Let theta be the probability of getting the first serve in on any point in a tennis game. For each of the four situations below, give a prior distribution for theta, explaining each in a sentence. You may assume the winner is determined from the best of three sets, (so the first player to win two sets will win).
(a) The point is the first point of the match.
(b) It is the beginning of the second set and the server has won the first set.
(c) It is the beginning of the second set and the server has lost the first set.
(d) If the server wins the next point, they will win the match.
In: Math
Consider the following experiment with 100 grams of a pure substance in a variable-volume cylindrical container. The base of the cylinder is 100 cm2. The height of the piston from the base of the cylinder is denoted by h (cm). Therefore, the internal volume of the cylinder in cm3 is 100h. The cylinder height is slowly changed and the following data is gathered at equilibrium.
| case | height, h (cm) | Number of phases | Mass of vapor | Temperature (C) |
| 1 | 3.77 | 2 | 30 | 10 |
| 2 | 4.66 | 2 | 40 | 10 |
| 3 | ? | 2 | 59 | 10 |
a) find the specific density of each phase
b) find the height in case 3
c) state whether the following statement is true or false: The pressures in all three cases are equal.
In: Other
With C language
A slot machine has three windows. A random fruit is picked for each window from cherry, apple, lemon, and orange. If all three windows match, the user wins 8 times the bet amount. If the first two windows only are cherries, the user wins 3 times the bet amount. If the first window is a cherry and the second window is not a cherry, the user wins the bet amount. Otherwise, the player loses their bet. Write a C program that will first allow the user to enter a bet amount. Next, the program should pick 3 random fruits for the 3 windows and print the 3 fruits picked. Lastly, the amount of money won or lost by the user should be displayed.
In: Computer Science
With C language
A slot machine has three windows. A random fruit is picked for each window from cherry, apple, lemon, and orange. If all three windows match, the user wins 8 times the bet amount. If the first two windows only are cherries, the user wins 3 times the bet amount. If the first window is a cherry and the second window is not a cherry, the user wins the bet amount. Otherwise, the player loses their bet. Write a C program that will first allow the user to enter a bet amount. Next, the program should pick 3 random fruits for the 3 windows and print the 3 fruits picked. Lastly, the amount of money won or lost by the user should be displayed.
In: Computer Science
Assignment6A: This used to be entertainment. If you haven’t played the classic game Pong, then you are now required to do so. Though it doesn’t capture the poor quality of the original, you can find an emulator at Pong-2.com. Play it (using the keyboard). Do you see how the ball bounces off of the walls and the paddles? You’re going to learn how to do this by creating class Ball.
A Ball has an X and Y position. Equally important, a ball has an
x velocity and a y velocity. Every time the ball moves (in one unit
of time), it changes its X and Y position by its x and y velocity.
However, before moving it, you need to check to see if it’s
touching a wall. If so, you need to reverse either its x or y
velocity depending on whether or not its touching a wall. What is
the ball’s location if its touching a wall? For simplicity, we’re
going to assume that the ball is on a 10x10 field and that the x
and y velocities can only be -1, 0, or +1.
Your task is to 1) write class Ball that has the variables/attributes above, 2) has a constructor that takes in the starting X and Y position as well as the starting X and Y velocity, 3) has a method called “move” that takes no parameters and updates the position of the ball and 4) has a print statement called “print” that takes no parameters and prints out the ball’s current position.
You must call the class “Ball” and put it in a file called Ball(.java, .cs, .cpp, .h). To test your ball, you should create a file called Assignment6A(.java, .cs, .cpp) that creates a ball based off of user input and calls the “move” and “print” methods of the ball the number of times the user wants. It should behave like the sample output below.
|
Sample Output #1: x: 7 y: 4 x velocity: 1 y velocity: 1 Number of moves: 20 X:7 Y:4 X:8 Y:5 X:9 Y:6 X:8 Y:7 X:7 Y:8 X:6 Y:9 X:5 Y:8 X:4 Y:7 X:3 Y:6 X:2 Y:5 X:1 Y:4 X:0 Y:3 X:1 Y:2 X:2 Y:1 X:3 Y:0 X:4 Y:1 X:5 Y:2 X:6 Y:3 X:7 Y:4 X:8 Y:5 X:9 Y:6 |
Sample Output #2: x: 5 y: 2 x velocity: 0 y velocity: -1 Number of moves: 20 X:5 Y:2 X:5 Y:1 X:5 Y:0 X:5 Y:1 X:5 Y:2 X:5 Y:3 X:5 Y:4 X:5 Y:5 X:5 Y:6 X:5 Y:7 X:5 Y:8 X:5 Y:9 X:5 Y:8 X:5 Y:7 X:5 Y:6 X:5 Y:5 X:5 Y:4 X:5 Y:3 X:5 Y:2 X:5 Y:1 X:5 Y:0 |
In: Computer Science
Write a Python program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a file. It should then display the following data to back to the user:
In: Computer Science
PYTHON BEGINNER Problem Create a program that lets the user play a simplified game of Blackjack, which is played between the user and an automated dealer as follows.
The dealer shuffles a standard deck of 52 cards, draws two cards, and gives them to the user. The user can then choose to request another card from the dealer, adding it to their hand. The user can continue to request cards or choose to stop at any time. After each time the user requests a card, the program should output the cards in the player's updated hand and their total point value (see the function decomposition section below for how to calculate points). If, when receiving a new card, the total number of points in the hand goes over 21, the user loses. In this case, the dealer does not play.
Once the user chooses to not draw any more cards, it is the dealer's turn to play, which is automated as follows. The dealer begins by drawing two cards. As long as the point value of the dealer's hand is less than 17, the dealer draws another card. When the point value of the hand is between 17 and 21 (inclusive), the dealer stops and the two hands (users and dealer's) are compared. The player with the highest point value wins. If the point value of the dealer's hand goes over 21, the dealer has lost.
When the game ends, the program should output the outcome along with both player's hands.
Instructions Create a new Python file and place intro comments using the template below. Use comments to write the algorithm your program will follow, including functions.
In: Computer Science
rewrite the below-working principle of hydraulic power steering system in your own word with out missing the general concept of the principle
In this type of power steering system as we discussed above the hydraulic force is used to multiply the steering input force in order to smoothen the steering of the front wheels. This hydraulic force is generated by a series of components that include a hydraulic cylinder, rotator hydraulic pump, hydraulic lines, highly compressed hydraulic fluid, and a coupling mechanism that can couple this hydraulic system with the rack of the steering system.
In: Mechanical Engineering
A bias coin has the probability 2/3 of turning up heads. The
coin is thrown 4 times.
(a) What is the probability that the total number of heads shown is
3?
(b) Suppose that we know that outcome of the first throw is a head.
Find the probability
that the total number of heads shown is 3.
(c) If we know that the total number of heads shown is 3, find the
probability that the outcome
of the first throw was heads.
In: Math