Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

Similar documents
Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)

Packet #1: Logic & Proofs. Applied Discrete Mathematics

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

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.

Predicate Logic. Andreas Klappenecker

Exam Practice Problems

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

Logic, Sets, and Proofs

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

(1) Which of the following are propositions? If it is a proposition, determine its truth value: A propositional function, but not a proposition.

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

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

CSE 1400 Applied Discrete Mathematics Definitions

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

MAT 243 Test 1 SOLUTIONS, FORM A

MATH 3300 Test 1. Name: Student Id:

Math 564 Homework 1. Solutions.

Discrete Structures: Sample Questions, Exam 2, SOLUTIONS

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

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

(a) We need to prove that is reflexive, symmetric and transitive. 2b + a = 3a + 3b (2a + b) = 3a + 3b 3k = 3(a + b k)

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Math 10850, fall 2017, University of Notre Dame

F 2k 1 = F 2n. for all positive integers n.

Practice Exam 1 CIS/CSE 607, Spring 2009

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

CPSC 121 Sample Final Examination December 2013

INFINITY: CARDINAL NUMBERS

Discrete Mathematics Fall 2018 Midterm Exam Prof. Callahan. Section: NetID: Multiple Choice Question (30 questions in total, 4 points each)

Math 230 Final Exam, Spring 2008

MATH 363: Discrete Mathematics

6 Permutations Very little of this section comes from PJE.

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Exam in Discrete Mathematics

CSE 1400 Applied Discrete Mathematics Proofs

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

Background for Discrete Mathematics

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

Exercises 1 - Solutions

Propositional Logic, Predicates, and Equivalence

7.11 A proof involving composition Variation in terminology... 88

Equivalence of Propositions

CSE 20 Discrete Math. Winter, January 24 (Day 5) Number Theory. Instructor: Neil Rhodes. Proving Quantified Statements

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Notation Index. gcd(a, b) (greatest common divisor) NT-16

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

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

Math 230 Final Exam, Spring 2009

Math 267a - Propositional Proof Complexity. Lecture #1: 14 January 2002

MATH 13 SAMPLE FINAL EXAM SOLUTIONS

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December Points Possible

Reexam in Discrete Mathematics

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

CSE 20 DISCRETE MATH. Fall

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

Predicate Logic: Sematics Part 1

Chapter 1 : The language of mathematics.

MATH 201 Solutions: TEST 3-A (in class)

The Process of Mathematical Proof

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

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

MATH 215 Final. M4. For all a, b in Z, a b = b a.

Meta-logic derivation rules

Mathematical Preliminaries. Sipser pages 1-28

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

MATH FINAL EXAM REVIEW HINTS

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

Complete Induction and the Well- Ordering Principle

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

Theory of Computation

CS280, Spring 2004: Prelim Solutions

Proof Techniques (Review of Math 271)

DISCRETE MATH: FINAL REVIEW

Supplementary Material for MTH 299 Online Edition

Chapter 1. Sets and Numbers

We want to show P (n) is true for all integers

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

Math 210 Exam 2 - Practice Problems. 1. For each of the following, determine whether the statement is True or False.

UNIVERSITY OF VICTORIA DECEMBER EXAMINATIONS MATH 122: Logic and Foundations

Solutions to Homework Set 1

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

can only hit 3 points in the codomain. Hence, f is not surjective. For another example, if n = 4

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

A Guide to Proof-Writing

Review for Midterm 1. Andreas Klappenecker

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel


Mathematical Induction

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

x P(x) x P(x) CSE 311: Foundations of Computing announcements last time: quantifiers, review: logical Inference Fall 2013 Lecture 7: Proofs

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Transcription:

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007) Problem 1: Specify two different predicates P (x) and Q(x) over the set of positive integers so that the proposition x (P (x) Q(x)) is false while x (P (x) Q(x)) is true. Your answer should contain a clear definition of the predicates P (x) and Q(x) and an explanation of why, for your choice of predicates, x (P (x) Q(x)) is false and x (P (x) Q(x)) is true. Let P (x) denote the predicate x is divisible by 3 and let Q(x) denote the predicate x is divisible by 7. The universe for both the predicates is the set of positive integers. Here, the proposition x (P (x) Q(x)) is false. The reason is that an integer x need not be divisible by both 3 and 7. (For example, 3 is not divisible by 7.) However, the proposition x (P (x) Q(x)) is true since we can choose x = 21 which is divisible by both 3 and 7. Problem 2: Suppose p, q and r are propositions such that p q, ( p) r and r (p q) are all true. Show that q is true. We will use a proof by contradiction. So, suppose q is false. (1) Note that p q is true; that is, p q is true. Since q is false, we must conclude that p is true; that is, p is false. (2) Since p is true (from (1)) and ( p) r is true (given), r is true (by modus ponens). (3) Since r is true (from (2)) and r (p q) is true (given), p q is true (by modus ponens). (4) However, p is false (from (1)) and q is false by our assumption. So, p q is false. This contradicts the conclusion in (3) that p q is true. Thus, q must be true. Problem 3: Recall that a binary propositional operator is associative if for all propositions a, b and c, the propositional forms a (b c) and (a b) c have the same truth value. Also recall that the NAND operator ( ) is defined by a b (a b). Is the NAND operator associative? Justify your answer. The NAND operator is not associative. To see this, consider the case where a = b = 1 and c = 0. The truth values of a (b c) and (a b) c are computed below. (i) a (b c) 1 (1 0) 1 1 0. (ii) (a b) c (1 1) 0 0 0 1. Thus, a (b c) and (a b) c have different truth values. So, NAND is not associative. 1

