GRAPHS Professor Karen Leppel Economics 202 Upward-sloping lines Example 1: DIETING Consider your weight and the number of calories you consume per day. Suppose the following relation holds. calories -------1000 1100 1200 1300 1400 weight -----140 150 160 170 180 weight Graph of Weight and Calories 180 170 160 150 140 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories weight Graph of Weight and Calories 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 140 150 160 170 180 1000 1100 1200 1300 1400 calories Your weight depends on the number of calories you consume. Your weight is the dependent variable, and the number of calories consumed is the independent variable. The dependent variable, generally denoted by Y, is on the vertical axis. The independent variable, generally denoted by X, is on the horizontal axis. your calories your weight your calories your weight The number of calories and your weight move in the same direction. So when looking from left to right, we see a line that slopes upward. This is called a positive or direct relation. calories calories calories 100 100/100 1 weight 10 weight 10/100 weight 1/10 = .1 The number .1 is the slope. The slope is calculated as the change in the Y variable divided by the change in the X variable = D Y/ D X = 10/100 = .1 The slope formula is also sometimes expressed as the "rise" over the "run." It is the distance the line “rises” in the vertical direction divided by the distance it “runs” in the horizontal direction. weight 180 slope = rise/run = 10/100 = 1/10 170 160 150 rise = 10 run = 100 140 1000 1100 1200 1300 1400 calories Theoretically, we can determine what you would weigh if your calories were zero. According to the pattern, your weight would be 40 pounds. calories 1000 900 800 700 600 500 400 300 200 100 0 weight 140 130 120 110 100 90 80 70 60 50 40 The number 40 is the value of the Y-intercept. You can also find this number, by drawing the graph and extending the line to the vertical axis. The Y-intercept tells you the value of the Y variable (weight) when the value of the X variable (calories) is zero. weight 180 170 160 150 140 y-intercept 40 0 1000 1100 1200 1300 1400 calories Equation of a Line: Slope-Intercept Form Recall that the equation of a line can be written as Y= mX + b, where X is the independent variable, Y is the dependent variable, m is the slope of the line, and b is the vertical intercept. In our example, the independent variable (X) is calories, the dependent variable (Y) is weight, the slope (m) is 0.1, and the vertical intercept (b) is 40. So the equation of this line is weight = 40 + 0.1 * calories . Downward Sloping Lines Example 2: RUNNING Suppose that the more rested you are, the faster you can run. So the more hours you sleep, the fewer minutes it takes you to run a mile. Suppose the relation between hours slept per day and the number of minutes it takes you to run a mile is as follows. hours slept minutes per mile 6 8 7 7 8 6 9 5 10 4 min./mile hrs 6 7 8 9 10 8 7 6 5 min/mi 8 7 6 5 4 4 0 1 2 3 4 5 6 7 8 9 10 hrs. slept/day hrs 6 7 8 9 10 min/mi 8 7 6 5 4 What is the slope of the relation? slope = D Y/ D X = D min/ D hrs = -1/+1 = -1 A positive change denotes an increase. A negative change denotes a decrease. When the amount of sleep increases, minutes needed to run a mile decrease. When the amount of sleep decreases, minutes needed to run a mile increase. The variables move in opposite directions. This type of relation is called a negative or inverse relation. Negative or inverse relations are downward sloping from left to right. Downward sloping lines have a negative slope. Positive or direct relations are upward sloping from left to right. Upward sloping lines have a positive slope. Y X Y X What is the Y-intercept for this relation? It is the number of minutes needed to run a mile, when the amount of sleep is zero. You need one more minute to run the mile, for each hour less of sleep you get. We know it takes 8 hours slept min/mile minutes to run a mile 6 8 when you have had 6 5 9 hours of sleep. We can work down from there. 4 10 So when the number of 3 11 hours slept is zero, you 2 12 need 14 minutes to run the mile. 1 13 The number 14 is the Y0 14 intercept. min./mile 15 12 9 You can also find the intercept by extending the line in the graph to the vertical axis. The Y-intercept tells the value of the Y variable (minutes needed to run a mile) when the value of the X variable (hours y-intercept slept) is zero. 6 3 hrs. slept/day 0 1 2 3 4 5 6 7 8 9 10 Given that for this example, the independent variable is hrs slept, the dependent variable is minutes per mile, and we found that the slope is -1 and the intercept is 14, what is the equation of the relation? min per mile = 14 + (-1) * hrs slept or min per mile = 14 - 1 * hrs slept Remember that multiplication and division take precedence over addition and subtraction. So you multiply first and then subtract. So the right side of this equation is not 13 * hrs slept . Horizontal Lines Example 3: DIETING Suppose that no matter how many or how few calories you consumed, your weight stayed the same. Suppose, in particular, the following relation holds. calories weight 1000 180 1100 180 1200 180 1300 180 1400 180 weight 180 170 160 150 140 calories 1000 1100 1200 1300 1400 weight 180 180 180 180 180 1000 1100 1200 1300 1400 calories Y Notice that Y never changes. 180 X slope = D Y/ D X = 0/D X = 0 The slope of a horizontal line is zero. In this relation, your weight would remain at 180 even if you consumed zero calories. So the Y-intercept is 180. Given that for this example, the independent variable is calories, the dependent variable is weight, and we found that the slope is 0 and the intercept is 180, what is the equation of the relation? weight = 180 + 0 * calories or weight = 180 Vertical Lines Example 4: DIETING Suppose that you always consumed the same number of calories. Your weight varied with other factors, such as exercise and stress. Suppose, in particular, the following relation holds. calories weight 1100 140 1100 150 1100 160 1100 170 1100 180 weight 180 170 calories weight 1100 140 1100 150 1100 160 1100 170 1100 180 160 150 140 40 0 1000 1100 1200 1300 1400 calories wgt 1100 calories Even though we don't change calories (the X variable), weight (the Y variable) does change. The slope, which is D Y/ D X, is a non-zero number divided by zero. Thus, the slope is infinity or undefined. The slope of a vertical line is infinity or undefined. There is no Y-intercept. Since for a vertical line, the slope is undefined and there is either no intercept or an infinite number of intercepts, the equation of a vertical line is not written in the slope-intercept form. Instead it is written as: X = X0 , where X0 is the constant value of the independent variable. For our example, the equation is calories = 1100 . We will next consider Nonlinear Relations We will not be putting these relations in the form Y = mX + b. That equation only applies to straight lines. For curves, the slope is not constant; instead it changes from point to point. Example 5: DIETING - It keeps getting tougher. - The heavy person's perspective Consider your weight and the number of calories you consume per day. Suppose that you're trying to lose weight. If you reduce your intake from 1400 to 1300 calories, your weight drops 10 pounds. calories 1000 1100 1200 1300 1400 weight 162 163 165 170 180 When you reduce your intake from 1300 to 1200 calories, your weight only drops 5 pounds. calories 1000 1100 1200 1300 1400 weight 162 163 165 170 180 calories 1000 When your reduce your 1100 intake from 1200 to 1100 1200 calories, your weight drops 1300 just 2 pounds. 1400 weight 162 163 165 170 180 weight 180 175 170 165 160 1000 1100 1200 1300 1400 calories We now do not have a straight line (linear) relationship. Instead the relation is curved. This reflects a changing slope. Recall, the slope is the change in the Y-variable (wgt) divided by the change in the X-variable (calories). calories 1000 wgt 162 D wgt 1 1100 163 2 1200 165 5 1300 170 10 1400 180 calories 1000 1100 1200 1300 1400 wgt 162 D wgt slope=Dwgt/Dcal 1 .01 2 .02 5 .05 10 .10 163 165 170 180 calories 1000 1100 1200 1300 1400 wgt 162 D wgt slope=Dwgt/Dcal 1 .01 2 .02 5 .05 10 .10 163 165 170 180 As calories increase, the slope increases; the curve gets steeper. The slope tells you the rate at which Y (weight) changes as X (number of calories) changes. Here your weight is increasing at an increasing rate. wgt calories This curve is upward sloping and convex from below. Since we don't know exactly what the relationship looks like as we get near zero calories, we can't determine precisely what the Y-intercept would be. Example 6: DIETING - It keeps getting tougher. - The thin person's perspective Consider your weight and the number of calories you consume per day. Suppose that you're trying to gain weight. If you increase your intake from 1000 to 1100 calories, your weight increases 10 pounds. calories 1000 1100 1200 1300 1400 weight 100 110 115 118 119 When you increase your intake from 1100 to 1200 calories, your weight only increases 5 pounds. calories 1000 1100 1200 1300 1400 weight 100 110 115 118 119 When your increase your intake from 1200 to 1300 calories, your weight increases just 3 pounds. calories 1000 1100 1200 1300 1400 weight 100 110 115 118 119 weight 120 115 110 105 100 1000 1100 1200 1300 1400 calories calories weight 1000 100 D wgt 10 1100 110 5 1200 115 3 1300 118 1 1400 119 calories weight 1000 100 1100 1200 1300 1400 D wgt slope=Dwgt/Dcal 10 .10 5 .05 3 .03 1 .01 110 115 118 119 calories weight 1000 100 1100 1200 1300 1400 D wgt slope=Dwgt/Dcal 10 .10 5 .05 3 .03 1 .01 110 115 118 119 As calories increase, the slope decreases; the curve gets flatter. Here your weight is increasing at a decreasing rate. This curve is upward sloping and concave from below. wgt calories Example 7: RUNNING Suppose again that the more rested you are, the faster you can run. For every extra hour of sleep you get, you shave some time off the number of minutes it takes to run a mile. Now, however, the amount you shave off gets smaller and smaller. hours slept minutes per mile 6 8.0 7 7.0 8 6.4 9 6.1 10 6.0 min./mile hrs 6 7 8 9 10 8.0 7.8 7.6 7.4 7.2 7.0 6.8 6.6 6.4 6.2 6.0 0 1 2 3 4 5 6 7 8 9 10 min/mi 8.0 7.0 6.4 6.1 6.0 hrs. slept/day hrs. slept 6 7 8 9 10 min. D min. 8.0 -1.0 7.0 - .6 6.4 - .3 6.1 - .1 6.0 hrs. slept 6 7 8 9 10 min. D min. slope=D min/D hrs 8.0 -1.0 -1.0 7.0 - .6 - .6 6.4 - .3 - .3 6.1 - .1 - .1 6.0 hrs. slept 6 min. 8.0 slope -1.0 7 7.0 - .6 8 6.4 - .3 9 6.1 - .1 10 6.0 As sleep increases, the absolute value of the slope decreases; the curve gets flatter. Here your number of minutes needed is decreasing at a decreasing rate. This curve is downward sloping and convex from below. min. per mile hrs. slept per day Example 8: MEDICINE Suppose that you're taking medication for a virus that you've contracted. The medication has the effect on the number of heartbeats per minute as indicated in the following graph. beats/min. med. beats/min 0 75 75 74 72 69 64 56 0 100 200 300 400 500 100 74 200 72 300 69 400 64 500 56 medicine (mg.) med. 0 beats 75 D beats -1 100 74 -2 200 72 -3 300 69 -5 400 64 -8 500 56 med. 0 100 200 300 400 500 beats 75 D beats slope = Dbeats/D med. -1 -.01 -2 - .02 -3 - .03 -5 - .05 -8 - .08 74 72 69 64 56 med. 0 beats 75 slope -.01 100 74 - .02 200 72 - .03 300 69 - .05 400 64 - .08 500 56 As medication increases the absolute value of the slope rises; the curve gets steeper. Here your heart rate is decreasing at an increasing rate. This pattern indicates that the effects of the medicine increase as you take more of it. This curve is downward sloping and concave from below. beats/min. medicine (mg.) Concave Picture the opening of a cave. If a curve looks like this or part of this, it is concave (from below). Convex If a curve looks like the letter U or part of a U, it is convex (from below).