Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. (10 pts. Removing outliers from a data set is a key preprocessing step when applying statistical technqiues in data science. The algorithm REMOVEOUTLIERS takes

image text in transcribedimage text in transcribed

5. (10 pts. Removing outliers from a data set is a key preprocessing step when applying statistical technqiues in data science. The algorithm REMOVEOUTLIERS takes as input an array A of n numbers and a positive number c and outputs a sorted/ordered list L of the numbers in A excluding outliers, where an outlier is defined as a number which deviates more than a factor c from its average u of the numbers in A, relative to the standndard deviation o of the numbers in A. It uses several auxiliary functions. The functions MEAN and STD both take as input an array of n numbers and output the average and standard deviation of those numbers, respectively. Assume that they both run in linear time and use a constant amount of space. The function FINDBETWEEN extract all the elements of an array A of n numbers that are larger than a given value r and smaller than another given value y, all given as input, and returns the elements in A that are in that range usig a sorted ordered list data structure. Algorithm 3 REMOVEOUTLIERS(A,C) 1: + MEAN(A) 2: O + STD(A) 3: return FINDBETWEENA,- c*0,4 +c*o) (a) Provide an efficient algorithm, in pseudcode, for the function FINDBETWEEN described above: complete the step-by-step by writing down the missing statements, already started for you below. Assume that you have available an implementation of the sorted- list ADT which includes the method INSERT which, taking as input an element, inserts the element in the proper position in the sorted list, and does so in linear time and constant space. (Make sure to use indentation to clearly indicate the proper scope of each statement.) Algorithm 4 FIND BETWEEN(A, 2, y) 1: L new sorted list initially empty return L (b) Give the tightest/best possible time and space characterization, Big-Oh, Big-Theta, or Big-Omega, in terms of n, of the algorithm FINDBETWEEN. Justify your answer. Assume the implementation of the insert operation takes time linear in the size of the sorted list and uses a constant amount of space. (c) Give the tightest/best possible time and space characterization, Big-Oh, Big-Theta, or Big-Omega, in terms of n, of algorithm REMOVEOUTLIERS. Justify your answer. Assume the implementation of the insert operation takes time linear in the size of the sorted list and uses a constant amount of space

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

6. Describe to a manager the different types of distance learning.

Answered: 1 week ago

Question

What is job rotation ?

Answered: 1 week ago

Question

3 How the market system answers four fundamental questions.

Answered: 1 week ago

Question

5 The mechanics of the circular flow model.

Answered: 1 week ago

Question

1 The difference between a command system and a market system.

Answered: 1 week ago