Revisiting the Function at the Shopping Junction Yojana Sharma • Function -----------idea of dependence. • A picnic or a barbecue is a function of the weather. • My presenting at AMATYC is a function of the college approving the funds for my travel and other expenses. Shopping • A function is a relationship between two quantities. These could be food items or household items. • Set X Rule Set Y (1-1 function) • Cake Frosting Cereal Milk Laundry Fabric Detergent Softener If you are a fussy shopper do you lose the function? Tea Honey Lemon Cereal Milk Raisins Laundry Fabric detergent Softener Bleach Is this a function? If yes, is it 1-1? • Set X Rule Set Y Cereal Milk Coffee Pasta Sauce Pasta Peanut Butter Bread Jelly Standard Teaching Concept • Think of the function as a machine that receives an input and throws out an output. f A B Input x Output y or f(x) This helps to distinguish between x (the argument) , f(function) and f(x) (output). • But it does not clearly distinguish between B and f(A), the image of f or explain the concept of onto and 1-1 function. • Think of the function as a bow. quiver bow target A . • Each object in A is represented by an arrow in the quiver. • The function f is the bow. • It “shoots” the arrow x into the target B , hitting the spot f(x). • The collection of all spots hit by an arrow from A is called the image of f, f(A) • If every spot on the target is hit by an arrow, f is onto function. • If no spot gets hit by more than one arrow, f is 1-1 function. Assumption: Archer never misses the target and arrows dissolve after impact, so it is possible for many arrows to hit the same spot. • The standard definitions of relation and function can now be introduced. • Relation: correspondence between two sets; first set is Domain, second set is Range; members of the set are called elements. • Function: a relation where each element of the first set corresponds to exactly one element in the second set. Concept of relation as a set of ordered pairs • (cereal, milk), (coffee, milk), (pasta sauce, pasta), (cheese , pasta), (peanut butter, bread), (jelly, bread). • This is a function but not 1-1. • Now replace food and household items with numbers. • Make up shopping example f(x) = x2 f is 1-1 function 1 1 2 4 3 9 f(x) = + or -√x f is not a function 1 1 -1 4 2 9 -2 3 -3 f(x) = x2 f is a function -1 1 1 but is not 1-1 -2 4 2 It is onto function -3 9 3 since range is the entire set. Composition of functions • Garments section: Sales rack of clothes: A skirt costing $100 is on discount at 25% and under clearance you are asked to take off an additional 15% off the sale price. How much will you pay? Composition of functions continued: • Common mistake is to add 25%+15%=40% and assume you will pay 100 - 40 = $60 for the skirt. • If you know how to do the math you would first do 25% of 100 =25 which would give you $75 after discount. Then you would do 15%of 75= 11.25. So you would actually pay 75-11.25 = $63.75! The “fog function” What we did in the last slide was composition of functions. It is a function of a function. One function takes an output(original price $100) and maps it to an output(sale price $75). Another function takes this output as its input(sale price $75) and maps it to an output(checkout price $63.75) • x f(g(x)) g(x) Domain of g Range of g Add. • (original price) Sale price 25% 15% off original price off sale price x corresponds to original price of each item on rack. Clothes markdown is 25%. g(x) = 0.75x represents the price after markdown. Because of clearance, an additional 15% off this price. So f(g(x)) = 0.85g(x), the checkout price for that item. Let x = $100 g(x) = 0.75(100) = $75 f(g(x)) = 0.85(75) = $ 63.75 The textbook definition of composite functions is (fog)(x) = f(g(x)) Textbook definition of domain of fog • It is the set of all real numbers x in the domain of g such that g(x) is also in the domain of f. This definition is hard for students to comprehend. • Think in terms of “filters” • There are two filters that allow certain values of x into the domain. • The first filter is g(x).If x is not in the domain of g, it cannot be in the domain of (fog)(x). Out of the values for x that are in the domain of g(x) , only some pass through because we restrict the output of g(x) to values that are allowable as input into f. x This adds an additional filter. g(x) f(g(x)) (fog)(x) = f(g(x)) Example 1 • f(x) = x+1, g(x) = 1/x • fog(x) = f(g(x)) = f(1/x) = 1/x +1 • Domain of g is all real numbers except 0. What is not in the domain of g, cannot be in the domain of fog. So x=0 is filtered out. • Domain of fog is all real numbers except x = 0. Example 2 f(x) = 2/(x+1), g(x) = 1/x fog(x) = f(g(x)) = f(1/x) = 2/(1/x +1)=2x/(1+x) x=o is not in the domain of g and so is filtered out. Also x= -1 is in the domain of g but it is not in the domain of f. So it is filtered out as well because we restrict the output of g(x) to values that are allowable as input into f and -1 is not allowable. Therefore domain of fog is all real numbers except 0, -1. Example 3: f(x) = √(x-3), g(x) = 2-3x Find fog and its domain. Piece-wise defined functions • Functions defined in terms of pieces. • Continuous- you can draw the graph of a function without picking up the pencil. • Discontinuous- cannot do the above; graph has holes and /or jumps. Shopping example of a piecewise defined function that is discontinuous • Let’s visit the “T- Shirt Shop” in the shopping junction whose slogan reads “ Come to the T-Shirt Shop where picking out a t-shirt requires a lot less effort ! ” A sorority representative who wants to order custom –made T shirts for the sorority is given the following deal by the T-shirt shop. If she orders 50 or less T-shirts, the cost is $10 /shirt, If she orders more than 50 but less than or equal to100, the cost is $9 /shirt. If she orders more than 100, the cost is $8/shirt. What is the cost function C(x) as a function of the number of T- shirts ordered, that is x? C(x) = $ 10x if 0 < x ≤ 50 C(x) = $ 9x if 50 < x ≤100 C(x) = $ 8x if x > 100 y Piecewise discontinuous function x 0 50 100 150 Application of Inverse Functions A store employee at the shopping junction makes $7 per hour and the weekly number of hours worked per week, x, varies. If the store withholds 25% of his earnings for taxes and social security, what function f(x) expresses his take home pay each week? Also what does the inverse function f-1(x) tell you? f(x) = 5.25 x because $7- 25% of $7 = $5.25. Interchanging x and y and solving for y gives f-1 (x) = y = x / 5.25 the inverse function tells you how many hours the employee will have to work to bring home $ x . • I am done with shopping for groceries and I am standing at the supermarket checkout. A scanner records prices of the foods I bought. Protection of consumers • Scanning law for Michigan state: If there is a discrepancy between the price marked on the item and the price recorded by the scanner, the consumer is entitled to receive 10 times the difference between these prices. This amount must be at least $1and at most $5. Also the consumer will be given the difference between the prices in addition to the amount calculated above. For example, if the difference is 5 cents, you should get $1( since 10x5 = 50 cents and you must get at least $1) + the difference of 5 cents. So you should get $1.05. If the difference is 25 cents, then 10x25 = $2.50 cents, so you would get 2.50 + 0.25 =$ 2.75 Inquiry Problem: a) What is the lowest possible refund? b) Suppose x is the difference between the price scanned and the price marked on the item and y is the amount refunded to the customer, write a formula for y in terms of x. Problem continued c) What would the difference between the price scanned and the price marked have to be in order to obtain a $ 9.00 refund? d) Graph y as a function of x. To function or not to function? That is the question! “shopkeeper mathematics” was the important focus from 1930s to 1950s” The Comprehensive School mathematics Program (1975) advocated that functions be used as the main avenue through which variables and algebra are introduced. The function concept is the fundamental concept of algebra.