Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Paragraph Introduction Descriptive statistics are quantities used for summarizing a data sample. Examples include the sample mean and the sample variance. Given a set of

image text in transcribed
image text in transcribed
Paragraph Introduction Descriptive statistics are quantities used for summarizing a data sample. Examples include the sample mean and the sample variance. Given a set of samples, .x2 h, the sample mean is 72 The (unbiased) sample variance is then defined as in certain applications (eg. real-time systems), it is important to be able to compute these quantities using an online algorithm. An online algorithm computes as the data is coming in, piece-by-piece, rather than waiting untl all the data is available. The advantage is that it doesn't have to store all the data up to the current time to compute the mean and variance. Rather, it can simply update those quantities based on the current m value. ost entered An online algorithm for computing the sample mean and variance starts with in-o and = 0, where are the sample mean and variance for n-0 points, respectfully. Then, for each new semple point, the quantities are updated using the following formulas: and Wete n is the number of values entered by user so far the current mean after the n- 1'th value was entered rn bs the updated mean after the n'th value is entered s-i is the variance after the n-1'th value was entered si is updated variance after the n'th value is entered Requirements You are to create a program using Python that asks the user for a nonnegative number, then computes the mean and variance using the above given online update formulas which should be displayed on the console screen. The program should end when a user enters a negative number Styles Additional Requirements 1. 2. 3. The name of your source code file should be onlinestats. py. All your code should be within a single file. Your code should follow good coding practices, including good use of whitespace and use of both inline and block comments You need to use meaningful identifier names that conform to standard naming conventions. 4. At the top of each file, you need to put in a block comment with the following information: your name, date, course name, semester, and assignment name. The output of your program should exactly match the sample program output given at the end. That is, 5. for same input, it should generate the same output. Note that I may use other test cases for grading your program and your code needs to work correctly in all cases The program needs to compute the mean and variance using the online algorithm. Thatis, you cannot store all the entered values in a list. Instead,just update the mean and variance for each new entered value using the update formulas 6

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

Design a training session to maximize learning. page 296

Answered: 1 week ago

Question

Design a cross-cultural preparation program. page 300

Answered: 1 week ago