Do not start until you are given the green signal

Similar documents
Name: Student ID: Instructions:

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Readings: Conjecture. Theorem. Rosen Section 1.5

Logic, Sets, and Proofs

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Logic and Proof. Aiichiro Nakano

CSC 125 :: Final Exam May 3 & 5, 2010

Logic Overview, I. and T T T T F F F T F F F F

MAT 243 Test 1 SOLUTIONS, FORM A

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

Rules Build Arguments Rules Building Arguments

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Introduction to Sets and Logic (MATH 1190)

Predicate Logic. Andreas Klappenecker

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Math 3336: Discrete Mathematics Practice Problems for Exam I

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

Packet #1: Logic & Proofs. Applied Discrete Mathematics

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. February 9, :30 pm Duration: 1:50 hs. Closed book, no calculators

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1 (Version B)

Section 1.2: Propositional Logic

Math 10850, fall 2017, University of Notre Dame

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

ECOM Discrete Mathematics

software design & management Gachon University Chulyun Kim

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Math 13, Spring 2013, Lecture B: Midterm

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

CSE 20. Final Review. CSE 20: Final Review

ICS141: Discrete Mathematics for Computer Science I

DISCRETE MATH: FINAL REVIEW

CSC 125 :: Final Exam December 14, 2011

Discrete Mathematics Recitation Course 張玟翔

Announcements. Exam 1 Review

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

CSE 20: Discrete Mathematics

1 The Foundation: Logic and Proofs

Review: Potential stumbling blocks

First order Logic ( Predicate Logic) and Methods of Proof

Review for Midterm 1. Andreas Klappenecker

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

CS0441 Discrete Structures Recitation 3. Xiang Xiao

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

1 The Foundation: Logic and Proofs

At least one of us is a knave. What are A and B?

A. Propositional Logic

Practice Midterm Exam Solutions

Manual of Logical Style

Chapter 1: The Logic of Compound Statements. January 7, 2008

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

DISCRETE MATHEMATICS BA202

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. March 1, :00 pm Duration: 1:15 hs

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Intro to Logic and Proofs

Logic and Proofs. (A brief summary)

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Chapter 4, Logic using Propositional Calculus Handout

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Solutions to Exercises (Sections )

CPSC 121 Midterm 1 Tuesday, October 11th, 2011

Department of Mathematics and Statistics Math B: Discrete Mathematics and Its Applications Test 1: October 19, 2006

Practice Test III, Math 314, Spring 2016

Discrete Structures for Computer Science

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

Supplementary Logic Notes CSE 321 Winter 2009

Proof Worksheet 2, Math 187 Fall 2017 (with solutions)

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

1) Let h = John is healthy, w = John is wealthy and s = John is wise Write the following statement is symbolic form

CSC 125 :: Final Exam December 15, 2010

Review 3. Andreas Klappenecker

PROPOSITIONAL CALCULUS

Reexam in Discrete Mathematics

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

MATH 2001 MIDTERM EXAM 1 SOLUTION

RYERSON UNIVERSITY DEPARTMENT OF MATHEMATICS

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

COMP 2600: Formal Methods for Software Engineeing

PHI Propositional Logic Lecture 2. Truth Tables

Mat 243 Exam 1 Review

1.1 Statements and Compound Statements

PSU MATH RELAYS LOGIC & SET THEORY 2017

A Guide to Proof-Writing

Transcription:

SOLUTIONS CSE 311 Winter 2011: Midterm Exam (closed book, closed notes except for 1-page summary) Total: 100 points, 5 questions. Time: 50 minutes Instructions: 1. Write your name and student ID on the first sheet (once you start, write your last name on all sheets). Write or mark your answers in the space provided. If you need more space or scratch paper, additional sheets will be available. Make sure you write down the question number and your name on any additional sheets. 2. Tables for logical equivalence and set identities are included in the back. 3. Read all questions carefully before answering them. Feel free to come to the front to ask for clarifications. 4. Hint 1: You may answer the questions in any order, so if you find that you're having trouble with one of them, move on to another one that seems easier. 5. Hint 2: If you don t know the answer to a question, don t omit it - do the best you can! You may still get partial credit for whatever you wrote down. Good luck! Do not start until you are given the green signal 0

1. (20 points: 4 points each) Circle True (T) or False (F) below. Very briefly justify your answers (e.g. by giving an example or counter-example, by citing a theorem or result we proved in class, or by briefly sketching a proof or construction). a. For all sets A and B, A B = B A...T F Why/Why not? FALSE. Counterexample: Let A = {a}, B = {1}. Then, A B = {(a,1)} and B A = {(1,a)}. Since (a,1) (1,a), A B B A. b. n Z m Z (nm = m)...t F Why/Why not? TRUE. For any n Z, choose m = 0. Then, nm = 0 = m. c. For all integers m and n, mn is even if and only if m and n are both even...t F Why/Why not? FALSE. Counterexample: Let m = 3 and n = 2. Then, mn = 6 is even but m is not even. d. The function f(x,y) = x y from Z + Z + to Z + is onto...t F Why/Why not? TRUE. Proof: Let z be any element of Z +. Choose x = z and y = 1. Then, f(x,y) = f(z,1) = z 1 = z. Thus, z Z + (x,y) Z + Z + s.t. f(x,y) = z. Therefore, f is onto. e. The number 1 is among the numbers generated by the linear congruential pseudorandom number generator: x n+1 = 2x n mod 9 with seed x 0 = 2....T Why/Why not? TRUE. The generator generates the numbers 2, 4, 8, 7, 5, 1, 2, 4, Therefore, 1 is among the numbers generated. F 1

