0% found this document useful (0 votes)
5 views

Exercise Week 3

Uploaded by

Mka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Exercise Week 3

Uploaded by

Mka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Exercises for week 3 (I2CA)

(1) again we use induction on z. (x ∗ y) ∗ 0 = 0 = x ∗ (y ∗ 0) = x ∗ 0 = 0 IH: (x ∗ y) ∗ z = x ∗ (y ∗ z)


Inductive step: (x ∗ y) ∗ S(z) = (x ∗ y) ∗ z + (x ∗ y) = x ∗ (y ∗ z) + (x ∗ y) = x ∗ (y ∗ z + y) =
x ∗ (y ∗ S(z))
now I will prove right hand distributivity.
z ∗ (x + y) = z ∗ x + z ∗ y, basecase : 0 ∗ (x + y) = 0 (Exercise 1, part f) IH : z ∗ (x + y) =
z ∗ x + z ∗ y, IS : S(z) ∗ (x + y) = (z + 1)(x + y) = z ∗ (x + y) + (x + y) we used Lemma 6
1 ∗ x = x and definition of counting by adding 1. z ∗ (x + y) + (x + y) = z ∗ x + z ∗ y + x + y =
z ∗ x + x = (z + 1) ∗ x + (z + 1) ∗ y = S(z) ∗ x + S(z) ∗ y where we used (1) (right hand side
distributivity) and 1 ∗ y = y . this proved right hand distributivity thus this proves (2).

(2) (a)

x y z y∨z x ∧ (y ∨ z) (x ∧ y) ∨ (x ∧ z)
T T T T T T
T T F T T T
T F T T T T
T F F F F F
F T T T F F
F T F T F F
F F T T F F
F F F F F F

(b)

x y z y∧z x ∨ (y ∧ z) (x ∨ y) ∧ (x ∨ z)
T T T T T T
T T F F T T
T F T F T T
T F F F T T
F T T T T T
F T F F F F
F F T F F F
F F F F F F

(c)

x y z y∧z x ∧ (y ∧ z) (x ∧ y) ∧ z
T T T T T T
T T F F F F
T F T F F F
T F F F F F
F T T T F F
F T F F F F
F F T F F F
F F F F F F
(3) a)

(x ∧ y) ∨ (x ∧ y) (Original expression)
= y ∧ (x ∨ x) (Distributive Law)
= y ∧ True (Complement Law: x ∨ x = True)
=y (Identity Law: y ∧ True = y)

b)

(x ∧ y) ∨ (x ∧ y) ∨ (x ∧ y) ∨ (x ∧ y) (Original expression)
= (x ∨ y) ∨ (x ∧ y) ∨ (x ∧ y) ∨ (x ∧ y) (De Morgan’s Law)
= (x ∨ y ∨ x ∧ y) ∨ (x ∧ y) ∨ (x ∧ y) (Associative Law)
= (x ∨ y) ∨ (x ∧ y) ∨ (x ∧ y) (Absorption Law: x ∨ x ∧ y = x)
= (x ∨ y) ∨ x (Distributive Law)
=x∨y∨x (Associative Law)
= True (Complement Law: x ∨ x = True)

(4) we do case split on xn


case 1:
xn = 1 → f (x[1 : n]) = 0 ∧ f (x[1 : n − 1], 0) ∨ 1 ∧ f (x[1 : n − 1], 1) = f (x[1 : n − 1], 1) =
f (x[1 : n])
case 2:
xn = 0 → f (x[1 : n]) = 1 ∧ f (x[1 : n − 1], 0) ∨ 0 ∧ f (x[1 : n − 1], 1) = f (x[1 : n − 1], 0) =
f (x[1 : n])

(5) we write conjuctive normal forms for both. (¬a ∧ ¬b ∧ ¬c) ∨ (¬a ∧ ¬b ∧ c) ∨ (a ∧ ¬b ∧ ¬c) ∨
(a ∧ ¬b ∧ c) which simplifies to f ≡ ¬b (simplification steps skipped)
we write now CNF for g:
(¬a ∧ ¬b ∧ ¬c) ∨ (a ∧ ¬b ∧ ¬c) ∨ (a ∧ ¬b ∧ c) ∨ (a ∧ b ∧ ¬c) ∨ (a ∧ b ∧ c) which simplifies to
a ∨ (¬a ∧ ¬b ∧ ¬c)



(+, v1 + v2 ), if s1 = + ∧ s2 = +




(+, v1 − v2 ), if s1 = + ∧ s2 = − ∧ v1 ≥ v2

(−, v − v ), if s = + ∧ s = − ∧ v < v
2 1 1 2 1 2
(6) 1. (s1 , v1 ) + (s2 , v2 ) =


(−, v1 − v2 ), if s1 = − ∧ s2 = + ∧ v1 ≥ v2




(+, v2 − v1 ) if s1 = − ∧ s2 = + ∧ v1 < v2

(−, v + v ) if s = − ∧ s = −
2 1 1 2

2. commutativity follows from the definition above, (s1 , v1 ) + (s2 , v2 ) = (s2 , v2 ) + (s1 , v1 )
we prove commutativity for 1 case: suppose s1 = + ∧ s2 = − ∧ v1 ≥ v2 then result is
(+, v1 − v2 ) now consider: (s2 , v2 ) + (s1 , v1 ) in this case v2 < v1 holds s2 = − ∧ s1 = +
we apply definition and get (+, v1 − v2 ) notice for the LHS we used second case in the
definition and for RHS we used 5th case for the definition.

You might also like