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

  Hypothesis testing

What assumptions about the number of pedestrians passing the location in an hour are necessary for your hypothesis test to be valid?

  Calculate the maximum reduction in the standard deviation

Calculate the maximum reduction in the standard deviation

  Calculate the expected value, variance, and standard deviati

Calculate the expected value, variance, and standard deviation of the total income

  Determine the impact of social media use on student learning

Research paper examines determine the impact of social media use on student learning.

  Unemployment survey

Find a statistics study on Unemployment and explain the five-step process of the study.

  Statistical studies

Locate the original poll, summarize the poling procedure (background on how information was gathered), the sample surveyed.

  Evaluate the expected value of the total number of sales

Evaluate the expected value of the total number of sales

  Statistic project

Identify sample, population, sampling frame (if applicable), and response rate (if applicable). Describe sampling technique (if applicable) or experimental design

  Simple data analysis and comparison

Write a report on simple data analysis and comparison.

  Analyze the processed data in statistical survey

Analyze the processed data in Statistical survey.

  What is the probability

Find the probability of given case.

  Frequency distribution

Accepting Manipulation or Manipulating

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