------------------------------------------------------------------------------ Mohamed G. Gouda CS 311 Summer 2014 Homework 1 ------------------------------------------------------------------------------ 1. (4 points) Simplify each of the following formulas: a. (x and y and x and y or z) b. x and (y and x and y or z) c. x and y and (x and y or z) d. x and y and x and (y or z) 2. (2 points) Let Dx and Dy be the set {0, 1, 2}. Define the parameterized predicate P(x, y) to be y = x+1 mod 3. Thus, the Boolean value of P(0, 0) is F the Boolean value of P(0, 1) is T the Boolean value of P(0, 2) is F a. Prove the quantified predicate (All x, not P(x, x)) using direct inference (Hint: Prove the predicate (All x, T => (not P(x,x)).) b. Prove the quantified predicate (All x,y P(x, y) => (not P(y, x))) using by-contradiction 3. (4 points) Let Dx and Dy be the set of persons which includes the person "Raymond". Define the parameterized predicate L(x, y) to mean "person x likes person y". Express each of the following English statements as quantified predicates: a. If a person likes another person then that other person may or may not like the first person. b. Everyone likes "Raymond" but "Raymond" likes no one. Solutions: 1. a. (x and y and x and y or z) = {symmetry, associativity, and idempotence of and} (x and y or z) b. x and (y and x and y or z) = {symmetry, associativity, and idempotence of and} x and (x and y or z) = {distribution of and over or} x and x and y or x and z = {idempotence of and} x and y or x and z = {distribution of and over or} x and (y or z) c. x and y and (x and y or z) = {absorption} x and y d. x and y and x and (y or z) = {symmetry, associativity, and idempotence of and} x and y and (y or z) = {distribution of and over or} x and y and y or x and y and z = {idempotence of and} x and y or x and y and z = {absorption} x and y 2. a. T => {All x, T => (x =! x+1 mod 3)} x =! x+1 mod 3 => {All x, (x =! x+1 mod 3) => not (x = x+1 mod 3)} not (x = x+1 mod 3) => {definition of P(x, x)} not P(x, x) b. P(x, y) and P(y, x) => {definitions of P(x, y) and P(y, x)} (y = x+1 mod 3) and (x = y+1 mod 3) => {arithmetics} (y = y+2 mod 3) => {All y, T => (y =! y+2 mod 3)} (y = y+2 mod 3) and (y =! y+2 mod 3) => {elementary} F 3. a. (All x, y, (L(x, y) --> L(y, x) or not L(y, x)) = T b. (All x, L(x, "Raymond") and not L("Raymond", x)) = F