Question

In: Computer Science

SAT Score Analysis You have been asked to analyze SAT scores (which may be 400 -...

SAT Score Analysis

You have been asked to analyze SAT scores (which may be 400 - 1600).  

You will be analyzing a population (a list) which consists of a number of

samples (lists) of student scores.

Here is the code to generate the  population/samples:

     import random

  population=[]

  for i in range(5):

  sample = []

  n = random.randint(5,10)

  for num in range(n):

  sample.append(random.randrange(400,1600))

  population.append(sample)  

The analysis should be conducted as follows:

  ##calculate the total number of scores  

  ##calculate the total value of all scores

  ##find the average score of the population  

  ##print the total number of scores  

  ##print the total value of all scores

  ##print the average of all of the scores

  ##while a sample has an average that is less than the

  ##average of all scores add a random value 1000 - 1600

  ##to the sample until the average is no longer less than

  ##the average of all scores

  ##please note: this could result in lots of numbers

  ##being appended to the sample

  ##print the population

  ##adjust the population by

  ##removing the highest and lowest scores from each sample

  ##print the (adjusted) population  

  ##calculate the total number of (adjusted) scores  

  ##calculate the total value of all (adjusted) scores

  ##find the average score of the (adjusted) population  

  ##print the total number of (adjusted) scores  

  ##print the total value of all (adjusted) scores

  ##print the average of all of the (adjusted) scores

Sample Output

Python 3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43)

