A group of statisticians at a local college has asked you to create a set of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A group of statisticians at a local college has asked you to create a set of functions that compute the median and mode of a set of numbers. Define these functions in a module named stats.py. Also include a function named mean, which computes the average of a set of numbers. Each function should expect a list of numbers as an argument and return a single number. Each function should return 0 if the list is empty. Include a main function that tests the three statistical functions with a given list. Note: Mean: The "average" number; found by adding all data points and dividing by the number of data points. Example: The mean of 4, 1, and 7 is (4+1+7)/3 12/3 =4 Median: The middle number; found by ordering all data points and picking out the one in the middle (or if there are two middle numbers, taking the mean of those two numbers). Example: The median of 4, 1, and 7 is 4 because when the numbers are put in order (1, 4, 7), the number 4 is in the middle. Mode: The most frequent number-that is, the number that occurs the highest number of times. Example: The mode of (4,2, 4, 3, 2, 2}is 2 because it occurs three times, which is more than any other number. A group of statisticians at a local college has asked you to create a set of functions that compute the median and mode of a set of numbers. Define these functions in a module named stats.py. Also include a function named mean, which computes the average of a set of numbers. Each function should expect a list of numbers as an argument and return a single number. Each function should return 0 if the list is empty. Include a main function that tests the three statistical functions with a given list. Note: Mean: The "average" number; found by adding all data points and dividing by the number of data points. Example: The mean of 4, 1, and 7 is (4+1+7)/3 12/3 =4 Median: The middle number; found by ordering all data points and picking out the one in the middle (or if there are two middle numbers, taking the mean of those two numbers). Example: The median of 4, 1, and 7 is 4 because when the numbers are put in order (1, 4, 7), the number 4 is in the middle. Mode: The most frequent number-that is, the number that occurs the highest number of times. Example: The mode of (4,2, 4, 3, 2, 2}is 2 because it occurs three times, which is more than any other number.
Expert Answer:
Answer rating: 100% (QA)
Program code to copy This function will calculate the median of given list of numbers Function recei... View the full answer
Posted Date:
Students also viewed these programming questions
-
A local government agency has asked you to consult regarding acquisition of land for recreation needs for the urban area. The following data are provided: Urban population 10 years ago 49,050 Urban...
-
An economic policy research organization has asked you to study the relationship between disposable income and unemployment level. The data for this study are contained in the data file Economic...
-
The payroll clerk at Photo Workshop has asked you to create an application that displays an employees net pay. The application should allow the payroll clerk to enter the employees name, hours...
-
1-Is it a good business strategy to have a day care center, Harley Davidson Motorcycle Dealership Sales and repair, Namaste Yoga studio, bookstore, temporary worker (day laborer) center, state prison...
-
In exercise 8 ratings data on x = the quality of the speed of execution and y = overall satisfaction with electronic trades provided the estimated regression equation y = .2046 + .9077x (AAII...
-
Determine the cumulative distribution function for the distribution in Exercise 4-4.
-
Denise Young, an accountant for Chiles Corporation, has been asked to prepare an income statement that reports contribution margin. Miss Young has asked you to prepare an analysis of three months...
-
The unadjusted and adjusted trial balances of White Company as of December 31, 2012, are presented below. Required: 1. Prepare the journal entries that are required to adjust the accounts at December...
-
This question is for IF THEN exercise purpose # For the dividend data you downloaded for the list first_100_tickers, create a column named "dividend size" # assign value to "dividend size" following...
-
Asbat Pharmaceuticals (Asbat) is a leading pharmaceutical company that has been in existence for 22 years. Asbat has a calendar year-end and is audited annually. Asbat only operates in the United...
-
qy7 Start Suppose the mean height in inches of all 9th grade students at one high school is estimated. The population standard deviation is 2 inches. The heights of 9 randomly selected students are...
-
Develop a bootstrap marketing plan for a new business idea you currently have under development.
-
Internal auditing is a tenn which includes: a. Management auditing. b. Operational auditing. c. Comprehensive auditing. d. All of the above. e. None of the above
-
The internal auditor's concern about fraud within tlie enterprise: a. Is the same as that of the external auditor. b. Involves matters of financial materiality only. c. Relates to what the fraud, big...
-
Since internal auditors are experts in controls, they should have the authority: a. To develop accounting systems. b. Direct accounting personnel to make corrections and adjustments. c. Order changes...
-
Analyzing internal control For each of these five separate cases, identify the basic control principle(s) that is violated. Recommend what the business should do for better control. 1. Lavina Company...
-
ABA Berhad supplies ABC Berhad with 2,000 reams of paper annually for its office use. Each ream of paper costs RM56 to purchase. In addition, the holding cost (per ream) per year is 0.1% of the...
-
Bonus shares can be issued out of revenue reserves. True/False?
-
Consider the problem of generating samples from \(Y \sim \operatorname{Gamma}(2,10)\). (a) Direct simulation: Let \(U_{1}, U_{2} \sim\) idd \(\mathscr{U}(0,1)\). Show that \(-\ln \left(U_{1} ight) /...
-
Let \(U, V \sim_{\text {iid }} \mathscr{U}(0,1)\). The reason why in Example 3. 7 the sample mean and sample median behave very differently is that \(\mathbb{E}[U / V]=\infty\), while the median of...
-
As a generalization of Example C.9, consider a random walk on an arbitrary undirected connected graph with a finite vertex set \(\mathscr{V}\). For any vertex \(v \in \mathscr{V}\), let \(d(v)\) be...
Study smarter with the SolutionInn App