Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Similar documents
CS40-S13: Functional Completeness

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

Practice Final. Read all the problems first before start working on any of them, so you can manage your time wisely

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Propositional Calculus. Math Foundations of Computer Science

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

CS February 17

CSE 20 DISCRETE MATH. Fall

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Today s Topics. What is a set?

MATH 2100 / 2105 / 2350 EXAM 1

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

CSE 20 DISCRETE MATH. Winter

Combinational Circuits

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

Discrete structures - CS Fall 2017 Questions for chapter 2.1 and 2.2

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f?

NP and computational intractability. Kleinberg and Tardos, chapter 8

Summary of Course Coverage

UNCA CSCI 255 Exam 1 Spring February, This is a closed book and closed notes exam. It is to be turned in by 1:45 PM.

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Section 2.2: Introduction to the Logic of Quantified Statements

Homework 1 CS 1050 A Due:

COMP combinational logic 1 Jan. 18, 2016

Mixed Integer Linear Programming

Introduction to Computer Architecture

Lecture 14: Lower Bounds for Tree Resolution

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

2SAT Andreas Klappenecker

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

1 Comparison Networks: An Analogy

CS1800 Discrete Structures Final Version A

W4231: Analysis of Algorithms

Standard Boolean Forms

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1

Answer Key #1 Phil 414 JL Shaheen Fall 2010

8.1 Polynomial-Time Reductions

Reductions and Satisfiability

Strategies for Proofs

Implementation of a Sudoku Solver Using Reduction to SAT

Boolean Functions (Formulas) and Propositional Logic

TA: Jade Cheng ICS 241 Recitation Lecture Notes #12 November 13, 2009

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)

Binary Decision Diagrams

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

CSC Discrete Math I, Spring Sets

Binary Adders: Half Adders and Full Adders

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

BOOLEAN ALGEBRA AND CIRCUITS

8 NP-complete problem Hard problems: demo

CPSC 121 Midterm 1 Friday October 14th, Signature: Section (circle one): 11:00 15:30 17:00

PROPOSITIONAL LOGIC (2)

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CSC 101: Lab #5 Prelab Boolean Logic Practice Due Date: 5:00pm, day after lab session

Boolean Representations and Combinatorial Equivalence

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1

CS 395T Computational Learning Theory. Scribe: Wei Tang

Exam in Algorithms & Data Structures 3 (1DL481)

NP-Complete Reductions 2

Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday)

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

HW1. Due: September 13, 2018

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

Propositional Logic. Application of Propositional logic

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Review. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.

Complexity Classes and Polynomial-time Reductions

7/25/2016. Example: Addition of Unsigned Bit Patterns. ECE 120: Introduction to Computing. Adding Two Non-Negative Patterns Can Overflow

CS 374 Fall 2014 Homework 2 Due Tuesday, September 16, 2014 at noon

LECTURE 2 An Introduction to Boolean Algebra

LOGIC AND DISCRETE MATHEMATICS

Combinatorial Optimization

Chapter 2: Universal Building Blocks. CS105: Great Insights in Computer Science

CSE20: Discrete Mathematics

Lecture 1: Conjunctive Queries

Menu. Algebraic Simplification - Boolean Algebra EEL3701 EEL3701. MSOP, MPOS, Simplification

Program Verification & Testing; Review of Propositional Logic

CENG 241 Digital Design 1

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully.

Automated Reasoning. Natural Deduction in First-Order Logic

Boolean Analysis of Logic Circuits

CS 512, Spring 2017: Take-Home End-of-Term Examination

CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00

CSC 101: Lab #5 Boolean Logic Practice Due Date: 5:00pm, day after lab session

STUDENT NUMBER: MATH Final Exam. Lakehead University. April 13, Dr. Adam Van Tuyl

QUESTION BANK FOR TEST

CIS 771: Software Specifications. Lecture: Alloy Logic (part D)

Computer-Aided Program Design

Solutions to Selected Exercises

Transcription:

Homework 1 Due Date: Wednesday 11/26/07 - at the beginning of the lecture Problems marked with a [*] are a littlebit harder and count as extra credit. Note 1. For any of the given problems make sure that you justify your answers. You must show how you obtained your solution or argue that your solution is correct. If you fail to so, you will receive little or no credit for your solution! Problem 1. (10+5 pts) Consider the logical operator nand denoted by (the Sheffer stroke). It is defined as follows. p q p q T T F T F T F T T F F T (a) (2 pts) Show that p p p holds for any proposition p. (b) (4 pts) Find a propositions just involving p, q and which is equivalent to p q. (c) (4 pts) Find a propositions just involving p, q and which is equivalent to p q. Try to find one that uses only the operator three times. (d) [*] (5 pts) We mentioned in class that just the operators and are not strong enough to express every possible proposition, because we cannot express the negation. We did not give a proof for this statement in class. explains why and cannot express. Try to find an argument that

