Presentation is loading. Please wait.

Presentation is loading. Please wait.

Functions CSLU 1100.003 Fall 2007 Cameron McInally Fordham University.

Similar presentations


Presentation on theme: "Functions CSLU 1100.003 Fall 2007 Cameron McInally Fordham University."— Presentation transcript:

1 Functions CSLU Fall 2007 Cameron McInally Fordham University

2 Functions Functions have 4 parts – Name : Usually one letter long. – Domain : A set of values – Codomain : Another set of values – Rule : Maps the values in the Domain set to the values in the Codomain set.

3 Functions Function definition This is read, “function f maps the elements of set A [a.k.a. domain] to the elements in set B [a.k.a. codomain].

4 Functions An example function definition: – Domain: {1, 2, 3} – Codomain: {5, 6, 7, 8} – Rule: {(1, 5), (2, 6), (3, 8)}

5 Functions Mapping values between sets Mapping values between sets – lasses/summer06/cseu1100/flash/ch4/ sec4_1/arrowdiagrams.html

6 Functions Rules can also be written in the following style – f(a) = a + 4 – g(b) = b * b + 2 – h(c) = 5 These would read – “f of a equals a plus 4” – “g of b equals b times b plus 2” – “h of c equals 5”

7 Functions When we see rules we often ask what their value might be when given concrete values. Take the formula from the previous page f(a) = a+4 What is its value when a equals 7? Answer: 11 Why? F(7) = = 11

8 Functions Try it… f(x) = 2x + 3 g(y) = 7 f(5) = f(8) = f(-4) = g(5) = g(8) = g(-4) =

9 Functions A function is a way that the three of the components (domain, codomain and rule) are related. A function takes a value from the domain, applies the transformation from the rule, and produces a value in the codomain. Let’s take a look…

10 Functions Suppose I define my domain to be {1, 2, 3} And I define my Codomain to be {5, 6, 7, 8} And my formula is f(x) =x + 5 Is this a function? – To find out, be very meticulous and walk through each value of the domain

11 Let me try the value 1. f(1) = 1+ 5 = 6 – Hey and 6 is in my Codomain. So far it’s working Let me try the value 2. f(2) = = 7 – 7 is in my Codomain. It is still working Let me try the value 3. f(3) = = 8 – 8 is in my Codomain. It is still working I have tried all values in my domain, and they all worked. Therefore this is a function Domain = {1, 2, 3} Codomain = {5, 6, 7, 8} f(x) = x + 5

12 Try this one, its almost identical. Taking 1 from the domain works Taking 2 from the domain works Taking 3 from the domain fails. – Why? It produces the value 8. This value is no longer part of my Codomain. So therefore this example is not a function Domain = {1, 2, 3} Codomain = {5, 6, 7} f(x) = x + 5

13 Ok, begin the same way (take values from the domain and put them in the formula) Choose 0. f(x) = 5 … it’s in the Codomain Choose 1. f(1) = 6 … it’s in the Codomain Choose -1. f(-1) = 4... it’s in the Codomain So, we can check all the values to see if this is a function!!! Domain = Z (all integers) Codomain = Z (all integers) f(x) = x + 5 So wrong! There are an infinite number of values.

14 Functions Sometimes you can’t try all values in the domain because its infinite. So you need to look for values that might not work and try those. If you can’t find any domain values that don’t work, can you make an argument that all the domain values do work? Sometimes proving the argument can make you millions of $$$. This one is up for grabs right now…

15 Hand waving – “Regardless of what integer I take from the domain, I can add 5 to that number and still have a value in the Codomain.” Convince yourself of this. Search the web for “Grand Hotel” by Hilbert. This story might be easier to understand. Thomas Aquinas attempted to prove the existence of God through a similar principle. Domain = Z (all integers) Codomain = Z (all integers) f(x) = x + 5

16 Ok choose some values – Choose 0: f(0) = – Choose 1: f(1) = – Choose -1: f(-1) = Domain = Z (all integers) Codomain = {4, 5, 6} f(x) = 6 6 … it works It always works… so it is a function

17 Functions Two properties of functions… – Functions can have up to two different and very interesting properties. A function can be onto A function can be one-to-one In order to have one of these properties, it first must be a function. If it is not a function than these properties are irrelevant

18 Functions Onto Functions – Each value in the Codomain can be produced by at least one value in the Domain. – Conversely, if a value in the Codomain cannot be produced by any value in the Domain, the function is not onto.

