Difference between revisions of "SP18:Lecture 5 Functions"
From CS2800 wiki
(→Function examples) |
|||
Line 24: | Line 24: | ||
* another way to draw a function is with a table: | * another way to draw a function is with a table: | ||
− | {| | + | {|class="function" |
| x || <math>f(x)</math> | | x || <math>f(x)</math> | ||
|- | |- | ||
Line 33: | Line 33: | ||
| 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 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. | + | 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:45, 10 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
Proof techniques continued
Functions
Definition: Image
If image of (written ) is the set of values that are output by . Formally, or more succinctly, .
, then the Function examples
- we often draw functions:
The domain of is , and the codomain of is .
- 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.