Final practice CS1050: Understanding and Constructing Proofs

Slides:



Advertisements
Similar presentations
February 26, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers Example: Add a = (1110) 2 and b = (1011) 2. a 0 + b.
Advertisements

Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Having Proofs for Incorrectness
CSE115/ENGR160 Discrete Mathematics 01/26/12 Ming-Hsuan Yang UC Merced 1.
CS128 – Discrete Mathematics for Computer Science
CSE115/ENGR160 Discrete Mathematics 02/01/11
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
February 25, 2002Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers How do we (humans) add two integers? Example: 7583.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
Propositional Proofs 2.
1 Methods of Proof CS/APMA 202 Epp, chapter 3 Aaron Bloomfield.
Review I Rosen , 3.1 Know your definitions!
CSci 2011 Discrete Mathematics Lecture 6
1 Methods of Proof. 2 Consider (p  (p→q)) → q pqp→q p  (p→q)) (p  (p→q)) → q TTTTT TFFFT FTTFT FFTFT.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Discrete Structures (DS)
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Mathematical Preliminaries
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
CSci 2011 Discrete Mathematics Lecture 5 CSci 2011.
Chapter 1 Logic and proofs
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Advanced Algorithms Analysis and Design
Discrete Mathematics Lecture 1 Logic of Compound Statements
CSE15 Discrete Mathematics 01/30/17
Discrete Mathematics Logic.
Proof methods We will discuss ten proof methods: Direct proofs
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
August 31, 2005.
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Methods of Proof CS 202 Epp, chapter 3.
Proof Techniques.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Rules of Inference Section 1.6.
Explorations in Artificial Intelligence
Module #10: Proof Strategies
2 Chapter Introduction to Logic and Sets
CS100: Discrete structures
Information Technology Department
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
Methods of Proof. Methods of Proof Definitions A theorem is a valid logical assertion which can be proved using Axioms: statements which are given.
CSE 311: Foundations of Computing
CS 220: Discrete Structures and their Applications
Applied Discrete Mathematics Week 1: Logic
Propositional Logic.
Inference Rules: Tautologies
Negations of quantifiers
Discrete Mathematics Logic.
Information Technology Department SKN-SITS,Lonavala.
Module #10: Proof Strategies
September 9, 2004 Prof. Marie desJardins (for Prof. Matt Gaston)
Foundations of Discrete Mathematics
CPSC 121: Models of Computation
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Mathematical Reasoning
CS201: Data Structures and Discrete Mathematics I
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Presentation transcript:

Final practice CS1050: Understanding and Constructing Proofs Spring 2006 Final practice This work is carried by Jarek Rossignac and one of his PhD students, Jason Williams Jarek Rossignac

Logical operators Sets Propositions Bit strings n for each n n for at least one n  empty set sS s is an element of S sS s is an element of S S, !S elements not in S ST elements in S and T ST elements in S or T S–T ST ST (ST) – (ST) S=T S equals T S  T S included in T S  T S properly in T S  T Cartesian product Propositions T, F true, false ¬p, !p, p not p pq p and q pq p or q p  q, p ≠ q p xor q p  q p implies q p  q, p==q p same as q p  q, p  q p equivalent to q  therefore Bit strings S | T bitwise OR S & T bitwise AND S << n shift left by n bits

Logic When is (pq)  (rs) true? When is (p  q) true? When is “If today is Friday, then 2+3=4” true? What is the contrapositive of (p  q)? Express “You may access the Internet (a) only if you are a computer science major (c) or if you are not a freshman (f).” as a logic statement

Logic Solution When is (pq)  (rs) true? When is (p  q) true? When 1 or 3 are false When is (p  q) true? When q is true and when (q is faslse and p true) When is “If today is Friday, then 2+3=4” true? Everyday except Friday What is the contrapositive of (p  q)? q  p Express “You may access the Internet (a) only if you are a computer science major (c) or if you are not a freshman (f).” as a logic statement (a  c  f)

What is the list of rules of inference? Addition p  pq Simplification pq  p Conjunction (p)(q)  pq Modus ponens p(p q)  q Modus tollens ¬q(p q)  ¬p Hypothetical syllogism (pq)(qr)  (pr) Disjunctive syllogism (pq)¬p  q Resolution (pq)(¬pr)  (qr)

Quantifiers and arguments For what universe of discourse is (x, x<x2) true? G(t) means teacher t is great. Translate “All teachers are great” into logic. Ten write its negation. Assume “If you send me email (p), I will finish the program (q). Otherwise I will go to bed early (r)”. “If I go to bed early, I will wake up happy (s)”. Prove “If I do not finish the program, I will wake up happy”

