CSC165 Larry Zhang, September 23, 2014 Tutorial classrooms T0101, - - PowerPoint PPT Presentation

csc165
SMART_READER_LITE
LIVE PREVIEW

CSC165 Larry Zhang, September 23, 2014 Tutorial classrooms T0101, - - PowerPoint PPT Presentation

CSC165 Larry Zhang, September 23, 2014 Tutorial classrooms T0101, Tuesday 9:10am~10:30am: BA3102 A-F (Jason/Jason) BA3116 G-L (Eleni/Eleni) BA2185 M-T (Madina/Madina) BA2175 V-Z (Siamak/Siamak) T0201: Monday


slide-1
SLIDE 1

CSC165

Larry Zhang, September 23, 2014

slide-2
SLIDE 2

Tutorial classrooms

T0101, Tuesday 9:10am~10:30am: BA3102 A-F (Jason/Jason) BA3116 G-L (Eleni/Eleni) BA2185 M-T (Madina/Madina) BA2175 V-Z (Siamak/Siamak) T0201: Monday 7:10~8:30pm BA2175* A-D (Ekaterina/Ekaterina) BA1240* E-Li (Gal/Gal) BA2185* Liang-S (Yana/Adam) BA3116 T-Z (Christina/Nadira) T5101: Thursday 7:10~8:30pm BA3116 A-F (Christine/Christine) BA2135 G-Li (Elias/Elias) BA1200* Lin-U (Yiyan/Yiyan) GB244* V-Z (Natalie/Natalie)

slide-3
SLIDE 3

Today’s agenda

➔ More elements of the language of Math

◆ Conjunctions ◆ Disjunctions ◆ Negations ◆ Truth tables ◆ Manipulation laws

slide-4
SLIDE 4

Lecture 3.1 Conjunctions, Disjunctions

Course Notes: Chapter 2

slide-5
SLIDE 5

Conjunction (AND, ∧)

noun “the action or an instance of two or more events or things occurring at the same point in time or space.” Synonyms: co-occurrence, coexistence, simultaneity.

slide-6
SLIDE 6

Conjunction (AND, ∧)

Combine two statements by claiming they are both true. R(x): Car x is red. F(x): Car x is a Ferrari. R(x) and F(x): Car x is red and a Ferrari. R(x) ∧ F(x)

slide-7
SLIDE 7

Which ones are R(x) ∧ F(x)

slide-8
SLIDE 8

Conjunction (AND, ∧)

As sets (instead of predicates): R: the set of red cars F: the set of Ferrari cars Intersection

slide-9
SLIDE 9

What are R, F, R ∩ F

slide-10
SLIDE 10

➔ Using predicates: R(x) ∧ F(x) ➔ Using sets: R ∩ F

slide-11
SLIDE 11

Be careful with English “and”

There is a pen, and a telephone. O: the set of all objects P(x): x is a pen. T(x): x is a telephone.

slide-12
SLIDE 12

Be careful, even in math

The solutions are x < 20 and x > 10. The solutions are x > 20 and x < 10.

slide-13
SLIDE 13

Disjunction

slide-14
SLIDE 14

Disjunction (OR, ∨)

Combine two statements by claiming that at least one of them is true. R(x): Car x is red. F(x): Car x is a Ferrari. R(x) or F(x): Car x is red or a Ferrari. R(x) ∨ F(x)

slide-15
SLIDE 15

Which ones are R(x) ∨ F(x)

slide-16
SLIDE 16

Disjunction (OR, ∨)

As sets (instead of predicates): R: the set of red cars F: the set of Ferrari cars Union

slide-17
SLIDE 17

What are R, F, R ∪ F

slide-18
SLIDE 18

➔ Using predicates: R(x) ∨ F(x) ➔ Using sets: R ∪ F

slide-19
SLIDE 19

Be careful with English “or”

Either we play the game my way, or I’m taking my ball and going home.

slide-20
SLIDE 20

Summary

➔ Conjunction: AND, ∧, ∩ ➔ Disjunction: OR, ∨, ∪

slide-21
SLIDE 21

Lecture 3.2 Negations

Course Notes: Chapter 2

slide-22
SLIDE 22

Negation (NOT, ¬)

All red cars are Ferrari. C: set of all cars negation

slide-23
SLIDE 23

Negation (NOT, ¬)

Not all red cars are Ferrari. equivalent

slide-24
SLIDE 24

Exercise: Negate-it!

slide-25
SLIDE 25

Exercise: Negate-it!

Rule: the negation sign should apply to the smallest possible part of the expression.

NO GOOD! GOOD!

slide-26
SLIDE 26

Exercise: Negate-it!

All cars are red.

NEG

slide-27
SLIDE 27

Exercise: Negate-it!

There exists a car that is red.

NEG

slide-28
SLIDE 28

Exercise: Negate-it!

Every red car is a Ferrari.

NEG

slide-29
SLIDE 29

Exercise: Negate-it!

There exists a car that is red and Ferrari.

NEG

slide-30
SLIDE 30

Some tips

➔ The negation of a universal quantification is an existential quantification (“not all...” means “there is one that is not...”). ➔ The negation of a existential quantification is an universal quantification (“there does not exist...” means “all...are not...”) ➔ Push the negation sign inside layer by layer (like peeling an onion).

slide-31
SLIDE 31

Exercise: Negate-it!

NEG

slide-32
SLIDE 32

Scope

slide-33
SLIDE 33

Parentheses are important!

NO GOOD!

slide-34
SLIDE 34

Scope inside parentheses

slide-35
SLIDE 35

Lecture 3.3 Truth tables

Course Notes: Chapter 2

slide-36
SLIDE 36

It’s about visualization...

P Q

Venn diagram works pretty well… … for TWO predicates.

slide-37
SLIDE 37

What if we have more predicates?

slide-38
SLIDE 38

Truth table with 2 predicates

Enumerate outcomes of all possible combinations of values of P and Q. How many rows are there?

slide-39
SLIDE 39

Truth table with 3 predicates

How many rows are there?

slide-40
SLIDE 40

P Q P ∧ Q P ∧ ¬P T T T F F T F F

Satisfiable Unsatisfiable

slide-41
SLIDE 41

P Q ¬ (P ∨ Q) ¬P ∧ ¬Q T T T F F T F F

slide-42
SLIDE 42

De Morgan’s Law

slide-43
SLIDE 43

Other laws

Commutative laws

slide-44
SLIDE 44

Other laws

Associative laws

slide-45
SLIDE 45

Other laws

Distributive laws

slide-46
SLIDE 46

Other laws

Identity laws

slide-47
SLIDE 47

Other laws

Idempotent laws

slide-48
SLIDE 48

Other laws

For even more laws, read Chapter 2.17

  • f Course Notes.
slide-49
SLIDE 49

About these laws...

➔ Similar to those for arithmetics. ➔ Only use when you are sure. ➔ Understand them, be able to derive them, rather than memorizing them.

slide-50
SLIDE 50

Summary for today

➔ Conjunctions ➔ Disjunctions ➔ Negations ➔ Truth tables ➔ Manipulation laws ➔ We are almost done with learning the language of math.