Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Statistical Measures The Mean is the Average of a set of numbers. The Median denotes the value lying at the midpoint of a frequency distribution
Statistical Measures
The Mean is the Average of a set of numbers.
The Median denotes the value lying at the midpoint of a frequency distribution of observed values, such that there is an equal probability of falling above or below it
The Mode is the value that appears most often in a set of numbers.
In the graph, shown on the next page, it would be the tallest bar in the distribution.
In the following graph, while the mean is given to you, the mode and median are not.
Your job will be to write two programs:
Write a program that will determine the mode of the following distribution.
Write a second program to determine the median of this distribution.
Please note: Your programs should be indented after the def main: statement, except for the final statement main at the bottom.
Distribution of annual household income in the United States
estimate
perent of
Part I: Program to identify the mode
Given the graph of the distribution of incomes, the mode is visually apparent. Nonetheless, your job is to write a program that will determine which vertical bar, in the diagram, is indeed the mode.
The program should identify the particular vertical bar by indicating the name it is given in the horizontal axis.
For example, the mean value is contained int the vertical bar labeled: $ to $
Your program needs to identify which bar contains the mode.
The values, of the heights of each of the bars displayed in the graph, represent what percentage of the entire distribution is contained in a particular bar.
The values of all of the bars, starting from the left, are contained in the file, FamilyIncome.txt Were you to add up all the values which represent the percentage of the population earning in each of the $ ranges indicated in this distribution, you would see that they all add up to or
Be sure that you test to see that the data file, FamilyIncome.txt is indeed present.
Call your program: mynameFinalA.py where myname should be replaced by your own name.
Part : Program to identify the median
The median identifies the halfway point in the distribution.
There should be as many entries smaller than the median as there are entries larger than the median.
The program should identify the particular vertical bar, which includes the median value, by indicating the name it is given in the horizontal axis.
For example, the mean value is contained int the vertical bar labeled: $ to $
Your program needs to identify which bar contains the median value.
If you were to sum the heights of all the bars up to and including the median, you should find that the sum would just exceed of the total value which again is with the addition of that bar which contained the median. The bar which causes the sum to equal or exceed will be the bar containing the median.
Be sure to test to see that your data file, FamilyIncome.txt is present.
Call your program: mynameFinalB.py where myname should be replaced by your own name.
this is whats inside the file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started