The joint probability distribution of the number X of cars and the number Y of buses per signal cycle at a proposed left-turn lane is displayed in the accompanying joint probability table.
| y | ||||
|
p(x, y) |
0 | 1 | 2 | |
| x | 0 | 0.015 | 0.025 | 0.010 |
| 1 | 0.030 | 0.050 | 0.020 | |
| 2 | 0.075 | 0.125 | 0.050 | |
| 3 | 0.090 | 0.150 | 0.060 | |
| 4 | 0.060 | 0.100 | 0.040 | |
| 5 | 0.030 | 0.050 | 0.020 | |
(a) What is the probability that there is exactly one car and
exactly one bus during a cycle?
(b) What is the probability that there is at most one car and at
most one bus during a cycle?
(c) What is the probability that there is exactly one car during a
cycle? Exactly one bus?
| P(exactly one car) | = |
| P(exactly one bus) | = |
(d) Suppose the left-turn lane is to have a capacity of five cars
and one bus is equivalent to three cars. What is the probability of
an overflow during a cycle?
(e) Are X and Y independent rv's? Explain.
Yes, because p(x, y) = pX(x) · pY(y).Yes, because p(x, y) ≠ pX(x) · pY(y). No, because p(x, y) = pX(x) · pY(y).No, because p(x, y) ≠ pX(x) · pY(y).
In: Statistics and Probability
The joint probability distribution of the number X of cars and the number Y of buses per signal cycle at a proposed left-turn lane is displayed in the accompanying joint probability table.
| y | ||||
|
p(x, y) |
0 | 1 | 2 | |
| x | 0 | 0.015 | 0.010 | 0.025 |
| 1 | 0.030 | 0.020 | 0.050 | |
| 2 | 0.075 | 0.050 | 0.125 | |
| 3 | 0.090 | 0.060 | 0.150 | |
| 4 | 0.060 | 0.040 | 0.100 | |
| 5 | 0.030 | 0.020 | 0.050 | |
(a) What is the probability that there is exactly one car and
exactly one bus during a cycle?
(b) What is the probability that there is at most one car and at
most one bus during a cycle?
(c) What is the probability that there is exactly one car during a
cycle? Exactly one bus?
| P(exactly one car) | = |
| P(exactly one bus) | = |
(d) Suppose the left-turn lane is to have a capacity of five cars
and one bus is equivalent to three cars. What is the probability of
an overflow during a cycle?
(e) Are X and Y independent rv's? Explain.
Yes, because p(x, y) = pX(x) · pY(y).Yes, because p(x, y) ≠ pX(x) · pY(y). No, because p(x, y) = pX(x) · pY(y).No, because p(x, y) ≠ pX(x) · pY(y).
In: Statistics and Probability
The Golden State Warriors famously broke the NBA’s single season wins record with 73 wins and 9 losses.Treat these games as a random sample. Use the normal approximation to the binomial to test whether or not their true winning percentage was greater than .695 at α = 0.05 (you may do a 1-sided test).
In: Statistics and Probability
Why does the loop dont stop after Player1 wins. It stops
after player2 wins but not player1. After player1 wins it asks
player2 to play again. Can someone pls help?
import java.util.Scanner;
public class Project2 {
public static void main(String [] args) {
Scanner input= new Scanner(System.in);
int total = 15, max_stones = 5, num_stones_removed;
int pile = total; //all stones are in the pile to start
int count = total;
boolean won= false;
boolean player2=false;
boolean player1=false;
while (pile>0 && won==false) {
while (player1==false){
System.out.println("Player1- How many stones you want to remove
between 1 and " + max_stones);
num_stones_removed= input.nextInt();
System.out.print(num_stones_removed);
if (num_stones_removed>=1 &&
num_stones_removed<=max_stones &&
num_stones_removed<=pile) {
pile =pile-num_stones_removed; //update pile
player1=true;
count--;
System.out.println("You have " + pile + " stones left");
if (pile==0) {
won=true;
System.out.println("Play1 won");
break;
}
} else {
System.out.println("Invalid pick");
}// end else
}
player1=false;
while (player2==false) {
System.out.println("Player2- How many stones you want to remove
between 1 and " + max_stones);
num_stones_removed= input.nextInt();
if (num_stones_removed>=1 &&
num_stones_removed<=max_stones &&
num_stones_removed<=pile) {
pile =pile-num_stones_removed; //update pile
player2=true;
count--;
System.out.println("You have " + pile + " stones left");
if (pile==0) {
won=true;
System.out.println("Play2 won"); // player 2 wins
break;
}
}
else {
System.out.println("I am inside else-loop for P2"); //invalid pick
for player2
System.out.println("Invalid pick");
}// end else
}
player2=false;
}// while loop
}}
In: Computer Science
A 0.2 m^3 piston/cylinder contains air at 400 K and 400 kPa and receives heat from a constant temperature heat source at 1300 K. The piston expands at constant pressure to a volume of 0.6 m^3. Determine the change of availability of the system. Assume To= 300K and Po = 100kPa.
Answer should be 210.3 kJ.
In: Mechanical Engineering
A cylinder fitted with a piston has an initial volume of 0.1 m3 and contains nitrogen at 150 kPa, 25 0C. The piston is moved, compressing the nitrogen until the pressure is 1 MPa and the temperature is 150 0C. During this compression process heat is transferred from the nitrogen, and the work done on the nitrogen is 20 kJ. Determine the amount of this heat transfer.
In: Chemistry
2. Probability (30%). Figure out the probability in the following scenarios.
(a) A number generator is able to generate an integer in the range of [1, 100], where each number has equal chances to be generated. What is the probability that a randomly generated number x is divisible by either 2 or 3, i.e., P(2 | x or 3 | x)? (5%)
(b) In a course exam, there are 10 single-choice questions, each worthing 10 points and having 4 choices (A, B, C, and D, with only one correct). There is one student, denoted as s, who has learned nothing from the course and hence has to randomly guess the answers. That means for any question, each one of the four choices has equal chances to be picked up by s. What is the probability that s passes the exam (earning a total of ≥ 60 points)? (5%)
(c) Consider three positive integers, x1, x2, x3, which satisfy the inequality below: x1 + x2 + x3 = 17. (1) Let’s assume each element in the sample space (consisting of solution vectors (x1, x2, x3) satisfying the above conditions) is equally likely to occur. For example, we have equal chances to have (x1, x2, x3) = (1, 1, 15) or (x1, x2, x3) = (1, 2, 14). What is the probability the events x1 + x2 ≤ 8 occurs, i.e., P(x1 + x2 ≤ 8 | x1 + x2 + x3 = 17 and x1, x2, x3 ∈ Z+) (Z+ is the set containing all the possible positive integers)? (5%)
(d) There are unlimited fake coins and only one real coin. The fake coins and the real coin are almost the same and can only be detected by a special machine. At the very beginning, there are two coins in a bag, one fake and the other real (but we don’t know which one is real). We continue the following process till the real coin is found: At the each step, we randomly sample one coin from the bag and examine whether it is fake. If yes, we put the coin back to the bag, additionally put in another fake coin, and randomly draw a coin for examination. The sampling process won’t stop until we find the real coin. Assuming that each coin (either fake or real) has equal chances to be selected, what is the probability that we sample 9 times but still cannot find the real coin (and hence has to continue the sampling process)? (5%)
(e) From a random sports news, the probability of observing the word “ball” and “player” is 0.8 and 0.7, respectively. For a non-sports news, the probability to observe “ball” is 0.1, so does that to observe “player”. Let’s assume that in any article, the appearance of any two words (including “ball” and “player”) are independent with each other. Also, the probability of sports news’ occurrences is 0.2. Given a news report x containing both “ball” and “player”, what is the probability that x is a sports news. (10%)
In: Statistics and Probability
The probability for a family having x dogs is given by:
| Number of Dogs, x |
Probability of x, P(X=x) |
|
0 |
.3 |
|
1 |
.4 |
|
2 |
.2 |
|
3 |
.1 |
Find the expected number of dogs that a family will have. Round to the nearest tenth.
In: Statistics and Probability
Draw a free body diagram of a piston, connecting rod and crank shaft. Indicate on the diagram the effective forces acting on the piston and the crank shaft during the expansion stroke. Now let’s do some sample calculations assume 2500 RPM and neglecting friction.
b. For a compression ignition engine with a 200mm bore, a compression ratio of rc = 20, and a cylinder pressure of 100 bar when the crank shaft is at θ = 0°, 45° and 90°. You can assume that the S/B = 1 and l/a = 3, that the piston has a mass of 1 kg, and for simplicity that the expansion of the hot gas from TDC to BDC is isentropic with k =1.4
Second sentence.
In: Mechanical Engineering
Please Use Javascript and P5
Pongish
Create a one player pong game. This should have:
1. A paddle/rectangle controlled by the player on the right of the screen (moves up/down)
2. A ball/circle that starts moving to the left of the screen.
3. This ball bounces off the TOP, BOTTOM, and LEFT of the
screen.
4. This ball bounces off the paddle (use hitTestPoint)
5. If the ball goes beyond the right of the screen, place the ball
back at the center of the screen and set its velocity to the left
again.
7. (optional) Display a "score" number on the screen that ticks up
by 1 every time the player catches the ball with the paddle. Resets
to zero when the ball resets.
Ideally, this project would use objects for both paddle and
ball.
In: Computer Science