Assignment.2.Solutions.cs2102

Assignment.2.Solutio - Assignment 2 Solutions CS2102 Fall 2009 1(1.1 7 Answer m ~c Explanation The statement to write is “Juan is a math major

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Assignment 2 Solutions CS2102, Fall 2009 1. (1.1, 7) Answer: m ∧ ~c Explanation: The statement to write is “Juan is a math major but not a computer science major”. This statement has two parts, ” Juan is a math major” (m) and “Juan is not a computer science major” ( ~c, the negation of c). Both of theses statements must be true for the entire statement to be true, so we use the “and” symbol, ∧ . 2. (1.1, 8b, c, e) Answer: 8b. ~w ∧ h ∧ s Explanation: The statement “John is not wealthy but he is healthy and wise” has 3 parts. John is not wealthy, John is healthy, and John is wise. Symbolically, we negate the variable w, and AND all variables together since the 3 parts must all be true for the entire statement to be true. Answer: 8c. ~h ∧ ~w ∧ ~s or ~(h ∨ w ∨ s) Explanation: The statement “John is neither healthy, wealthy, nor wise” also has 3 parts. John is not healthy, and he is not wealthy, and he is not wise. Symbolically, we AND together the negation of all 3 variables. Note that according to DeMorgan’s law, the statement ~(h ∨ w ∨ s) is logically equivalent and also an acceptable answer. Answer: 8e. w ∧ ~(h ∧ s) or w ∧ (~h ∨ ~s) Explanation: The statement “John is wealthy but he is not both healthy and wise” has 2 main parts. First, John is wealthy, represented by w. The second part states that John is not both healthy and wise. h ∧ s means “John is healthy and wise”. We negate that statement, ~(h ∧ s) to get the statement “John is not both healthy and wise”. We AND the 2 parts of the statement together to get our answer, since they must both be true. Note that according to DeMorgan’s law, the statement w ∧ (~h ∨ ~s) is logically equivalent and also an acceptable answer. 3. (1.1, 9) Answer: (n ∧ ~k) ∨ (~n ∧ k) Explanation: Olga will go out for either tennis or track but not both. This means that either Olga will go out for track and not go out for tennis or Olga will not go out for track and she will go out for tennis. We can easily translate this to symbols as shown above. 4. (1.1, 10) Answer: 10a. p ∧ q ∧ r Explanation: p, q, and r must be true for the statement to be true. Therefore we AND all variables. Answer: 10b. p ∧ ~q Explanation: p and the negation of q must be true for the statement to be true. Therefore we AND p and the negation of q. Answer: 10c. p ∧ (~q ∨ ~r) Explanation: p must be true and either the negation of q or the negation of r must be true for the statement to be true. Therefore we OR the negation of q and the negation of r, and AND that result with p....
View Full Document

This note was uploaded on 10/10/2009 for the course CS 2102 taught by Professor Knight during the Spring '08 term at UVA.

Page1 / 8

Assignment.2.Solutio - Assignment 2 Solutions CS2102 Fall 2009 1(1.1 7 Answer m ~c Explanation The statement to write is “Juan is a math major

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online