Problem 4: Suppose A and B are sets such that A = 6, B = 2 and A B = 1. Calculate P(A B). (Recall that for a set X, P(X) denotes the powerset of X.) By the inclusion-exclusion formula, A B = A + B A B = 6 + 2 1 = 7. Recall that for any finite set X, P(X) = 2 X. Therefore, P(A B) = 2 7 = 128. Problem 5: Let A = {1, 2, 3, 4} and B = {a, b, c, d, e}. How many functions from A to B are either one-to-one or map the element 1 to c? (You need not simplify your answer.) Let S 1 denote the set of functions from A to B which are one-to-one and let S 2 denote the set of functions from A to B which map the element 1 to c. The required answer to the problem is S 1 S 2. We will compute this number using the inclusion-exclusion formula: S 1 S 2 = S 1 + S 2 S 1 S 2. (a) S 1 is the number of one-to-one functions from A to B. In constructing such a function, there are 5 choices for the element 1, 4 choices for the element 2, 3 choices for the element 3 and 2 choices for the element 4. So, S 1 = 5 4 3 2 = 120. (b) S 2 is the number of functions from A to B that map the element 1 to c. In constructing such a function, there is only one choice for the element 1 but there are 5 choices for each of the three remaining elements of A. So, S 2 = 5 5 5 = 5 3 = 125. (c) S 1 S 2 is the number of functions from A to B which are one-to-one and which map the element 1 to c. In constructing such a function, there are is only one choice for the element 1, 4 choices for the element 2, 3 choices for the element 3 and 2 choices for the element 4. So, S 1 S 2 = 4 3 2 = 24. Thus, using the inclusion-exclusion formula, the required answer is 120 + 125 24 = 221. Problem 6: Let X = {a, b, c, d, e}. Let us call a binary relation R on X special if it satisfies all of the following conditions: (i) R is reflexive, (ii) R is symmetric and (iii) R contains the pair (a, b). Find the number of special binary relations on X. You need not simplify your answer. Every binary relation on X can be represented by a 5 5 Boolean matrix. There are 25 entries in this matrix, with 5 entries along the main diagonal, 10 entries above the diagonal and 10 entries below the diagonal. Since the relation is required to be reflexive, there is only one choice (namely, the value 1) for each entry along the diagonal. Since the relation is required to be symmetric, once we choose a 0 or 1 value for each of the 10 entries above the diagonal, the 10 entries below the diagonal are determined; that is, there is only one choice for each of those entries. Of the 10 entries above the diagonal, one entry corresponding to (a, b) must be 1 (since the relation must contain that pair). Thus, only 9 entries in the Boolean matrix have two choices each. All other entries have only one choice. So, the number of special relations = 2 9. (This expression can be simplified to 512.) 2

Problem 7: Let Y = {1, 2, 3, 4}. Consider the binary relation R on Y defined by Find the transitive closure of R. R = {(1, 2), (2, 1), (2, 3), (2, 4), (4, 3), (4, 4)}. The directed graph of the binary relation R is shown below. 1 2 3 4 Recall that the transitive closure of R contains each pair (x, y) such that there is a directed path of length 1 from x to y in the above graph. Thus, the transitive closure of R is given by {(1, 1), (1, 2), (1, 3), (1, 4), (2, 1), (2, 2), (2, 3), (2, 4), (4, 3), (4, 4)}. Problem 8: Let N + denote the set of positive integers (i.e., integers that are strictly greater than 0). Consider the function f from N + to N + defined as follows: f(x) = 1+ the number of 9 s in the decimal representation of x. For example, f(1) = 1, f(293) = 2, f(1929) = 3. 1. Is f one-to-one? Justify your answer. 2. Is f onto? Justify your answer. Part (a): f is not one-to-one. To see this, notice that f(1) = f(2) = 1; that is, two different elements of N + are mapped by f to the same element of N +. So, f is not one-to-one. Part (b): f is onto. To prove this statement, we must show that for any integer y N +, there is an integer x N + such that f(x) = y. There are two cases. Case 1: y = 1. For this case, let x = 1. From the definition of f, we have f(x) = f(1) = 1 = y. Case 2: y 2. For this case, let x be the decimal integer that consists of y 1 occurrences of the digit 9. (For example, if y = 3, we let x = 99.) Since y 2, this integer is well defined; it has at least one 9. Again, by the definition of f, f(x) = 1 + y 1 = y. Thus, for any integer y N +, there is an integer x N + such that f(x) = y. In other words, f is onto. 3

