Difference between revisions of "SP18:Lecture 5 Functions"
(→tables) |
(→Proof techniques continued) |
||
Line 7: | Line 7: | ||
= Proof techniques continued = | = Proof techniques continued = | ||
− | + | == There exists x such that P == | |
+ | |||
+ | == If P then Q == | ||
+ | |||
+ | == Logical negation == | ||
+ | |||
+ | == Table of proof techniques == | ||
= Functions = | = Functions = |
Revision as of 14:24, 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
There exists x such that P
If P then Q
Logical negation
Table of proof techniques
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.