Quantifiers and arguments solutions For what universe of discourse is (x, x<x2) true? x<0 or x>1 G(t) means teacher t is great. Translate “All teachers are great” into logic. Ten write its negation. t G(t) t G(t) Assume “If you send me email (p), I will finish the program (q). Otherwise I will go to bed early (r)”. “If I go to bed early, I will wake up happy (s)”. Prove “If I do not finish the program, I will wake up happy” p  q Hypothesis ¬q  ¬p Contrapositive ¬p  r Hypothesis ¬q  r Hypothetical Syllogism from 2) and 3) r  s Hypothesis ¬q  s Hypothetical Syllogism

More proofs Prove C from H1 and H2 H1: “If you do all the exercises (p), then you will get an A (q)” H2: “You got an A (q)” C: “You did all the exercises (p)” Prove: “If n is an odd integer, then n2 is an odd integer”

More proofs solutions Prove C from H1 and H2 H1: “If you do all the exercises (p), then you will get an A (q)” H2: “You got an A (q)” C: “You did all the exercises (p)” Cannot! This is a fallacy of affirming the conclusion: (pq)q  p Maybe you got an A because you are a genius! Prove: “If n is an odd integer, then n2 is an odd integer” Suppose that n is odd. Then, there is an integer k such that n=2k+1. Hence, n2=(2k+1)2 = 4k2+4k+1 = 2(2k2+2k) +1 Thus n2 is odd.

Indirect proofs Prove “If 3n+2 is odd, then n is odd” Prove “n integer and n2 odd  n odd”

Indirect proofs solutions Prove “If 3n+2 is odd, then n is odd” Suppose that n not odd (i.e., n is even). Then there is an integer k such that n=2k. Hence, 3n+2 = 3(2k)+2 = 2(3k+1) Thus 3n+2 is not odd. Prove “n integer and n2 odd  n odd” Assume n is even: k n=2k Then n2=2(2k2) Hence n2 is not odd

Sets and CSG C A B What are De-morgan laws Prove A(BC)=(AB)(AC) CSG expression S for the figure Convert S to positive form Compute the path of A Compute the active zone for a primitive Render the active zone A B

Sets and CSG solutions C A B C A B What are De-morgan laws !(AB) = !A!B , !(AB) = !A!B Prove A(BC)=(AB)(AC) CSG expression S for the figure S = A – (B – C) Convert S to positive form S=A(B’+C) Compute the path of A Root Compute the active zone for a primitive Z= B’+C Render the active zone A B C A B

Sorting Code for bubble sort for (i=0; i<n-1; i++) { for (j=0; j<n-1-i; j++) if (a[j+1] < a[j]) { t=a[j]; a[j]=a[j+1]; a[j+1]=t; } // next j } // next i Produce a balanced search tree for 1,3,4,6,7,8,9 and explain the search steps for 5.

Complexity Prove that log2n is O(n) When is a problem tracktable? n < 2n log2n < n log22 = n (taking the log2 on both sides) hence log2n is O(n) When is a problem tracktable? When is it solvable in polynomial time When is a problem NP? When we believe that the problem is not tractable but can check a solution in polynomial time When is a problem NP complete? When it falls in a class of NP problems such that if a polynomial solution exists for one, then there exist polynomial solutions for the others Give an example of an NP complete problem Find whether a Boolean function in n variables can be satisfied

Graphs How to compute the graph-distance from a vertex s? What is the complexity of that algorithm?

Integers Prove that if a divides b and c, it divides their sum a | b  xZ b=xa , a | c  yZ c=ya, b+c=xa+ya=(x+y)a What is the fundamental thorem of arithmetic Every integer greater than 1 can be written uniquely as a product of one or more primes (“divisors”) of non-decreasing size What are (–11 div 3) and (–11 mod 3) ? –4 (a=dq+r with 0≤r<d : –11=3(–4)+1) 1 (a=dq+r with 0≤r<d : –11=3(–4)+1) What is the binary expansion of 241? 11110001 Use the euclidean algorithm to compute gcd(662,414) Use gcd(bq+r,b)=gcd(b,r) gcd(662,414)=gcd(414•1+248,414) gcd(414,248)=gcd(248•1+166, 248) gcd(248,166)=gcd(248=166•1+82 ,166) gcd(166,82)=gcd(82•2+2,82) gcd(82,2)=gcd(2•41+0, 2)= 2

Coordinates and matrices How to change coordinate systems? How to express these changes using matrices?

Change of coordinate system v = p – o x = v  i y = v  j o i j p x y xo yo xi yi yp xp Local Global p = o + xi + yj matrix form with homogeneous coordinates 1 yp xp yo xo yj xj yi xi = y x

Sequences Formulae and sums for arithmetic / geometric progressions

Sequences solutions Formulae and sums for arithmetic / geometric progressions {a+nd}, ∑k=0n(k) = (n+1)n/2 {arn}, ∑k=0n(rk) = (rn+1–1)/(r–1) for r≠1