Do it in python please! also please use this template please I have provided and below is the activity
def main():
# import the module random
try:
# asking the user to enter a number between 1 and 100
#loop time
while
if
elif
#for loop # generates that number of random integers and stores
them in a list
for x in
# computations
# displays the results on the screen
# call try_Again to give the user the opportunity to try again or to end the program
#bit of error catching
except:
# Defining a function tryAgain()
def try_Again():
while
if
elif
# defining a function endProgram that will be called any time
the user wants to end the program
def endProgram():
# heading
# Calling the main function
if __name__ =='__main__':
main()
# This will keep the console open at the end of the program
# until the end user hits the Enter key.
This activity is worth 10 total points
This lesson's Group Activities are:
We're going to take the Group Activity from last week and tweak it. Instead of storing the random numbers in a list, we're going to store them in a file. Write a 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:
Helpful hint: don't forget about input validation loops and try/catch exceptional handling. Both are very useful when used in conjunction with functions.
In: Computer Science
In: Math
For a certain river, suppose the drought length Y is the number of consecutive time intervals in which the water supply remains below a critical value y0 (a deficit), preceded by and followed by periods in which the supply exceeds this critical value (a surplus). An article proposes a geometric distribution with p = 0.409 for this random variable. (Round your answers to three decimal places.)
(a) What is the probability that a drought lasts exactly 3 intervals? At most 3 intervals?
| exactly 3 intervals | .0684 |
| at most 3 intervals |
(b) What is the probability that the length of a drought exceeds its mean value by at least one standard deviation?
In: Math
A health statistics agency in a certain country tracks the number of adults who have health insurance. Suppose according to the agency, the uninsured rates in a recent year are as follows: 5.3% of those under the age of 18, 12.6% of those ages 18–64, and 1.3% of those 65 and older do not have health insurance. Suppose 22.6% of people in the county are under age 18, and 62.1% are ages 18–64.
(a)
What is the probability that a randomly selected person in this country is 65 or older?
________
(b)
Given that a person in this country is uninsured, what is the probability that the person is 65 or older? (Round your answer to three decimal places.)
_______
In: Statistics and Probability
An attendant at a car wash is paid according to the number of cars that pass through. Suppose the probabilities are 1/12, 1/12, 1/4, 1/4, 1/6, and 1/6, respectively, that the attendant receives $7, $9, $11, $13, $15, or $17 between 4:00 P.M. and 5:00 P.M. on any sunny Friday.
a) What is the probability that the attendant receives more than 15 dollars in this period?
b) What is the probability that attendant receives less than 10 dollars in this period?
c) Find the attendant’s expected earnings for this particular period.
d) Find the attendant’s variance of earnings for this particular period
In: Statistics and Probability
A bad marksman takes 10 shots at a target with probability of hitting the target with each shot of 0.1, independent of other shots. Z is the random variable representing the number of hits.
a) Calculate and plot the PMF of Z.
b) Calculate and plot CDF of Z. (You may desire to manual adjust the plot for our convention)
c) What is the probability that 3 < ?? < 5 shots were hits
d) Find E[Z] and var[Z]
e) If the marksman were to get $x for each shot on target. How much should the marksman expect to get in order to break even on the $10 entry fee?
In: Statistics and Probability
A leading magazine (like Barron's) reported at one time that the
average number of weeks an individual is unemployed is 36.3 weeks.
Assume that for the population of all unemployed individuals the
population mean length of unemployment is 36.3 weeks and that the
population standard deviation is 7.5 weeks. Suppose you would like
to select a random sample of 124 unemployed individuals for a
follow-up study.
Find the probability that a single randomly selected value is
between 35.8 and 36.1.
P(35.8 < X < 36.1) =
Find the probability that a sample of size n=124 is randomly
selected with a mean between 35.8 and 36.1.
P(35.8 < M < 36.1) =
In: Statistics and Probability
I know for a fact that this is a binomial distribution and that's because it has two different outcomes and independent trials however I am trying to understand finding the probability in excel, can you explain how this is done in excel?
In: Statistics and Probability
Isabel is taking a multiple-choice question quiz. The quiz has 7 questions and each question has 4 possible answers (only one of them is a correct answer). Since she didn’t study at all, she will guess all the questions. Let X be the random variable representing the number of answers she’ll guess correctly.
(3 pts) What values does X take on?
(4 pts) Calculate the probability that she guesses 2 questions correctly.
(4 pts) Calculate the probability of passing the quiz. She needs to guess at least 5 questions correctly to pass the quiz. .(show steps and if calculator was used)
In: Statistics and Probability
In: Statistics and Probability