[Clang 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license()" for more information.

>>>

RESTART: /Users/janetbrownsederberg/Stonehill/Stonehill_Fall_2020/CSC102A_Fall_2020/CSC102_Fall_2020_HomeworkSolutions_JBS/SAT_Analysis_While.py

Population is:

[[1241, 1398, 562, 1247, 1465, 1525, 1328, 825, 1161, 1418], [820, 614, 1299, 1304, 595, 938, 1297], [856, 772, 768, 1396, 625, 559], [975, 883, 1568, 704, 1588, 1485], [1025, 1424, 971, 499, 698, 671]]

Number of scores counted is:

35

Total value of all scores counted is:

36504

Average of all scores is:

1042.9714285714285

Adjusted population is:

[[1241, 1398, 562, 1247, 1465, 1525, 1328, 825, 1161, 1418], [820, 614, 1299, 1304, 595, 938, 1297, 1569], [856, 772, 768, 1396, 625, 559, 1159, 1305, 1152, 1311, 1098, 1336, 1048, 1000, 1547], [975, 883, 1568, 704, 1588, 1485], [1025, 1424, 971, 499, 698, 671, 1511, 1026, 1100, 1510]]

After removal of max an min values the population is:

[[1241, 1398, 1247, 1465, 1328, 825, 1161, 1418], [820, 614, 1299, 1304, 938, 1297], [856, 772, 768, 1396, 625, 1159, 1305, 1152, 1311, 1098, 1336, 1048, 1000], [975, 883, 1568, 1485], [1025, 1424, 971, 698, 671, 1026, 1100, 1510]]

Adjusted number of scores counted is:

39

Adjusted total value of all scores counted is:

43517

Adjusted average of all scores is:

1115.820512820513

>>>

Done in Python Format please. Other codes provided for this question on here were not correct

Solutions

Expert Solution

import random

population=[]

for i in range(5):

sample=[]

n=random.randint(5,10)

print n

for num in range(n):

sample.append(random.randrange(400,1600))

population.append(sample)

print "population is:",population

print "total number of scores:",len(population)

def sum(lst):

total = 0

for element in lst:

if (type(element) == type([])):

total = total + sum(element)

else:

total = total + element

return total

tot=sum(population)

print "Sum of all scores:",tot

avg=tot//len(population)

print "average of all scores:",avg

print "sample list is:",sample

sam_tot=sum(sample)

print "sample Sum is:",sam_tot

sam_avg=sam_tot//len(sample)

print "sample average:",sam_avg

while(sam_avg<avg):

sample.append(random.randrange(1000,1600))

sam_avg=sam_tot//len(sample)

print sample

def nested_remove(L, x):

if x in L:

L.remove(x)

else:

for element in L:

if type(element) is list:

nested_remove(element, x)

for i in range(5):

a=max(population[i])

nested_remove(population,a)

b=min(population[i])

nested_remove(population,b)

print "after remove min,max in each sample:",population

tot=sum(population)

print "Sum of all scores:",tot

avg=tot//len(population)

print "average of all scores:",avg

Hope this helpful
Kindly upvote please it will help ma alot and please dont downvote

THANK YOU IN ADVANCE


Related Solutions

SAT Score Analysis You have been asked to analyze SAT scores (which may be 400 -...
SAT Score Analysis You have been asked to analyze SAT scores (which may be 400 - 1600).   You will be analyzing a population (a list) which consists of a number of samples (lists) of student scores. Here is the code to generate the  population/samples:      import random   population=[]   for i in range(5):   sample = []   n = random.randint(5,10)   for num in range(n):   sample.append(random.randrange(400,1600))   population.append(sample)   The analysis should be conducted as follows:   ##calculate the total number of scores     ##calculate the total value...
SAT scores: Assume that in a given year the mean mathematics SAT score was 495, and...
SAT scores: Assume that in a given year the mean mathematics SAT score was 495, and the standard deviation was 111. A sample of 61 scores is chosen. Use the TI-84 Plus calculator. Part 1 of 5 (a) What is the probability that the sample mean score is less than 484? Round the answer to at least four decimal places. The probability that the sample mean score is less than 484 is? Part 2 of 5 (b) What is the...
Computation of z-scores and standardized scores You are a school psychologist and have been asked to...
Computation of z-scores and standardized scores You are a school psychologist and have been asked to administer a verbal intelligence test to a local senior high school English class to assess writing preparedness of the class. You have been given the mean (μ = 70) and population standard deviation (σ = 8) for the raw scores from this test. Based on the testing manual, you know that the developers of this assessment generate a standardized score using a predetermined mean...
You have been asked to write a report regarding who may receive freight. Analyze FIVE (5)...
You have been asked to write a report regarding who may receive freight. Analyze FIVE (5) principal parties to whom freight may be payable, when this would be the case and if there are any exceptions
Critical reading SAT scores are distributed as N(480, 99). Find: a) Find the SAT score at...
Critical reading SAT scores are distributed as N(480, 99). Find: a) Find the SAT score at the 75th percentile b) Find the SAT score at the 25th percentile
You are the CFO for a 400-bed hospital in your community. You have been asked to...
You are the CFO for a 400-bed hospital in your community. You have been asked to present information to the local business organization on financial information and its importance to the stability of any business. You have been presented a list of questions from the group to answer in your presentation: What is the importance of financial information to the hospital? Who are the various users of the hospital financial information and how is the information used in healthcare decision...
Math SAT Scores (Raw Data, Software Required): Suppose the national mean SAT score in mathematics is...
Math SAT Scores (Raw Data, Software Required): Suppose the national mean SAT score in mathematics is 520. The scores from a random sample of 40 graduates from Stevens High are given in the table below. Use this data to test the claim that the mean SAT score for all Stevens High graduates is the same as the national average. Test this claim at the 0.10 significance level (a) What type of test is this? This is a left-tailed test.This is...
28. SAT Scores the average national SAT score is 1019. If we assume a bell-shaped distribution...
28. SAT Scores the average national SAT score is 1019. If we assume a bell-shaped distribution and a standard deviation equal to 110, what percentage of scores will you expect to fall above 1129? Above 799? Source: New York Times Almanac. 28th Question Solution: 16%; 97.5% For above 1129: 16% For above 799: 97.5% Why? please someone send me from where 16% and 97.5% came from?
Math SAT Scores (Raw Data, Software Required): Suppose the national mean SAT score in mathematics is...
Math SAT Scores (Raw Data, Software Required): Suppose the national mean SAT score in mathematics is 520. The scores from a random sample of 40 graduates from Stevens High are given in the table below. Use this data to test the claim that the mean SAT score for all Stevens High graduates is the same as the national average. Test this claim at the 0.10 significance level. (a) What type of test is this? This is a left-tailed test. This...
imagine you are a business consultant to ExxonMobil and you have been asked to analyze, advise,and...
imagine you are a business consultant to ExxonMobil and you have been asked to analyze, advise,and create recommendations on how the firm can ensure its future success in it's current market. prepare a minimum of 1050 word analysis of economic data and business data to explain how the core economic principles impact the sustainability of the firm and what actions the firm can take to ensure success. address the following: •identify the market structure of ExxonMobil operates in, analyze its...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT