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

slogURL.txt

➔ 393 / 447 submitted ➔ can still submit on MarkUS if you haven’t. ➔ can still fix it if you did it wrong

◆ a plain TXT file: slogURL.txt

  • NOT slogURL.pdf, slogURL.doc, slogURL.txt.pdf, slogURL.txt.

doc, or PDF/DOC renamed to TXT ◆ Submit individually

  • If you formed a group with more than one person, email

Danny and me with both of your URLs.

slide-4
SLIDE 4

Assignment 1 is out

http://www.cdf.toronto.edu/~heap/165/F14/Assignments/a1.pdf

➔ Due on October 3rd, 10:00pm. ➔ May work in groups of up to 3 people. ➔ Submit on MarkUs: a1.pdf ➔ Prefer to use LaTeX, try the following tools

◆ www.writelatex.com ◆ www.sharelatex.com

slide-5
SLIDE 5

Today’s agenda

➔ More elements of the language of Math

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

slide-6
SLIDE 6

Lecture 3.1 Conjunctions, Disjunctions

Course Notes: Chapter 2

slide-7
SLIDE 7

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-8
SLIDE 8

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)

predicates!

slide-9
SLIDE 9

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

slide-10
SLIDE 10

Conjunction (AND, ∧)

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

slide-11
SLIDE 11

What are R, F, R ∩ F

slide-12
SLIDE 12

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

slide-13
SLIDE 13

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.

There is a pen-phone!

slide-14
SLIDE 14

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-15
SLIDE 15

Be careful, even in math

The solutions are x < 20 and x > 10.

A B

A ∩ B

The solutions are x > 20 and x < 10.

A ∪ B

A B

slide-16
SLIDE 16

Disjunction

slide-17
SLIDE 17

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-18
SLIDE 18

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

slide-19
SLIDE 19

Disjunction (OR, ∨)

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

slide-20
SLIDE 20

What are R, F, R ∪ F

slide-21
SLIDE 21

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

slide-22
SLIDE 22

Be careful with English “or”

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

“exclusive or”, not “or”!

slide-23
SLIDE 23

Summary

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

slide-24
SLIDE 24

Quick test

A logician’s wife is having a baby. The doctor immediately hands the newborn to the dad. His wife asks impatiently: “So, is it a boy or a girl?” The logician replies: “Yes.”

Source: “21 jokes for super smart people.”

http://www.buzzfeed.com/tabathaleggett/jokes-youll-only-get-if-youre-really-smart#1ml5j1x

slide-25
SLIDE 25

Lecture 3.2 Negations

Course Notes: Chapter 2

slide-26
SLIDE 26

Negation (NOT, ¬)

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

slide-27
SLIDE 27

Negation (NOT, ¬)

Not all red cars are Ferrari. There exists a car that is red and not Ferrari. equivalent

slide-28
SLIDE 28

Exercise: Negate-it!

slide-29
SLIDE 29

Exercise: Negate-it!

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

NO GOOD! GOOD!

slide-30
SLIDE 30

Exercise: Negate-it!

All cars are red.

NEG

Not all cars are red. There exists a car that is not red.

slide-31
SLIDE 31

Exercise: Negate-it!

There exists a car that is red.

NEG

There does not exists a car that is red. All cars are not red.

slide-32
SLIDE 32

Exercise: Negate-it!

Every red car is a Ferrari.

NEG

Not every red car is a Ferrari. There is a car that is red and not a Ferrari.

slide-33
SLIDE 33

Exercise: Negate-it!

There exists a car that is red and Ferrari.

NEG There does not exists a car that is red and Ferrari. For all cars, if it is red, then it is not Ferrari.

slide-34
SLIDE 34

Exercise: Negate-it!

There exists a car that is red and Ferrari.

NEG There does not exists a car that is red and Ferrari. For all cars, it is red, then it is not Ferrari. For all cars, it is Ferrari, then it is not red.

slide-35
SLIDE 35

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-36
SLIDE 36

Exercise: Negate-it!

NEG

slide-37
SLIDE 37

Scope

slide-38
SLIDE 38

Parentheses are important!

NO GOOD! GOOD! GOOD!

slide-39
SLIDE 39

Scope inside parentheses

Everything happens in parentheses stays in parentheses.

is the same as

slide-40
SLIDE 40

Summary

➔ Negations

◆ understand them in human language ◆ practice is the key!

➔ Parentheses

◆ use them properly to avoid ambiguity

slide-41
SLIDE 41

Lecture 3.3 Truth tables, and some laws

Course Notes: Chapter 2

slide-42
SLIDE 42

About visualization...

P Q

Venn diagram works pretty well… ... for TWO predicates.

slide-43
SLIDE 43

What if we have 3 predicates?

P Q R

slide-44
SLIDE 44

What if we have 4 predicates?

slide-45
SLIDE 45

What if we have 5 predicates?

slide-46
SLIDE 46

What if we have 20 predicates?

There must be a better way!

slide-47
SLIDE 47

It’s called the truth table

slide-48
SLIDE 48

Truth table with 2 predicates

Enumerate the outputs over all possible combinations of input values of P and Q.

2² = 4

INPUTS OUTPUTS

How many rows are there?

slide-49
SLIDE 49

Truth table with 3 predicates

How many rows are there?

2³ = 8

slide-50
SLIDE 50

Truth table with 20 predicates

2²⁰ rows It’s not a mess, it just a larger table, which computers can process easily!

slide-51
SLIDE 51

What can truth tables be used for?

slide-52
SLIDE 52

for evaluating expressions

slide-53
SLIDE 53

P Q P ∧ Q P ∧ ¬P P ∨ ¬P T T T F F T F F satisfiable unsatisfiable (contradiction) T F F F F F F F

for determining satisfiability

tautology (universal truth) T T T T It’s a boy and it’s not a boy. It’s a boy or it’s not a boy.

slide-54
SLIDE 54

P Q ¬P ∨ Q P => Q T T T F F T F F T F T T T F T T

for proving equivalence

slide-55
SLIDE 55

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

for proving equivalence

We just proved De Morgan’s Law!

slide-56
SLIDE 56

De Morgan’s Law

slide-57
SLIDE 57

Augustus De Morgan (1806-1871) ➔ De Morgan’s Law ➔ Mathematical Induction

slide-58
SLIDE 58

there are more laws...

slide-59
SLIDE 59

Other laws

Commutative laws

slide-60
SLIDE 60

Other laws

Associative laws

slide-61
SLIDE 61

Other laws

Distributive laws

slide-62
SLIDE 62

Other laws

Identity laws

always true always false

slide-63
SLIDE 63

Other laws

Idempotent laws

slide-64
SLIDE 64

Other laws

For a full list of laws to be used in CSC165, read Chapter 2.17 of Course Notes.

slide-65
SLIDE 65

About these laws...

➔ Similar to those for arithmetics. ➔ Only use when you are sure. ➔ Understand them, be able to verify them, rather than memorizing them. ➔ Practice is the key!

slide-66
SLIDE 66

Summary for today

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

slide-67
SLIDE 67

Next week

➔ finish learning the language ➔ start learning proofs