19 If you want to know whether this is onto first you have to figure out if it is a function or not. Choose 1: f(1) = 11 Choose 2: f(2) = 12 Choose 3: f(3) = 13 Choose 4: f(4) = 14 So it definitely is a function because every domain value took us to a value in the Codomain Is it onto? Yes. Because we covered all of the Codomain values in our computations. Domain = {1, 2, 3, 4} Codomain = {11, 12, 13, 14} f(x) = x + 10

20 Determine whether it is a function Choose 1: f(1) = 0 Choose 2: f(2) = 1 Choose 3: f(3) = 2 So it is a function. Is it onto? No, we never arrived at the value 3 which is in the Codomain Domain = {1, 2, 3,} Codomain = {0, 1, 2, 3} f(x) = x -1

21 Is it a function? Choose 1: f(1) = 5 Choose 2: f(2) = 5 Choose 3: f(3) = 5 So it is a function Is it onto? Yes. We reached every value in the Codomain Domain = {1, 2, 3,} Codomain = {5} f(x) = 5

22 Functions One-to-one functions – Only one value in the Domain can reach one particular value in the Codomain. – Conversely, if there are two values in the Domain that point to one value in the Codomain, then it is not a one-to-one function.

23 So we must ask if it is a function? Choose 1: f(1) = 2 Choose 2: f(2) = 3 Choose 3: f(3) = 4 So it is a function. Is it one-to-one? Well – we only reached the value 2 by using x = 1. – we only reached the value 3 by using x = 2. – we only reached the value 4 by using x = 3. So it is one-to-one Domain = {1, 2, 3,} Codomain = {1, 2, 3, 4} f(x) = x + 1

24 Is it a function? – Choose 1: f(1) = 5 – Choose 2: f(2) = 5 – Choose 3: f(3) = 5 Is it one-to-one? – No, because we reached the value 5 in three different ways. Domain = {1, 2, 3,} Codomain = {5} f(x) = 5

25 Is it a function? – f(-2) = 4 – f(-1) = 1 – f(0) = 0 – f(1) = 1 – f(2)=4 So it is a function Is it one-to-one? – No. We can reach the value 4 in two ways. Domain = {-2, -1, 0, 1, 2} Codomain = {0, 1, 2, 3, 4, 5, 6} f(x) = x*x

26 Is it a function? Is it onto? Is it one-to-one? If it has all of these properties then we call it a bijection. Any function that is a bijection has an inverse that we can compute. Domain = {2, 4, 6, 8} Codomain = {4, 8, 12, 16} f(x) = 2x

27 Functions The inverse of a function is another function that reverses the process of the original function. To create an inverse 1.Make the old Codomain the new domain 2.Make the old domain the new Codomain 3.Swap the f(x) and the x in the formula 4.Use algebra to get the f(x) back by itself

28 1.New domain = {4, 8, 12, 16} 2.New Codomain = {2, 4, 6, 8} 3.To compute the new formula reverse the f(x) and the x x = 2f(x) 4.Then solve for f(x) Domain = {2, 4, 6, 8} Codomain = {4, 8, 12, 16} f(x) = 2x f(x) = x / 2 … so that is our inverse

29 Functions Function Composition ( ) – Chains together two functions. – f ◦ g which reads “f compose g”. – The result of the second function is passed as the argument to the first function.

30 What is f ◦ g ? What is g ◦ f? What is f ◦ f? What is g ◦ g ? What is f ◦ g for g(2)? Assume we have two functions with Domains and Codomains over all integers… f(x) = 3x – 2 g(x) = x * x f(x*x) = 3(x*x)-2 = 3x 2 -2 g(3x-2) = (3x-2)*(3x-2)=9x 2 -12x+4 f(3x-2) = 3(3x-2)-2 = 9x-8 g(x*x) = (x*x) * (x*x) = x 4 f(g(2)) = f(4) = 3(4) – 2 = 10 f(g(2)) = f(4) = 3(4) – 2 = 10

31 Always Due in One Week Homework (Always Due in One Week) Read Section 7.1 to Complete Section 7.8 pages 137- : 1 (a-e), 2(a-d) Functions


Download ppt "Functions CSLU 1100.003 Fall 2007 Cameron McInally Fordham University."

Similar presentations


Ads by Google