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

Similar documents
Review 3. Andreas Klappenecker

Review 1. Andreas Klappenecker

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

Review for Midterm 1. Andreas Klappenecker

CSCE 222 Discrete Structures for Computing

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

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

Propositional Logic, Predicates, and Equivalence

Predicate Logic. Andreas Klappenecker

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Equivalence of Propositions

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

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

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Chapter 1 : The language of mathematics.

Written Homework #1: Analysis of Algorithms

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

HANDOUT AND SET THEORY. Ariyadi Wijaya

COMP1002 exam study sheet

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

MATH 363: Discrete Mathematics

Logic, Sets, and Proofs

Background for Discrete Mathematics

Math 13, Spring 2013, Lecture B: Midterm

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

Automata Theory and Formal Grammars: Lecture 1

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Do not start until you are given the green signal

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

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

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

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

MAT115A-21 COMPLETE LECTURE NOTES

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Functions. Given a function f: A B:

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

0 Sets and Induction. Sets

Intro to Logic and Proofs

Contribution of Problems

Mat 243 Exam 1 Review

Chapter 2 - Basics Structures

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

MATH 13 SAMPLE FINAL EXAM SOLUTIONS

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

Math 10850, fall 2017, University of Notre Dame

CSE 1400 Applied Discrete Mathematics Proofs

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

Functions and cardinality (solutions) sections A and F TA: Clive Newstead 6 th May 2014

COT3100 SI Final Exam Review

D I S C R E T E M AT H E M AT I C S H O M E W O R K

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Math 3336: Discrete Mathematics Practice Problems for Exam I

MATH 2200 Final Review

1 Basic Combinatorics

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

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

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

MATH 2200 Final LC Review

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

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

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

MTH202 Discrete Mathematics

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

Lecture 2. Fundamentals of the Analysis of Algorithm Efficiency

FOUNDATIONS & PROOF LECTURE NOTES by Dr Lynne Walling

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

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

MTH 299 In Class and Recitation Problems SUMMER 2016

Math 109 September 1, 2016

MATH 2001 MIDTERM EXAM 1 SOLUTION

CPSC 121: Models of Computation

Homework 1 Submission

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

CIS Spring 2018 (instructor Val Tannen)

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

Lecture 10: Everything Else

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

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

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

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

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

Computer Science Foundation Exam

Announcements. CS243: Discrete Structures. Sequences, Summations, and Cardinality of Infinite Sets. More on Midterm. Midterm.

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

Propositional Logic. Fall () Propositional Logic Fall / 30

Math 4603: Advanced Calculus I, Summer 2016 University of Minnesota Notes on Cardinality of Sets

The Logic of Compound Statements cont.

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

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

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

Introduction to Algorithms

3.1 Asymptotic notation

5 Set Operations, Functions, and Counting

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

Discrete Structures for Computer Science: Counting, Recursion, and Probability

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

Transcription:

CSCE 222 Discrete Structures for Computing Review for the Final! Hyunyoung Lee! 1

Final Exam Section 501 (regular class time 8:00am) Friday, May 8, starting at 1:00pm in our classroom!! Section 502 (regular class time 11:10am) Thursday, May 7, starting at 3:00pm in our classroom 2

Topics - Logic and Proofs (Chapter 1) - Sets and Functions (Chapter 2) - Algorithms and their Complexity (Chapter 3) - Induction and Recursion (Chapter 5) - Counting (Chapter 6) - Solving Recurrences (Chapter 8) - Relations (Chapter 9) - Models of Computation (Chapter 13) 3

Strategy for Exam Preparation - Start studying now (unless have already started)! - Study class notes and make sure you know your definitions! - Review homework, quizzes/in-class exercises - Study the examples in the textbook - Do odd numbered exercises - Bring a scantron: 8x11 gray 4

Logical Connectives - Summary Let B={t,f}. Assign to each connective a function M: B->B that determines its semantics.!!!!! y if P M (P ) f t t f is false. P Q M (P, Q) M (P, Q) M (P, Q) M (P, Q) M (P, Q) f f f f f t t f t f t t t f t f f t t f f t t t t f t t 5