Problem 9: Let R denote the set of real numbers. Consider the function f from R R to R R defined by f(x, y) = (x + y, x y). Find f 1. (You may assume without proof that f is a bijection.) For any (a, b) R R, let f 1 (a, b) = (x, y). Thus, to specify f 1, we need to do the following: given a and b, find the values of x and y. By the definition of inverse, we have f(x, y) = (a, b). However, by the definition of f, we have f(x, y) = (x + y, x y). Therefore, we have two linear equations x + y = a and x y = b for the variables x and y. Solving the two linear equations, we get In other words, f 1 is defined by x = (a + b)/2 and y = (a b)/2. f 1 (a, b) = ( (a + b)/2, (a b)/2 ). Problem 10: Find the number of solutions to the equation x 1 + x 2 + x 3 + x 4 + x 5 = 37, where x 1, x 2, x 3, x 4 and x 5 are non-negative integers, x 2 8, x 3 7, x 4 2 and x 5 < 4. (You may leave the answer as an expression consisting of binomial coefficients.) To solve this problem, we will use the fact that the number of solutions to the equation z 1 + z 2 +... + z r = q where z 1, z 2,..., z r and q are all non-negative integers, is = C(q + r 1, r 1). To handle the constraints on x 2, x 3 and x 4, first define new variables y 2 = x 2 8, y 3 = x 3 7 and y 4 = x 4 2. Since x 2 8, x 3 7 and x 4 2, we have y 2 0, y 3 0 and y 4 0. Substituting for x 2, x 3 and x 4 in terms of y 2, y 3 and y 4 respectively in the given equation, we get x 1 + y 2 + y 3 + y 4 + x 5 = 37 8 7 2 = 20 (1) Let N 1 denote the number of solutions to Equation (1) where each of the variables is a non-negative integer. Using the formula mentioned above, N 1 = C(20 + 5 1, 5 1) = C(24, 4). In some of these solutions, x 5 satisfies the condition x 5 < 4 while in others, x 5 4. So, if we find the number of solutions, say N 2, where x 5 4, then the required solution to the problem is N 1 N 2. To find N 2, we proceed in a manner similar to that of N 1. Define a new variable y 5 = x 5 4. Thus, when x 5 4, y 5 0. We substitute for x 5 in terms of y 5 in Equation (1) to get the equation x 1 + y 2 + y 3 + y 4 + y 5 = 20 4 = 16 (2) The number of solutions N 2 to Equation (2) where each variable is a non-negative integer is = C(16 + 5 1, 5 1) = C(20, 4). Therefore, the required answer is N 1 N 2 = C(24, 4) C(20, 4). 4

Problem 11: Recall that a bit string is a string composed of characters 0 and 1. Let us call a bit string s interesting if it satisfies all of the following conditions: (i) s has length 23, (ii) s starts with 1110, (iii) s ends with with 00110 and (iv) s has 0 as its middle bit. Find the number of bit strings that are interesting. (You need not simplify your answer.) There are 23 positions in the string. Of these, 10 positions (namely, the first 4, the last 5 and the middle bit) have specified values. For each of the remaining 13 positions, we have two choices (namely, 0 or 1). So, the number of interesting bit strings = 2 13. (This expression can be simplified to 8192.) Problem 12: Use induction on n to prove the following for all n 2: If A 1, A 2,..., A n are subsets of a universal set U, then A 1 A 2... A n = A 1 A 2... A n. You can assume without proof that for any two subsets X and Y of the universal set U, X Y = X Y. Proof: Basis: n = 2. For any two sets A 1 and A 2, the problem allows us to assume that A 1 A 2 = A 1 A 2. Thus, the basis holds. Induction Hypothesis: A 1, A 2,..., A k, Assume that for some integer k 2, and any collection of k sets A 1 A 2... A k = A 1 A 2... A k (3) To prove: For any collection of k + 1 sets A 1, A 2,..., A k+1, A 1 A 2... A k A k+1 = A 1 A 2... A k A k+1 (4) Proof: Consider any collection of k + 1 sets A 1, A 2,..., A k+1. Let X = A 1 A 2... A k. Consider the two sets X and A k+1. By the given assumption for two sets, we have X A k+1 = X A k+1 (5) Now, by the definition of X, X = A 1 A 2... A k. Therefore, we can apply the inductive hypothesis (Equation (3)) to X to get X = A 1 A 2... A k (6) Substituting the result of Equation (6) in Equation (5), we get Again, using the definition of X in Equation (7), we get as required. This completes the proof. X A k+1 = A 1 A 2... A k A k+1 (7) A 1 A 2... A k A k+1 = A 1 A 2... A k A k+1 (8) 5