Write a program(Python) using functions and mainline logic which prompts the user to enter a number. The number must be at least 5 and at most 20. (In other words, between 5 and 20, inclusive.) The program then generates that number of random integers and stores them in a list. The random integers should range from 0 to 100. It should then display the following data to back to the user with appropriate labels:
The list of integers
The lowest number in the list
The highest number in the list
The total sum of all the numbers in the list
The average number in the list
Use try/except to make sure the user enters an integer.
[Make it simple so that i can understand]
In: Computer Science
A student would like to determine whether the number of pages in a textbook can be used to predict its price. She took a random sample of 30 textbooks from the campus bookstore and recorded the price (in $) and the number of pages in each book. The least squares regression line is calculated to be ŷ = 83 + 0.3x.
Question 21 (1 point)
One textbook in the sample costs $120 and has a residual value of -32. How many pages are in this textbook?
Question 21 options:
|
250 |
|
|
240 |
|
|
230 |
|
|
220 |
|
|
210 |
Question 22 (1 point)
Saved
Refer to the previous question. We conduct a hypothesis test to determine if there exists a positive linear relationship between number of pages and price of a textbook. The P-value is calculated to be 0.18.
What is the interpretation of this P-value?
Question 22 options:
|
The probability that there is a positive linear relationship between number of pages and price is 0.18. |
|
|
If there was a positive linear relationship between number of pages and price, the probability of observing a value of b1 at least as high as 0.3 would be 0.18. |
|
|
If there was a positive linear relationship between number of pages and price, the probability of observing a value of β1 at least as high as 0.3 would be 0.18. |
|
|
If there was no linear relationship between number of pages and price, the probability of observing a value of b1 at least as high as 0.3 would be 0.18. |
|
|
If there was no linear relationship between number of pages and price, the probability of observing a value of β1 at least as high as 0.3 would be 0.18. |
In: Statistics and Probability
A couple plans to have children until they get a girl, but they agree they will not have more than three children, even if all are boys. Assume that the probability of having a girl is 52.00 %. a) Create a probability model for the number of children they'll have. b) Find the expected number of children. c) Find the expected number of boys they'll have.
In: Statistics and Probability
JAVA CODE FILL IN THE BLANKS
you are to complete the skeleton program by completing
* the To Do sections. I would suggest doing this a
* little bit at a time and testing each step before you
* go on to the next step.
*
* Add whatever
code is necessary to complete this assignment
*********************************************************************/
//Add whatever code is necessary to complete this assignment
public class Methods
{
public static void main(String[] args)
{
//create two integer variables
below
//ask the user to enter numbers
into each of the variables
(
//call the max method to determine
which number is the biggest
//and then display the result to
the screen in a message that looks like...
//"The highest number you entered
was X"
//call the difference method to
determine the difference between the two numbers
//and then display the result to
the screen in a message that looks like...
//"The difference between X and Y
is Z" (where X is the first number,
//Y is the second number and Z is
the difference)
//***The difference should always
be a positive value***
}//end main
//write a max method here. It should accept two
numbers and return the highest
//of those two numbers
//write a difference method here. It should accept two
numbers and return the difference
//between the two numbers. *** The difference must
always be a positive number. ***
}//end Methods
In: Computer Science
2. In the Gulf of Maine, 7different species (two types of mussels, barnacles, and four types of seaweed) colonize the rocky intertidal zone between the low-and high-tide marks. These species are sessile, meaning they attach to the rock, so they are in competition with each other for space.
Within any square meter, there are always 4 and only 4 species. How many possible ways can a square meter be inhabited?
Within any square meter, the spaces occupied by the species are never equal. You realize that the colonization sequence affects how much spacea species can occupy. How many possible ways can a square be colonized?
3. You are a climate scientist interested in lightning strikes. You install a lightning rod on each of the 6 highest mountain peaks surrounding a valley. During a storm, the probability of lightning striking a rod is 0.2.
Without using a table, what is the probability that that none of the rods will be struck?
Using a table, calculate the same probability.
To create a fantastic meterological phenomenon, all 6 rods must be struck. What is the probability of this?
In: Statistics and Probability
Eurowatch company assembles expensive wristwatches and then sells them to retailers throughout europe. The watches are assembled at a plant with two assembly lines. These lines are intended to be identical, but line 1 uses somewhat older equipment than line 2 and is typically less reliable. Historical data have shown that each watch coming off line 1, independently of the others, is free of defects with probability .98. The similar probability for line 2 is 0.99. Each line produces 500 watches per hour. The production manager has asked you to answer the following questions.
[1] Assume that the number of watches produced every hour is normally distributed with a mean of 500 and a standard deviation of 100. What is the probability that in a randomly selected hour the number of watches produced is greater than 500? 25% 100% 0% 50%
[2] Assume that the number of watches produced every hour is normally distributed with a mean of 500 and a standard deviation of 100. What is the probability that in a randomly selected hour the number of watches produced is less than 700? 0.4772 0.9772 almost 0 0.0228
[3] Assume that the number of watches produced every hour is normally distributed with a mean of 500 and a standard deviation of 100. What is the probability that in a randomly selected hour the number of watches produced is greater than 700? almost 0 0.9772 0.4772 0.0228
[4] Assume that the number of watches produced every hour is normally distributed with a mean of 500 and a standard deviation of 100. What is the probability that in a randomly selected hour the number of watches produced is between 300 than 700? 0.9545 almost 0 0.4545 0.0455
[5] Assume that the number of watches produced every hour is normally distributed with a mean of 500 and a standard deviation of 100. What is the probability that in a randomly selected hour the number of watches produced is less than 300 or more than 700? 0.9545 almost 0 0.0455 0.4545
In: Statistics and Probability
Stuck in the mud is a popular dice game in UK. The game uses
five (5) 6-sided dice to play. The players play in turns.
Choose one player to start the game. The player will roll all five
(5) dice. If the player rolled any 2s or 5s, the player does not
score any points for this throw. The player can only score on a
roll which does not include the number 2 and 5. Any dice with a 2
or a 5 becomes stuck in the mud. If this throw does not contain any
2s or 5s, the score is incremented by the sum of the dice
values.
The player needs to set aside any 2s and 5s and throw the remaining
dice. Again, if any 2s or 5s are rolled, the score will not be
incremented for this throw. Throws without 2s and 5s are added to
the previous total score.
Continue in this way until all the dice are stuck. Save the score
and pass the dice to the next player.
Players can agree a total number of rounds to play in advance.
Total up the score. The player with the highest score wins the
game. The following link contains the detail game description:
https://www.activityvillage.co.uk/stuck-in-the-mud
Write a MATLAB program to simulate the Stuck in the Mud game with
additional features that can:
• Use five (5) 6-sided dice to automatically play the Stuck in the
Mud game against a player.
• Greet the player when the game starts.
• Let the player to choose the number of rounds to play. Take care
of the user input to ensure the program will not crash with inputs
like 0, 1.2, -1, 999, and so on...
• The program should not play if the user enters a 0 or any
negative value.
• The program should accurately play the number of rounds specified
by the user. The player and the computer play in turns for each
round.
• The program can always pick one side to start the game first,
either the player side or the computer side. Randomly pick a side
to start the rotation is optional.
• Print the current round number clearly in the command
window.
• If the player side starts first, the program will automatically
roll all five (5) dice for the player. If the player rolled any 2s
or 5s, the player does not score any points for this throw. The
player can only score on a roll which does not include the number 2
and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this
throw does not contain any 2s or 5s, the score is incremented by
the sum of the dice values. The player needs to set aside any 2s
and 5s and throw the remaining dice. Again, if any 2s or 5s are
rolled, the score will not be incremented for this throw. Throws
without 2s and 5s are added to the previous total score. Continue
in this way until all the dice are stuck.
• The dice rolled for the player, the stuck dice, and the scores
during the process should clearly be printed in the command
window.
• The program then automatically roll all five (5) dice for the
computer. Follow the game rules until all five (5) dice are
stuck.
• The dice rolled for the computer, the stuck dice, and the scores
during the process should also be clearly printed in the command
window.
• Accurately track the total scores for the player and the
computer.
• After all the rounds have been played, select a winner based on
the highest total score. It is also possible that the game ends in
a tie.
In: Computer Science
1. A city has calculated the probability of having a significant rupture in a year: p = 0.02. This probability remains fixed from year to year, independent of whether there was a rupture in a preceding year. The city has asked you to determine the following (for each question be sure to specify what probability model you are using and justify the choice.)
a. The probability that the rupture will occur in the 4th year.
b. The expected number of years until the first rupture.
c. The probability of exactly 4 ruptures in the next 14 years.
d. The standard deviation, of the number of ruptures in the next 14 years.
e. The probability that the first rupture occurs in one of the first 4 years.
In: Statistics and Probability
When selecting a card from an ordinary deck of cards, what is the probability of getting a King?
When selecting a card from an ordinary deck of cards, what is the probability of getting a black card or a red card?
When selecting a card from an ordinary deck of cards, what is the probability of getting a 7 AND a heart?
When selecting a card from an ordinary deck of cards, what is the probability of getting a 7 OR a heart?
The probability of rolling a die and getting a number greater than 8 is:
What is the number of outcomes in the sample space if two dice are rolled?
When selecting a card from an ordinary deck of cards, what is the probability of getting a diamond or a spade?
In: Statistics and Probability
1. Compute the probability of no successes in a random sample of three items obtained from a population of 12 items that contains two successes. What are the expected number and standard deviation of the number of successes from the sample?
a) what is the expected number of the sample?
b) what is the standard deviation of the number of successes from the sample?
2. A professor of management has heard that 8 students in his class of 40 have landed an internship for the summer. Suppose he runs into three of his students in the corridor.
a) find the probability that none of these students has landed an internship.
b) find the probability that at least one of these students has landed an internship.
In: Statistics and Probability