<< Chapter < Page Chapter >> Page >

Exercise 2.2

Suppose you have set the goal of making an A in your math class. If your class grades consist of 4 tests, and you have made a 98, 80, and 90 on your first three tests, what do you need to make on your last test so that the mean of your grades is 90?

Exercise 2.3

(for the advanced) Suppose that, for the same class, you have already computed the mean of the first three tests when you receive your fourth test grade. Instead of computing the mean of all four tests from scratch, it's possible to update the mean that you've already computed. Write a Matlab code that takes two inputs, the mean of your first three tests and the grade of your fourth test, and computes the mean of all four tests.

Variance and standard deviation

As you saw in "Example 2.2" , the mean is not always representative of the data, and other measures are needed to analyze the spread of the data. The variance is a measure of the distance of each number from the mean. Given a vector x of n numbers and mean value x ¯ , the variance of x is given by

var ( x ) = 1 n - 1 k = 1 n ( x k - x ¯ ) 2 = ( x 1 - x ¯ ) 2 + ( x 2 - x ¯ ) 2 + . . . + ( x n - x ¯ ) 2 n - 1 .

The standard deviation of the data is related to the variance and is given by

std ( x ) = var ( x ) .

You can compute the variance and standard deviation of x in Matlab by typing the commands var(x) and std(x).

Example 3.1

Consider the vector given in "Example 2.1" , x = [1, 7, 2, 5, 9, 6]. Recall that the mean of x = 5.

var ( x ) = ( 1 - 5 ) 2 + ( 7 - 5 ) 2 + ( 2 - 5 ) 2 + ( 5 - 5 ) 2 + ( 9 - 5 ) 2 + ( 6 - 5 ) 2 5 = 9 . 2
std ( x ) = var ( x ) 3 . 03

Example 3.2

Consider the data from "Example 2.2" , where the mean x ¯ = 300. The variance is

var ( x ) = 16 · ( 100 - 300 ) 2 + 3 · ( 900 - 300 ) 2 + ( 1700 - 300 ) 2 13 193 , 684

and the standard deviation is

std ( x ) = ( var ( x ) ) 440

Because the standard deviation is considerably larger than the mean, the variance tells us that the mean is not very representative of the data.

Exercise 3.1

Compute the variance and standard deviation of y = [3, 8, 2, 5, 5, 7], using both the formulas and the Matlab commands.

Exercise 3.2

Suppose that in the situation of "Example 2.2" , there are 50 general exmployees instead of 16. Compute the mean and variance of the daily salary. Is the mean more or less representative of the data than it was in Example 2.2?

Histograms

Although the mean, variance, and standard deviation provide information about the data, it is often useful to visualize the data. A histogram is a tool that allows you to visualize the proportion of numbers that fall within a given bin, or interval. To compute the histogram of a set of data, x , follow the algorithm below.

  1. Choose the bin size Δ x . The bins are the intervals [0, Δ x ], ( Δ x , 2 Δ x ], (2 Δ x , 3 Δ x ], and so on.
  2. For each bin, count the number of data points that lie within the bin.
  3. Create a bar graph showing the number of data points within each bin.

Example 4.1

Consider again the vector from "Example 2.1" , x = [1, 7, 2, 5, 9, 6]. Using a bin size Δ x = 2, there are 5 bins.

  • Bin 1 = [0, 2] has 2 elements of x
  • Bin 2 = (2, 4] has 0 elements of x
  • Bin 3 = (4, 6] has 2 elements of x
  • Bin 4 = (6, 8] has 1 element of x
  • Bin 5 = (8, 10] has 1 element of x

In Matlab, you can plot the histogram of a vector x by typing hist(x). Matlab will automatically use 10 bins. If you'd like to specify the bin centers, type hist(x,c), where c is a vector of bin centers. The histogram of "Example 4.1" was generated by the Matlab command hist(x, [1, 3, 5, 7, 9]).

Exercise 4.1

Plot the histogram of the vector y = [3, 8, 2, 5, 5, 7], both on paper and in Matlab.

Exercise 4.2

Plot the histogram of the daily salaries from "Example 2.2" . For this example, does the histogram or the mean give you a better idea of what salary you would be making if you got the job?

Questions & Answers

differentiate between demand and supply giving examples
Lambiv Reply
differentiated between demand and supply using examples
Lambiv
what is labour ?
Lambiv
how will I do?
Venny Reply
how is the graph works?I don't fully understand
Rezat Reply
information
Eliyee
devaluation
Eliyee
t
WARKISA
hi guys good evening to all
Lambiv
multiple choice question
Aster Reply
appreciation
Eliyee
explain perfect market
Lindiwe Reply
In economics, a perfect market refers to a theoretical construct where all participants have perfect information, goods are homogenous, there are no barriers to entry or exit, and prices are determined solely by supply and demand. It's an idealized model used for analysis,
Ezea
What is ceteris paribus?
Shukri Reply
other things being equal
AI-Robot
When MP₁ becomes negative, TP start to decline. Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of lab
Kelo
Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of labour (APL) and marginal product of labour (MPL)
Kelo
yes,thank you
Shukri
Can I ask you other question?
Shukri
what is monopoly mean?
Habtamu Reply
What is different between quantity demand and demand?
Shukri Reply
Quantity demanded refers to the specific amount of a good or service that consumers are willing and able to purchase at a give price and within a specific time period. Demand, on the other hand, is a broader concept that encompasses the entire relationship between price and quantity demanded
Ezea
ok
Shukri
how do you save a country economic situation when it's falling apart
Lilia Reply
what is the difference between economic growth and development
Fiker Reply
Economic growth as an increase in the production and consumption of goods and services within an economy.but Economic development as a broader concept that encompasses not only economic growth but also social & human well being.
Shukri
production function means
Jabir
What do you think is more important to focus on when considering inequality ?
Abdisa Reply
any question about economics?
Awais Reply
sir...I just want to ask one question... Define the term contract curve? if you are free please help me to find this answer 🙏
Asui
it is a curve that we get after connecting the pareto optimal combinations of two consumers after their mutually beneficial trade offs
Awais
thank you so much 👍 sir
Asui
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities, where neither p
Cornelius
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities,
Cornelius
Suppose a consumer consuming two commodities X and Y has The following utility function u=X0.4 Y0.6. If the price of the X and Y are 2 and 3 respectively and income Constraint is birr 50. A,Calculate quantities of x and y which maximize utility. B,Calculate value of Lagrange multiplier. C,Calculate quantities of X and Y consumed with a given price. D,alculate optimum level of output .
Feyisa Reply
Answer
Feyisa
c
Jabir
the market for lemon has 10 potential consumers, each having an individual demand curve p=101-10Qi, where p is price in dollar's per cup and Qi is the number of cups demanded per week by the i th consumer.Find the market demand curve using algebra. Draw an individual demand curve and the market dema
Gsbwnw Reply
suppose the production function is given by ( L, K)=L¼K¾.assuming capital is fixed find APL and MPL. consider the following short run production function:Q=6L²-0.4L³ a) find the value of L that maximizes output b)find the value of L that maximizes marginal product
Abdureman
types of unemployment
Yomi Reply
What is the difference between perfect competition and monopolistic competition?
Mohammed
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, The art of the pfug. OpenStax CNX. Jun 05, 2013 Download for free at http://cnx.org/content/col10523/1.34
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'The art of the pfug' conversation and receive update notifications?

Ask