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

homeinfolecturesexamsarchive

exam01
exam 1

Instructions: Closed book, closed most-notes, but you can have one single-sided 8.5″x11″ page of notes/pictures in your own handwriting (no photocopying etc).

#pts possiblepts
18      
26
38
412
56
64
78
84
94
106
Σ66
  1. (8pts) Let n be the proposition “a null pointer exception occurs”,
    let v be the proposition “the array index is valid”, and
    let a be the proposition “the array has been initialized”.
    Give a propositional formula expressing:
    1. If a null pointer exception occurs, then the array has not been initialized.

                                                                  
    2. The array index is valid, but a null pointer exception occurs.

                                                                  
    3. Initializing the array and having a valid array index is sufficient to avoid a null pointer error.

                                                                  
    4. (Challenge:) Initializing the array and having a valid array index is necessary to avoid a null pointer error.

                                                                  
  2. (6pts) Use truth tables to show that the following is a tautology: [¬q∧(p∨q)] → p.
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  3. (8pts) For each of the following, indicate whether or not they are true, over the domain of the integers:
    1. true or false?: ∃x. ((30 < x²) ∧ (x² < 40))
    2. true or false?: ∃x. ((30 < x²) ∨ (x² < 40))
    3. true or false?: ∀x. ((30 < x²) ∧ (x² < 40))
    4. true or false?: ∀x. ((30 < x²) ∨ (x² < 40))
  4. (12pts) Let Q(x,y) be the statement “student x has been a contestant on quiz show y”. Express each of the following sentences as a first-order logic formula, where the domain for x is all RU students, and y is all TV quiz shows.
    1. “Amy McCoy IV has been a contestant on Family Feud.” (You may abbreviate Family Feud as “FF”.)

                                                                  
    2. “There is an RU student who has been a contestant on Jeopardy and on Family Feud

                                                                  
    3. “There is a RU student who has been a contestant on a TV quiz show.”

                                                                  
    4. “No RU student has ever been a contestant on a TV quiz show.”

                                                                  
    5. “Every TV quiz show has had an RU student as a contestant.”

                                                                  
    6. “At least two RU students have been contestants on Jeopardy.”

                                                                  
  5. (6pts) The symmetric difference of two sets A and B, denoted A ⊕ B, is the set of elements which are in A or in B, but not in both. Fill in the blank below with a logic formula expressing this, where that formula does not use the binary exclusive-or operator (also denoted ⊕):

    A⊕B = { x |                                                                                 }
  6. (4pts) Draw a Venn diagram for each of the following:
    1. A-(B∩C).
      
      
      
      
      
      
      
    2. (A-B)∪(A-C).
      
      
      
      
      
      
      
  7. (8pts) Prove that, for sets A,B,C,
    (A ∩ B ∩ C) ⊆ A ∪ B.
    Be sure to use the definition of ⊆, ∩, and ∪ appropriately, and any justifications you need from Rosen's Table 1 (attached).
  8. (4pts) In the following, φ represents the empty set, {}, and P(A) represents the power set of A (where A is any set).
    1. true or false?: φ ∈ P({φ,{φ}})
    2. true or false?: φ ⊆ P({φ,{φ}})
    3. true or false?: {φ} ∈ P({φ,{φ}})
    4. true or false?: {φ} ⊆ P({φ,{φ}})
  9. (4pts) Consider the Java method parseInt which takes in any String and returns what int the string represents (in base 10). (If the String doesn't represent a number, it does not return a value — it throws an exception.) For example, parseInt("+18")=18, and parseInt("001")=1.
  10. (6pts) Use propositional equivalences to show that (a→b) ∨ a ≡ true. (that is, (a→b) ∨ a is a tautology).

    Your answer will be a series of formulas, joined by ≡, with each line justified by one of the reasons from the attached Table 6 from Rosen. You may combine any associativity or commutativity steps with other steps; just cite that additional justification.

homeinfolecturesexamsarchive


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