Conditional Perhaps the most important logical connective is the conditional, also known as implication: p -> q The statement asserts that q holds on the condition that p holds. We call p the hypothesis or premise, and q the conclusion or consequence. Typical usage in proofs: If p, then q ; p implies q ; q when p ; q follows from p p is sufficient for q ; a sufficient condition for q is p ; a necessary condition for p is q ; q is necessary for p 6

Logical Equivalence Two statements involving quantifiers and predicates are logically equivalent if and only if they have the same truth values no matter which predicates are substituted into these statements and which domain is used. We write A B for logically equivalent A and B. You use logical equivalences to derive more convenient forms of statements. Example: De Morgan s laws. 7

De Morgan s Laws xp (x) x P (x) xp (x) x P (x) (p q) p q (p q) p q 8

Valid Arguments An argument in propositional logic is a sequence of propositions that end with a proposition called conclusion. The argument is called valid if the conclusion follows from the preceding statements (called premises).! In other words, in a valid argument it is impossible that all premises are true but the conclusion is false. 9

Modus Ponens The tautology (p (p->q)) -> q is the basis for the rule of inference called modus ponens. p p -> q ------- q 10

Modus Tollens q p -> q ------ p! The University will not close on Wednesday. If it snows on Wednesday, then the University will close. Therefore, It will not snow on Wednesday 11

Example Formal Argument Argument p q r p r s s t ) t 1) p q 2) p 3) r p 4) r 5) r s 6) s 7) s t 8) t Hypothesis Simplification of 1) Hypothesis Modus tollens using 2) and 3) Hypothesis Modus ponens using 4) and 5) Hypothesis Modus ponens using 6) and 7) 12

Proofs Direct Proof Proof by Contradiction Proof by Induction - weak induction - strong induction - structural induction - transfinite induction (= induction over well-ordered sets) 13

Set Theory You should be familiar with - the builder notation - subsets, equality of sets - union, intersection, set difference, complement - cartesian product, power set - cardinality of sets (when is A <= B?) 14

