RU beehive logo ITEC dept promo banner
ITEC 122
2008fall
ibarland

homeinfolecturesexamsarchive

hw06
function basics

Due 2008.Oct.15 (Wed).
  1. (2pts) Rosen p.132, #50 (= Rosen 5ed p. 96 #40): bit-string representation.
  2. (3pts) Consider the function dorm, which maps an on-campus RU student to their dorm-building1 For example, dorm(Jane Doe) = Muse.
    1. Is this function one-to-one? Is it onto?
    2. What if the codomain were all campus buildings, instead of just dorms -- would the function still be one-to-one? onto?
    3. 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?
  3. (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?)
    1. f(n) = ±n.
    2. f(n) = √(n²+1).     (Recall that √ refers to the non-negative square root.)
    3. f(n) = 1/(4-n²).
  4. (2pts) Rosen p146, #8, parts a,c,e,g only (= Rosen 5ed p. 108 #8a,c,e,g): Ceiling, floor
    1. ⌊1.1⌋
    2. ⌊-0.1⌋
    3. ⌈3.0⌉
    4. ⌊0.5+⌈0.5+⌉⌋
  5. (2pts) Rosen p146, #12 (= Rosen 5ed p. 108 #12): one-to-one?
    1. f(n)=n-1
    2. f(n)=n²+1
    3. f(n)=n³
    4. f(n)=ceiling(n/2)
  6. (2pts) For each of the functions in the previous problem, is f : ZZ onto?
    1. f(n)=n-1
    2. f(n)=n²+1
    3. f(n)=n³
    4. f(n)=ceiling(n/2)
  7. (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:
    1. The characters in the Star Wars universe.
    2. The Empire's employees on The Death Star where some (but not all) use The Force, and none are Jedi.
    3. 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.
  8. (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)”?)
  9. (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.      

homeinfolecturesexamsarchive


©2008, Ian Barland, Radford University
Last modified 2008.Dec.18 (Thu)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme