home—info—lectures—exams—archive
hw06
function basics
Due 2008.Oct.15 (Wed).
- (2pts)
Rosen p.132, #50
(= Rosen 5ed p. 96 #40):
bit-string representation.
- (3pts)
Consider the function dorm,
which maps
an on-campus RU student to
their dorm-building1
For example, dorm(Jane Doe) = Muse.
-
Is this function one-to-one? Is it onto?
-
What if the codomain were all campus buildings, instead of just dorms --
would the function still be one-to-one? onto?
-
What
about the function dorm-bed, which maps RU on-campus students
to individual beds in the dorms.
Is this function one-to-one? Is it onto?
- (2pts)
Rosen p146, #2
(= Rosen 5ed p. 108 #2):
Is it a function from Z → ℜ?
(That is, if you put in an integer,
will you always get out exactly one corresponding real number?)
-
f(n) = ±n.
-
f(n) = √(n²+1).
(Recall that √ refers to the non-negative square root.)
-
f(n) = 1/(4-n²).
- (2pts)
Rosen p146, #8, parts a,c,e,g only
(= Rosen 5ed p. 108 #8a,c,e,g):
Ceiling, floor
-
⌊1.1⌋
-
⌊-0.1⌋
-
⌈3.0⌉
-
⌊0.5+⌈0.5+⌉⌋
- (2pts)
Rosen p146, #12
(= Rosen 5ed p. 108 #12):
one-to-one?
- f(n)=n-1
- f(n)=n²+1
- f(n)=n³
- f(n)=ceiling(n/2)
- (2pts)
For each of the functions in the previous problem,
is f : Z→Z onto?
- f(n)=n-1
- f(n)=n²+1
- f(n)=n³
- f(n)=ceiling(n/2)
- (6pts)
Consider the following four sentences,
where
J(x) is interpreted as “x is a Jedi”,
and
F(x) is interpreted as “x uses The Force”.
|
i |
ii |
iii |
∀x.(J(x)→F(x)) |
|
|
|
∀x.(J(x)∨F(x)) |
|
|
|
∃x.(J(x)→F(x)) |
|
|
|
∃x.(¬J(x)∧F(x)) |
|
|
|
Fill in the table with the
formula's truth-value (T/F)
when the domain is:
-
The characters in the Star Wars universe.
-
The Empire's employees on The Death Star
where some (but not all) use The Force, and none are Jedi.
-
Our world (where, pathetically, nobody is actually a Jedi, and
nobody actually uses The Force).
Hint: when trying to figure out an answer,
ask yourself
whether the formula is true when you plug in
x=Darth Vader, and/or x=Jar Jar Binks, and/or x = Sir Alec Guinness,
etc., depending on the domain.
- (2pts)
What is the contrapositive of the following statement:
y≥z → f(y)≥f(z)
(Hint: What's a simpler way to say something like “¬(y≥z)”?)
- (4pts; changed to extra-credit)
Let f:ℜ→ℜ be a (strictly) increasing function.
Prove that
if f(k) < f(x) < f(k+1) for some k∈Z,
then x∉Z.
(Hint: See the previous problem,
which is related to the definition of an increasing function.)
You may use the fact that
any number between two consecutive integers
is not an integer.
1
As expected,
the domain of dorm is on-campus RU students;
its codomain is RU dormitories.
↩
home—info—lectures—exams—archive