This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 173: Discrete Structures, Fall 2011 Homework 2 Solutions This homework contains 5 problems worth a total of 47 points. 1. [9 points] Truth tables (a) (3 points) Give the truth table corresponding to the following expression: ( p q ) r Include a column for the intermediate result ( p q ) . Solution p q r p q ( p q ) r T T T T T T T F T F T F T F F T F F F F F T T T T F T F T F F F T T T F F F T F (b) (2 points) Eager Eddy from down the hall claims that ( p q ) r and p ( q r ) are logically equivalent. Disprove his claim using a concrete counterexample. That is, give specific values for p , q and r for which the two expressions produce different values. Solution Let p and r be false, and q be true. Then the first expression is false, and the second is true. (c) (4 points) For which values of p , q , and r is the following logical expression true? ( r q ) ( p q ) ( r p ) Give a succinct description of which combinations of input values work, rather than the whole truth table. Solution p , q and r must either be all true or all false. 1 2. [6 points] Translating notation into English Suppose we define: C ( x ) is x takes a potion class. Q ( x ) is x plays Quidditch . W ( x ) is x owns a wand. R ( x ) is x rides flying broomsticks G ( x ) is x is in Gryffindor house. F ( x,y ) is x and y are best friends. S is the set of all students of Hogwarts. Translate the following into English: (a) p S, W ( p ) ( q,r S,C ( q ) G ( q ) G ( r )) Solution Any student of Hogwarts owns a wand and there exists a pair of students such that one takes a potion class and neither is in Gryffondor house. (b) x,y S, ( R ( x ) ( G ( x ) G ( y ))) ( Q ( x ) F ( x,y )) Solution For any pair of students of Hogwarts, if one rides flying broomsticks or they are both in Gryffondor house then the first student plays Quidditch and they are best friends....
View
Full
Document
This note was uploaded on 09/19/2011 for the course CS cs173 taught by Professor Fleck during the Fall '07 term at University of Illinois, Urbana Champaign.
 Fall '07
 fleck

Click to edit the document details