2. (20 points: 10 points each) Propositional Logic Name: a. Show that (p (p q)) (p q) using known logical equivalences (see tables at back of this exam). (p (p q)) p (p q) De Morgan s law p (p q) Logical Equivalence Table 7 ( p p) ( p q) Distributive law (p p) ( p q) Commutative law T ( p q) Negation law ( p q) T Commutative law ( p q) Identity law (p q) Logical Equivalence Table 7 b. Use a truth table to show that [ p (p q)] q is a tautology. p q p p q p (p q) [ p (p q)] q T T F T F T T F F T F T F T T T T T F F T F F T Because [ p (p q)] q is always true, it is a tautology. 2

3. (18 points: 10 and 8 points) Predicate Logic Name: a. Let S(x,y) be the predicate x has seen the movie y and R(x,y,z) the predicate x has recommended movie y to z, where the domain of x and z is the set of all students in this class and the domain of y is the set of all movies. Use only the quantifiers and to express the following statements about students in the class: i. There is a movie that everyone has seen and no one has recommended. y x(s(x,y) z R(x,y,z)) ii. There is someone in the class who has not seen any movies but to whom at least two students have recommended a movie. x y ( S(x,y) x 1 x 2 y 1 y 2 ((x 1 x 2 ) R(x 1, y 1,x) R(x 2, y 2,x)) b. Express the negations of each of these statements so that all negation symbols immediately precede predicates: i. x( P(x) y z ( Q(x,y,z) R(x,y,z))) x(p(x) y z ( Q(x,y,z) R(x,y,z))) ii. x ([ y z ((x = z) R(x,y,z))] [ y z (Q(x,y,z) (y z))]) (Use Table 8: negate p q as p q) x ([ y z ((x = z) R(x,y,z))] [ y z ( Q(x,y,z) (y = z))]) OR (Negate p q as p q) x ([ y z ((x z) R(x,y,z))] [ y z (Q(x,y,z) (y z))]) 3

4. (22 points: 12 and 10 points) Rules of Inference and Proofs a. Use rules of inference and logical equivalences to show that the hypotheses p, q s, (r s) p, and q (r t) imply the conclusion t. 1. p Hypothesis 2. (r s) p Hypothesis 3. (r s) Modus Tollens using 1 and 2 4. r s De Morgan s law 5. q s Hypothesis 6. q Simplification of 5 7. q (r t) Hypothesis 8. (r t) Modus Ponens using 6 and 7 9. t s Resolution using 8 and 4 10. s t Commutative law 11. s Simplification of 5 12. t Disjunctive syllogism using 10 and 11 (or equivalently, simplified resolution using 10 and 11) b. Suppose there are 14 stores in a mall. Prove that at least 3 in a group of 30 people shopping at stores in the mall must be shopping at the same store. Proof by contradiction: Assume at most 2 people in a group of 30 people are shopping at the same store. Since there are 14 stores, at most 28 people can be shopping at all stores in the mall. This contradicts the fact that there are 30 people shopping. Therefore, at least 3 people must be shopping at the same store. 4

5. (20 points: 10 points each) Sets and Number Theory Name: a. Let A, B, C be three sets. Use set builder notation and logical equivalences to show that A (B C) = (A B) (A C). A (B C) = {x x A x (B C)} Definition of set difference = {x x A (x (B C)} Definition of = {x x A (x B x C)} Definition of = {x x A (x B x C)} De Morgan s law = {x (x A x B) (x A x C)} Distributive law = {x (x (A B)) (x (A C))} Definition of set difference = {x x (A B) (A C)} Definition of union = (A B) (A C) Set builder notation b. State whether the following statements are TRUE or FALSE (no proofs needed): i. 3.5 + 3.5 = 1 FALSE. ( 3.5 + 3.5 = 4 + (-4) = 0) ii. For any integer x and any positive integer n, if n x, then n (x + 3n) TRUE. (n x and n 3n, therefore n (x + 3n) theorem in class/test) iii. 311 299 (mod 6) TRUE. (because 6 (311-299)) iv. gcd(16,18) = 2. TRUE. (16 = 2 4 and 18 = 2 3 2, greatest common divisor is 2) v. The word AXE is encrypted as DAH by Caesar s cipher. TRUE. (Shift each letter by 3 mod 26) END OF EXAM 5

6

7

8

9