Print this problem set out (there 10 problems!) and answer the problems on the given sheet.
  1. Suppose we have six speakers to schedule (Alice, Bob, Cathy, Don, Eve, Fred), and two sessions (1 and 2) to put them in. Note: not scheduling someone (i.e. not putting them in either session) is a possibility! Assume your variables are a1,a2,b1,b2,...,f1,f2, where a1 means "alice in session 1", a2 means "alice in session 2", and so on.
    1. Write a formula for the constraint: Nobody can be scheduled for both sessions
    2. Write a formula for the constraint: Alice and Bob cannot be in the same session
    3. Write a formula for the constraint: either Cathy or Don, but not both, are in session 1.
    4. Write a formula for the constraint: Eve cannot be scheduled for a later session than Fred.
    5. Why can't we just have variable "a" to mean "Alice in session 1", and then say that if "a" is false that means that Alice is in session 2?
  2. Is (a⊕b⊕c)⇒(¬a⇒(c∨b)) a tautology? How did you check?
  3. Is the formula below a tautology? How did you check?

    (a∧p⇒(b∧l⊕c∧m))∧(e∧n∨b∧l∨f∧o)⇒(d∧a⊕g∧c∧m⊕f∧o∧h⇒(¬i∨¬j∨¬k∨b∧l∨g∨a))


  4. One of the answers in the "car options" problem from the previous homework was the formula ¬sp∧¬tp⇒¬t. Simplify this a step at a time by applying the tautologies given at each step.
    
    	  
    F =     ¬sp∧¬tp⇒¬t
    
    
    
      = __________________________  apply tautology (a⇒b)⇔(¬b⇒¬a)    [note: called the "contrapositive" rule]
    
    
    
      = __________________________  apply tatuology ¬¬a⇔a            [note: "double negation"]
    
    
    
      = __________________________  apply tautology ¬(a∧b)⇔(¬a∨¬b)   [note: one of de morgan's laws]
    
    
    
      = __________________________  apply tatuology ¬¬a⇔a twice!     [note: "double negation" ... again!]
    	
  5. Use the propositional logic tool and verify that (a∨¬a∧b)⇔(a∨b) is a tautology. I'm not kidding, do it! Using that tautology, show how to simplify the code below:
    if (y == 0 || y != 0 && x/y < 0.33) {
      cout << "pass" << endl;
    }
    else {
      cout << "fail" << endl;
    }	

  6. Note: This problem is not directly about in-class content. But if you've been learning not how to read and understand mathematics (which is actually a big part of what you should get from this course), you should be able to do this pretty easily.

    In computer architecture, it is common to adopt a different syntax for propositional formulas than what we've been seeing. Let's call these "comp-arch formulas". Here is a definition:

    1. propositional variables are comp-arch formulas (equivalent to variables in regular propositional formulas)
    2. if $A$ is a comp-arch formula, $\overline{A}$ is a comp-arch formula (equivalent to $\neg(A)$)
    3. if $A$ and $B$ are comp-arch formulas, then $(A)(B)$ is a comp-arch formula (equivalent to $(A)\wedge(B)$)
    4. if $A$ and $B$ are comp-arch formulas, then $(A)+(B)$ is a comp-arch formula (equivalent to $(A)\vee(B)$)
    5. nothing else is a comp-arch formula
    For these formula we also adopt the rule that "and" has higher precedence than "or" so that we can drop many of the parentheses. So, for instance:
    1. Write the propositional formula equivalent to: $abc+a\overline{b}c$
    2. Write the propositional formula equivalent to: $a\overline{(b + cd)}$
    3. Write the propositional formula equivalent to: $\overline{xy + \overline{z}}+xz$
    4. Consider the truth table for function $F$ below. Following the algorithm from the Class 4 theorem, write down a definition formula for $F$, but write it down using the comp-arch formula notation.

20pts Extra Credit: ChatGPT does a good job with many of the questions we've considered from this last week. But I asked it to simplify u∧v⇒(v⊕w) and things didn't go so well.
  1. The last sentence is not a formula, but a description. Write down the formula it describes.
  2. Prove to me that the formula described by ChatGPT is not actually equivalent to u∧v⇒(v⊕w).
    [This can be very short and sweet! Think about what is sufficient to show someone that formulas are not equivalent.]
  3. Obviously, ChatGPT made a mistake somewhere in between "Now let's analyze this" and "So, the simplified condition is". Where? (circle the spot) and what is the mistake?
  4. Is there a simpler equivalent formula? If so what is it, and why do you think it is "simpler"?