Problem 2. (16+7 pts) For all subproblems consider the proposition [ (p q) r] [r (p q)]. (a) (6 pts) Use the truth table method to compute an equivalent proposition in DNF (Disjunctive Normal Form). Do not simplify. (b) (5 pts) Find a DNF for the given proposition using logical equivalences. For each step mentioned the equivalence used. (c) (5 pts) Try to simplify the DNF you found in Part (b), to get a DNF using only three logical operators. Use logical equivalences to show that your answer is correct. In case you need to use equivalences that we did not mention during class, you will have to prove them first. Just as we can express any compound proposition in DNF as an or of ands of literals ( a disjunction of conjunctions of literals), i.e. (l 1 l 2... l i )... (l j... l n ), it is possible to express it as an and of ors of literals (a conjunction of disjunctions of literals): (l 1 l 2... l i )... (l j... l n ). This is called the conjunctive normal form (CNF). Note that a compound proposition in CNF is true if at least one literal in each disjunction is true. (d) [*] (4 pts) Find a method using a truth table for computing the CNF of a compound proposition. Describe your method in English and explain why it works. (e) [*] (3 pts) Use your method from Part (d) to compute the CNF of the given proposition [ (p q) r] [r (p q)].

Problem 3. (16 pts) Let us define two new quatifiers: the unique existentential quantification and almost universal quantification. We shall use the notation! x P (x) to express the proposition: There exists a unique value for x such that P (x) is true. We shall use the notation! x P (x) to express the proposition: P (x) is true for all possible values of x except one. Use definition to solve the following problems. (a) (4 pts) Let the universe of discourse be the set of all positive and negative integers. For each of the following propositions decide whether they are true or false and give a brief justification. (i)! x [x 4 = 1] (ii)! x [x + 2 = 2x] (iii)! x [x 2 + 2 = 2x] (iv)! x [x < 1] (v)! x [x < 1] (vi)! x [x 2 x] (vii)! x [x 2 4] (viii)! x [2x 4x] (b) (4 pts) Use English to describe the meaning of! x P (x) (Don t just say: There is not a unique x... ). Translate your description into predicate logic using only the quatifiers and, logic operators and the predicates P (x) and S(x, y) where S(x, y) means x and y are the same. (c) (4 pts) Are the two propositions! x P (x)! x Q(x) and! x [P (x) Q(x)] equivalent? Justify your answer. (d) (4 pts) We know that xp (x) x P (x). Does this also hold for! xp (x) and! x P (x)? If not, can you find some equivalence involving!,! P (x) and P (x)? Justify your answer.

Problem 4. (18 pts) Suppose the variable x represents students and y represents courses. Consider the following predicates. U(y) = y is an upper-level course C(y) = y is a computer science course F (x) = x is a freshman P (x) = x is a part-time student Q(x) = x is a full-time student T (x, y) = student x is taking y Write each of the following statements using the above predicates and any needed quantifiers and logical operators. (a) (1 pts) Bob is a freshman. (b) (1 pts) Charlie is not taking any classes. (c) (1 pts) Every freshman is a taking a non-computer science course. (d) (1 pts) No part-time student is taking an upper level course. (e) (1 pts) Every students is taking at least one course. (f) (1 pts) Every full-time student is taking a computer science course. (g) (2 pts) There is and upper-level computer science that cannot be taken by freshmen. Write each of the following in good English without using variables in your answers. (h) (1 pts) T (Alice, CS205) (i) (1 pts) xf (x) (j) (1 pts) x P (x) F (x) (k) (1 pts) x y T (x, y) (l) (1 pts) y x T (x, y) (m) (1 pts) x y [ P (x) (C(y) T (x, y)) ] (n) (2 pts) x y [ Q(x) ( F (x) (U(y) T (x, y)) ) ] (o) (2 pts) x y [ F (x) ( (U(y) T (x, y)) C(y) ) ]

Problem 5. (10+6 pts) Let f(x, y, z) be the Boolean function that returns 1 is at least two of its arguments are 1 and 0 otherwise. For all parts of this problem, assume that we are only working with logic gates that have fan-in 2. That is each AND and OR gate have exactly two input wires. (a) (2 pts) Compute f(0, 1, 1), f(0, 1, 0), f(1, 1, 1) and f(0, 0, 0). (b) (6 pts) Express how f(x, y, z) can be computed from the Boolean operations +,, and x. (c) (2 pts) Draw a circuit that computes f. (d) [*] (+6 pts) Let maj n (x 1,..., x n ) the Boolean function that takes n Boolean variables and inputs, and that returns 1 if at least half (i.e., n 2 ) of the inputs are 1. Describe the structures of a circuit that would compute maj n. What is the depth of such a circuit? (I.e., what the maximum number of gates that one would have to pass to get from an input to the output?)