CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar...

68
CS 345 Lecture 1 Introduction and Math Review

Transcript of CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar...

Page 1: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

CS 345Lecture 1

Introduction and Math Review

Page 2: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

CS 345

• Instructor– Qiyam Tung

• TA– Sankar Veeramoni

Page 3: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Administrivia

• Webpage– http://www.cs.arizona.edu/classes/cs345/summer14/

• Syllabus– http://www.cs.arizona.edu/classes/cs345/summer14/syllabus.html

Page 4: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.
Page 5: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sets

• Union

• Intersection

Page 6: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sets (cont’d)

• Membership

• Defining sets– Even numbers

– Odd numbers

Page 7: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sets

• Power set

Page 8: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sequences

• Summation

• Products

Page 9: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Closed form equivalents

• Triangular numbers

• Sum of powers of 2

Page 10: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Logarithms

• Product

• Quotient

Page 11: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Logarithms (cont’d)

• Power

• Change of base

Page 12: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Logical Equivalences

• De Morgan’s Law– Propositions

– Sets

Page 13: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

10 minute break

Page 14: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Proofs• Deductive

• Contrapositive

• Inductive

Page 15: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Proofs (cont’d)• Contradiction

p q ~p p->q ~p V q

Page 16: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Proofs (cont’d)

Page 17: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Deduction (example)Conjecture: If x is even, then 5x is even

Page 18: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Deduction (cont’d)Conjecture: If x is even, then 5x is even

Page 19: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contrapositive (example)Conjecture: If x^2 is odd, then x is odd

Page 20: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contrapositive (cont’d)Conjecture: If x^2 is odd, then x is odd

Page 21: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Inductive (example)Conjecture:

Page 22: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Inductive (cont’d)

Page 23: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Inductive (cont’d)

Page 24: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example 1)Conjecture: There are infinite prime numbers

Page 25: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example 1 cont’d)

Page 26: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example 1 cont’d)

Page 27: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example)Conjecture: The square root of 2 is irrational

Page 28: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (cont’d)

Page 29: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (cont’d)

Page 30: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 1

Page 31: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 2

Page 32: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 3

Page 33: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 4

Page 34: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 5

Page 35: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

CS 345Lecture 1

Introduction and Math Review

Page 36: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

CS 345

• Instructor– Qiyam Tung

• TA– Sankar Veeramoni

Page 37: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Administrivia

• Webpage– http://www.cs.arizona.edu/classes/cs345/summer14/

• Syllabus– http://www.cs.arizona.edu/classes/cs345/summer14/syllabus.html

Page 38: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.
Page 39: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sets

• Union

• Intersection

Page 40: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sets (cont’d)

• Membership

• Defining sets– Even numbers

– Odd numbers

Page 41: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sets

• Power set

Page 42: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Sequences

• Summation

• Products

Page 43: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Closed form equivalents

• Triangular numbers

• Sum of powers of 2

Page 44: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Logarithms

• Product

• Quotient

Page 45: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Logarithms (cont’d)

• Power

• Change of base

Page 46: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Logical Equivalences

• De Morgan’s Law– Propositions

– Sets

Page 47: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

10 minute break

Page 48: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Proofs• Deductive

• Contrapositive

• Inductive

Page 49: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Proofs (cont’d)• Contradiction

p q ~p p->q ~p V q

Page 50: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Proofs (cont’d)

Page 51: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Deduction (example)Conjecture: If x is even, then 5x is even

Page 52: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Deduction (cont’d)Conjecture: If x is even, then 5x is even

Page 53: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contrapositive (example)Conjecture: If x^2 is odd, then x is odd

Page 54: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contrapositive (cont’d)Conjecture: If x^2 is odd, then x is odd

Page 55: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Inductive (example)Conjecture:

Page 56: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Inductive (cont’d)

Page 57: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Inductive (cont’d)

Page 58: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example 1)Conjecture: There are infinite prime numbers

Page 59: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example 1 cont’d)

Page 60: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example 1 cont’d)

Page 61: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (example)Conjecture: The square root of 2 is irrational

Page 62: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (cont’d)

Page 63: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Contradiction (cont’d)

Page 64: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 1

Page 65: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 2

Page 66: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 3

Page 67: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 4

Page 68: CS 345 Lecture 1 Introduction and Math Review. CS 345 Instructor – Qiyam Tung TA – Sankar Veeramoni.

Extra 5