Difference between revisions of "SP18:Lecture 5 Functions"
(→drawings) |
(→tables) |
||
Line 43: | Line 43: | ||
| c || 1 | | c || 1 | ||
|} | |} | ||
− | This almost describes a [[function]]; the [[domain]] is clearly <math>\{a,b,c\}</math> (because if there were any other [[domain]] [[element]]s, <math>f</math> would not be a function); and the rule is clear. However, the [[codomain]] is not clear: is it <math>[[Enumerated | + | This almost describes a [[function]]; the [[domain]] is clearly <math>\{a,b,c\}</math> (because if there were any other [[domain]] [[element]]s, <math>f</math> would not be a function); and the rule is clear. However, the [[codomain]] is not clear: is it <math>[[Enumerated set|\{1\}]]</math>? Or <math>[[Enumerated set|\{1,2,3\}]]</math>? Or <math>[[ℕ]]</math>, or <math>[[ℝ]]</math>? When describing a function with a table, the codomain should be specified somewhere. |
Revision as of 10:00, 17 February 2018
We finished our list of proof techniques, adding implication ( ) and existentials ( ). We then defined functions and discussed some examples.
- Reading: MCS 4.3 — 4.5
- This material was covered in lectures 2 (modeling problems) and 4 (functions) in 2017sp.
- File:Lec05-board.pdf
Contents
Proof techniques continued
Functions
When giving a function, you must indicate the domain, the codomain, and an unambiguous rule giving an output for every input.
The output of a function is unambiguous if there is only one output for any input. It is especially important to check this when the input of the function can be written in different ways. For example, given by , , and is not unambiguous, because so it is not clear if or .
Specifying functions
When giving a function, you must indicate the domain, the codomain, and an unambiguous rule giving an output for every input. There are many, many ways to do this, as long as the output is clear. We gave a few examples during lecture:
direct specification
We can define the output of the function directly:
let domain and codomain of are both ; the image is .
be given by . Thedrawings
We can draw a function:
The domain of is , and the codomain of is .
We might also write this as
is given by , , and .tables
Another way to draw a function is with a table:
x | |
---|---|
a | 1 |
b | 1 |
c | 1 |
This almost describes a function; the domain is clearly (because if there were any other domain elements, would not be a function); and the rule is clear. However, the codomain is not clear: is it ? Or ? Or , or ? When describing a function with a table, the codomain should be specified somewhere.
function description
A function need not have an algorithm for constructing the output; a description of the output is also fine. For example, let
give, on input , the closing Dow-Jones Industrial average on day .Function examples
You can write a function in many different ways; the important thing is that the domain is clear, the codomain is clear, and the output is clear (and unambiguous).
direct specifications
We can define the output of the function directly:
let domain and codomain of are both ; the image is .
be given by . Thedrawings
We can draw a function:
The domain of is , and the codomain of is .
We might also write this as
is given by , , and .tables
Another way to draw a function is with a table:
x | |
---|---|
a | 1 |
b | 1 |
c | 1 |
This almost describes a function; the domain is clearly (because if there were any other domain elements, would not be a function); and the rule is clear. However, the codomain is not clear: is it ? Or ? Or , or ? When describing a function with a table, the codomain should be specified somewhere.