De Morgan s Laws A \ B = A [ B Proof : A \ B = {x x 62 A \ B} by definition of complement = {x (x2a \ B)} = {x (x2a^x2b)} by definition of intersection = {x (x2a) _ (x 2 B)} de Morgan s law from logic = {x (x 62 A) _ (x 62 B)} by definition of 62 = {x x 2 A _ x 2 B} by definition of complement = {x x 2 A [ B} by definition of union = A [ B 15

Functions Let f: A -> B be a function. We call - A the domain of f and - B the codomain of f. The range of f is the set f(a) = { f(a) a in A } 16

Functions Let A and B be sets. Consider a function f: A-> B. - When is f surjective? - When is f injective? - When is f bijective? 17

Floor and Ceiling Functions The floor function : R -> Z assigns to a real number x the largest integer <= x. The ceiling function : R -> Z assigns to a real number x the smallest integer >= x. 3.2 = 3 and 3.2 = 4-3.2 = -4 and -3.2 = -3 18

Basic Facts We have x = n if and only if n <= x < n+1. We have x =n if and only if n-1< x <= n. We have x = n if and only if x-1 < n <= x. We have x =n if and only if x<= n < x+1. 19

Example Prove or disprove: b p bxcc = b p xc 20

Example 3 p Let m = b bxcc p Hence, m apple bxc <m+1 Thus, m 2 applebxc < (m + 1) 2 It follows that m 2 apple x<(m + 1) 2 Therefore, m apple p x<m+1 Thus, we can conclude that m = b p xc This proves our claim. 21

Series and Sums You need to know - sequence notations - important sequences - summation notation - geometric sum - sum of first n positive integers 22

Geometric Series Extremely useful! If a and r 6= 0 are real numbers, then nx j=0 ar j = ( ar n+1 a r 1 if r 6= 1 (n + 1)a if r =1 Proof: The case r = 1 holds, since ar j = a for each of the n + 1 terms of the sum. The case r 6= 1 holds, since (r 1) P nx n j=0 arj = and dividing by (r = j=0 n+1 X j=1 ar j+1 ar j n X j=0 X n j=0 ar j = ar n+1 a 1) yields the claim. ar j

Extremely useful! Sum of First n Positive Integers. For all n 1, we have nx k = n(n + 1)/2 k=1 We prove this by induction. Basis step: For n = 1, we have 1X k = 1 = 1(1 + 1)/2. k=1 24

Sum of First n Positive Integers (Cont.) Induction Hypothesis: We assume that the claim holds for n 1. Induction Step: Assuming the Induction Hypothesis, we will show that the claim holds for n. P n k=1 k = n + P n 1 k=1 k = 2n/2 +(n 1)n/2 by Induction Hypothesis = 2n+n2 n 2 = n(n+1) 2 Therefore, the claim follows by induction on n. 25

Infinite Geometric Series Let x be a real number such that x < 1. Then 1X k=0 x k = 1 1 x. 26

Asymptotic Notations You need to know - big Oh notation - big Omega notation - big Theta notation - be able to prove that f = O(g),... - be able to show that O(g)=O(h) 27

Big Oh Notation Let f,g: N -> R be functions from the natural numbers to the set of real numbers.! We write f O(g) if and only if there exists some real number n 0 and a positive real constant U such that f(n) <= U g(n) for all n satisfying n >= n 0 28

Big Ω We define f(n) = Ω(g(n)) if and only if there exists a constant L and a natural number n 0 such that L g(n) <= f(n) holds for all n >= n 0.! In other words, f(n) = Ω(g(n)) if and only if g(n) = O(f(n)). 29

Big Θ We define f(n) = Θ(g(n)) if and only if there exist constants L and U and a natural number n 0 such that L g(n) <= f(n) <= U g(n) holds for all n >= n 0.! In other words, f(n) = Θ(g(n)) if and only if f(n) = Ω(g(n)) and f(n) = O(g(n)). 30

Counting You need to know - the basic counting principles (product rule, sum rule, subtraction rule, ) - (generalized) pigeonhole principle - permutations and combinations - binomial coefficients - binomial theorem - Pascal s identity 31

Pigeonhole Principle In any cocktail party n >=2 people, there must be at least two people who have the same number of friends (assuming that the friends relation is symmetric and irreflexive). The number of friends of each person ranges between 0 and n-1. Case 1: Everyone has at least one friend. If everyone has at least one friend, then each person has between 1 to n-1 friends. Since we have n people, and just n-1 different values, there must be two partygoers that have the same number of friends by the pigeonhole principle. Case 2: Someone has no friends. If someone lacks any friends, then that person is a stranger to all other guests. Because friend is symmetric, the highest value anyone else could have is n - 2, that is, everyone has between 0 to n 2 friends. Since we have n people, and just n-1 different values, there must be two partygoers that have the same number of friends by the pigeonhole principle.

Solving Recurrences You need to be able to solve recurrences - by solving characteristic equations (e.g., for homogeneous linear recurrences of degree 2) - by using generating functions - by using iteration method - by inspecting, guessing, and verifying a solution 33

Relations You need to know - the basic properties of relations (reflexive, symmetric, antisymmetric, transitive,...) - how to show that a relation is an equivalence relation - the congruence mod m relation - how to show that a relation is a partial order - what is lattice, how to show that an order is lattice 34

Formal Languages You need to - be familiar with the Chomsky Hierarchy - be able to tell what type a given language or grammar is - be able to determine the language associated with a grammar (or vice versa) - be able to construct finite state machines and finite state automata - know the characterization of regular languages as languages accepted by finite state automata or languages described by regular expressions 35

Hints Read the lecture slides and the textbook, carefully studying the examples. Study quizzes/in-class exercises, homeworks, two midterm exams. Drill using odd numbered exercises.! Get enough sleep!! 36