1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MrRa [10]
3 years ago
10

For this problem, you will write a function standard_deviation that takes a list whose elements are numbers (they may be floats

or ints), and returns their standard deviation, a single number. You may call the variance method defined above (which makes this problem easy), and you may use sqrt from the math library, which we have already imported for you. Passing an empty list to standard_deviation should result in a ZeroDivisionError exception being raised, although you should not have to explicitly raise it yourself.
Computers and Technology
1 answer:
Evgesh-ka [11]3 years ago
3 0

Answer:

  1. import math  
  2. def standard_deviation(aList):
  3.    sum = 0
  4.    for x in aList:
  5.        sum += x  
  6.    
  7.    mean = sum / float(len(aList))
  8.    sumDe = 0
  9.    for x in aList:
  10.        sumDe += (x - mean) * (x - mean)
  11.    
  12.    variance = sumDe / float(len(aList))
  13.    SD = math.sqrt(variance)
  14.    return SD  
  15. print(standard_deviation([3,6, 7, 9, 12, 17]))

Explanation:

The solution code is written in Python 3.

Firstly, we need to import math module (Line 1).

Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).

We can test the function using a sample list (Line 20) and we shall get 4.509249752822894

If we pass an empty list, a ZeroDivisionError exception will be raised.

You might be interested in
Write a function named average_value_in_file that accepts a file name as a parameter and reads that file, assumed to be full of
noname [10]

def average_value_in_file(filename):

   f = open(filename)

   total = 0

   count = 0

   for x in f.read().splitlines():

       total += int(x)

       count += 1

   return total/count

print(average_value_in_file("input.txt"))

I used an input file that looks like this:

1

1

1

1

6 0
3 years ago
Soldering is a method of
babymother [125]

Answer:

Is a process in which two or more metal items are joined together by melting

Explanation:

: )

4 0
3 years ago
Read 2 more answers
Point out the wrong statement :
hoa [83]

Answer:

d. None of the mentioned

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

Cloud computing comprises of three (3) service models and these are;

1. Platform as a Service (PaaS).

2. Infrastructure as a Service (IaaS).

3. Software as a Service (SaaS).

All of the following statements are true and correct because they are standard internet protocols;

I. Virtual appliances are becoming a very important standard cloud computing deployment object. This depicts the Platform as a Service (PaaS).

II. Cloud computing requires some standard protocols.

III. Cloud computing relies on a set of protocols needed to manage interprocess communications.

8 0
3 years ago
What pattern is a heart-shaped pattern that captures sound from a single direction, ?from the front?
STatiana [176]

Answer:

The pickup diagram for the Cardioid (heart-shaped) microphone pattern tells you is that the microphone is most sensitive to sound coming in from the front (where the blue arrow is), and will tend to “refuse” sound coming in from the other side (the red arrow points to that part).

Explanation:

5 0
3 years ago
You're designing a user manual for a smartphone. You would like to set up a navigation scheme that is user friendly throughout t
Sophie [7]
I would make a straight forward one

8 0
3 years ago
Read 2 more answers
Other questions:
  • When forced distribution is used to reduce leniency bias, this can cause __________ if a pfp system is in place?
    10·1 answer
  • A personal computer system is composed of the processing unit, graphics board, and keyboard with reliabilities of 0.976, 0.785,
    8·1 answer
  • Many people describes computers as complex machine. what can this mean?
    8·1 answer
  • Which of the following could have a negative impact a planned route?
    6·1 answer
  • What do you understand by structured programmingapproach? Also Discuss about bottom up and top down approach.
    8·1 answer
  • Gina is driving her car down the street. She has a teddy bear sitting on the back seat. A dog runs in front of Gina's car, so sh
    15·2 answers
  • The National Institute of Standards and Technology (NIST) guidelines list four different states a mobile device can be in when y
    7·1 answer
  • What is the difference between spyware and adware?
    8·2 answers
  • You want to send an email to members of your team working on a school project. In which field would you put the email addresses
    13·1 answer
  • ASSIGNMENT FORM 2 1. Evaluate the following without using mathematical tables 0.36 x 6(142 +58) 21.44 - 10.64​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!