Computing the median of a set of sorted numbers

Assignment Help Applied Statistics
Reference no: EM132293841

Assignment - Statistics of a sorted data set in MARIE

This task will require you computing the median of a set of sorted numbers. We will break it down into small steps for you. Most of the tasks require you to write code and test cases. The code must contain comments, and you must submit it as .mas files together with the rest of your assignment. The test cases should also be working, self-contained MARIE assembly files.

1.1 Inputting a list of numbers

The first step is to input a set of numbers (number-by-number, using the Input instruction). You can assume that this will be a set of positive integers and that the last number given will be a zero. This means you can keep reading numbers until you receive a zero.

Setup code in MARIE which reads a set of positive integers and stores these as an array (contiguous block of memory). Do not include the 0 in the array; as you accept numbers you should keep track of the size and store this in a variable once all the reading is complete. Print the size of the array using the Output instruction to help you test that your program is correct.

1.2 List input subroutine

Extend your list input so that it can be used as a subroutine.

1.3 Checking t h e order

This part will require you to determining whether the given array is in order. Once you have an array of positive numbers, step through this array and store 1 in a variable inOrder where it is in ascending order or 0 otherwise. You should implement this as a subroutine which can be triggered once all the array values have been entered. You may like to display this variable for testing purposes.

1.4 Division by 2

Prepare a MARIE subroutine DIV which computes the quotient and remainder for dividing a number by 2. This can be done by the method of successive subtraction. The strategy is as follows:

1. accept a numerator N and divisor D

2. set quotient Q to zero

3. while N ≥ D...

  • increase Q by one
  • reduce N by D

4. N now holds the remainder and Q holds the quotient

1.5 Finding the Median

Once you know that the set of numbers are in order, find the middle value in the array to use as the median. Your DIV subroutine should help here. If there are two middle values (e.g. there are an even number of items) you should use the left of these as the median.

1.6 Complete Program

As a final step, combine all the previous subroutines into a program that does the following:

  • Let a user input a list of numbers using the subroutine from 2.2
  • Check whether or not that list is in order using your subroutine from 2.3
  • Find the median of this list of numbers using your subroutine from 2.5 (note this will also involve using your division by two subroutine from 2.4)
  • Output whether the list is in order (as a 0 or 1) and then the median if there is one

Files to be submitted:

1. Six MARIE files

2.1 InputtingList

2.2 InputtingListSubroutine

2.3 CheckingOrder

2.4 DivisionBy2

2.5 FindingMedian and

2.6 CompleteProgram

Reference no: EM132293841

Questions Cloud

Describe what you believe would be a day in the life : Describe what you believe would be a day in the life of one of these individuals. Examine whether this is a potential job for you. Why or why not?
Discuss the current business structure in detail : Submit a written profile on the company that you want to use for you marketing plan. Thoroughly describe the company's product line. Discuss their current.
Prepare an executive summary to accompany the report : Assume you work as a Research Analyst for McKinsey & Company. Your team recently completed a large research project on the status of data analytics.
Reflect on the categories of identity-based needs : Reflect on the categories of identity-based needs and think about how they relate to the conflict that you have selected.
Computing the median of a set of sorted numbers : Assignment - Statistics of a sorted data set in MARIE - This task will require you computing the median of a set of sorted numbers
Explain the target market : Explain the target market and the objective of the marketing campaign - Healthcare industry - Riverside Hospital in Virginia
How company will benefit by offering new product or service : This section should focus on providing a concise overview of your new product or service and how company will benefit by offering this new product or service.
Did you add value from your own professional : Did you provide several relevant references that helped make your points? Of course you can use the main MIT/Sloan case as a reference, but did you reach out.
What is the next step that should be taken in analyzing data : A researcher obtains an F value that is significant at the .01 level. What is the next step that should be taken in analyzing the data

Reviews

Write a Review

Applied Statistics Questions & Answers

  A researcher is interested in gender differences

A researcher is interested in gender differences in attitudes toward flying

  Testing hypotheses for means

Research Design and Statistical Design and the Skill Builder: Hypothesis Testing for Independent Samples t-test, which you can find by navigating back to your

  Find a necessary and sufficient condition on the parameters

Find a necessary and sufficient condition on the parameters for corr

  Frequency distribution

Accepting Manipulation or Manipulating

  Using the formula for a binomial probability distribution

Suppose x is a random variable with n=3 and p=.3, calculate the value of p(x), x=0,1,2,3, using the formula for a binomial probability distribution?

  Formulate the null and alternative hypotheses

Describe a normal distribution. What two parameters determine its location and shape and what proportion of trucks can be expected to travel between 80,000 and 120,000 kilometres in the year?

  What are the tax consequences of the share certificate

Advise John Jones of the tax consequences of Items 1 – 6, above. You should discuss what amounts would be included in his assessable income or, if any item is not assessable income, why that is so. Your answer should include a discussion of the follo..

  Explain the three frequency distributions

Below you see the SPSS-output from the Frequency-command. The first table shows univariate frequency distributions from each country. The three graphs are histograms for each country. We want you to explain the three frequency distributions and th..

  Analyze real and publically data set using SPSS software

This project will demonstrate your ability to analyze a real, publically available data set using SPSS software and to translate findings from SPSS

  Design forms that you would use to collect information

Design forms/questionnaire that you would use to collect information about (1) patient's severity of illness and (2) patient outcomes

  Find a point estimate of true proportion of all light bulbs

Find a point estimate of the true proportion of all light bulbs that last more than 500 hours. Find the critical value for ta/2 corresponding to n = 12.

  Quantitative analysis for decision making assignment

Graphical Solutions in Linear Programming have limited number of decision variables. What is the maximum number of decision variables used in graphical solutions?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd