january 29, 2015applied discrete mathematics week 1: logic and sets 1 welcome to cs/math 320l –...

45
January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc Pomplun

Upload: patience-cole

Post on 16-Jan-2016

239 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

1

Welcome to

CS/MATH 320L – Applied Discrete Mathematics

Spring 2015

Instructor: Marc Pomplun

Page 2: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

2

Instructor – Marc PomplunOffice: S-3-171

Lab: S-3-135

Office Hours: Tuesdays 4:00pm – 5:30pm Thursdays 7:00pm – 8:30pm

Phone: 287-6443 (office) 287-6485 (lab)

E-Mail: [email protected]

Website: http://www.cs.umb.edu/~marc/cs320/

Page 3: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

3

The Visual Attention Lab

Eye movement research

Page 4: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

4

The new EyeLink-2K System

Page 5: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

5

Example: Distribution of Visual Attention

Page 6: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

6

Selectivity in Complex Scenes

Page 7: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

7

Selectivity in Complex Scenes

Page 8: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

8

Selectivity in Complex Scenes

Page 9: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

9

Selectivity in Complex Scenes

Page 10: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

10

Selectivity in Complex Scenes

Page 11: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

11

Selectivity in Complex Scenes

Page 12: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

12

Modeling of Brain Functions

Page 13: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

13

Modeling of Brain Functionsunit and connectionin the interpretive network

unit and connectionin the gating network

unit and connectionin the top-down bias network

layer l +1

layer l -1

layer l

Page 14: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

14

Computer Vision:

Page 15: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

15

Human-Computer Interfaces:

Page 16: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

16

Now back to CS 320L:Course Kit: Kenneth H. Rosen, Discrete Mathematics and its Applications7th Edition(Available at the UMB Bookstore)

On the Web:http://www.cs.umb.edu/~marc/cs320/(contains all kinds of course information and also my slides in PDF and PPT formats, updated after each session)

Page 17: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

17

Your Evaluation

• 4 sets of exercises each set 5% 20%

(only individual submissions allowed)

• midterm (75 minutes) 35%

• final exam (2.5 hours) 45%

Page 18: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

18

Grading

95%: A 90%: A-

74%: C+ 70%: C 66%: C-

86%: B+ 82%: B 78%: B-

62%: D+ 56%: D 50%: D-

50%: F

For the assignments, exams and your course grade, the following scheme will be used to convert percentages into letter grades:

Page 19: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

19

Academic DishonestyYou are allowed to discuss problems regarding your homework with other students in the class.

However, you have to do the actual work (computing values, writing algorithms, drawing graphs, etc.) by yourself.

You cannot copy anything from other sources (Wikipedia, other students’ work, etc.)

The first violation will result in zero points for the entire homework or exam (and official notification).

The second violation will result in failing the course.

Page 20: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

20

Complaints about Grading

If you think that the grading of your assignment or exam was unfair,

• write down your complaint (handwriting is OK),• attach it to the assignment or exam, • and give it to me or put it in my mailbox.

I will re-grade the whole exam/assignment and return it to you in class.

Page 21: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

21

Why Care about Discrete Math?

• Digital computers are based on discrete “atoms” (bits).

• Therefore, both a computer’s – structure (circuits) and– operations (execution of algorithms)

can be described by discrete math.

Page 22: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

22

Syllabus • Logic and Set Theory• Functions and Sequences• Algorithms• Applications of Number Theory• Mathematical Reasoning• Counting• Probability Theory• Relations and Equivalence Relations• Graphs and Trees• Boolean Algebra

Page 23: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

23

Mathematical Appetizers

Useful tools for discrete mathematics:

• Logic• Set Theory• Functions• Sequences

Page 24: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

24

Logic• Crucial for mathematical reasoning• Used for designing electronic circuitry

• Logic is a system based on propositions.• A proposition is a statement that is either true or

false (not both).• We say that the truth value of a proposition is

either true (T) or false (F).

• Corresponds to 1 and 0 in digital circuits

Page 25: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

25

The Statement/Proposition Game

“Elephants are bigger than mice.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value

of the proposition? true

Page 26: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

26

The Statement/Proposition Game

“520 < 111”

Is this a statement? yes

Is this a proposition? yes

What is the truth value

of the proposition? false

Page 27: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

27

The Statement/Proposition Game

“y > 5”

Is this a statement? yes

Is this a proposition? no

Its truth value depends on the value of y, but this value is not specified.

We call this type of statement a propositional function or open sentence.

Page 28: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

28

The Statement/Proposition Game

“Today is January 29 and 99 < 5.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value

of the proposition? false

Page 29: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

29

The Statement/Proposition Game

“Please do not fall asleep.”

Is this a statement? no

Is this a proposition? no

Only statements can be

propositions.

It’s a request.

Page 30: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

30

The Statement/Proposition Game

“If elephants were red,

they could hide in cherry trees.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value

of the proposition? probably false

Page 31: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

31

The Statement/Proposition Game

“x < y if and only if y > x.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value

of the proposition? true

… because its truth value does not depend on specific values of x and y.

Page 32: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

32

Combining Propositions

As we have seen in the previous examples, one or more propositions can be combined to form a single compound proposition.

We formalize this by denoting propositions with letters such as p, q, r, s, and introducing several logical operators.

Page 33: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

33

Logical Operators (Connectives)

We will examine the following logical operators:

• Negation (NOT)• Conjunction (AND)• Disjunction (OR)• Exclusive or (XOR)• Implication (if – then)• Biconditional (if and only if)

Truth tables can be used to show how these operators can combine propositions to compound propositions.

Page 34: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

34

Negation (NOT)

Unary Operator, Symbol:

P P

true false

false true

Page 35: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

35

Conjunction (AND)

Binary Operator, Symbol:

P Q PQ

true true true

true false false

false true false

false false false

Page 36: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

36

Disjunction (OR)

Binary Operator, Symbol:

P Q PQ

true true true

true false true

false true true

false false false

Page 37: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

37

Exclusive Or (XOR)

Binary Operator, Symbol:

P Q PQ

true true false

true false true

false true true

false false false

Page 38: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

38

Implication (if - then)

Binary Operator, Symbol:

P Q PQ

true true true

true false false

false true true

false false true

Page 39: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

39

Biconditional (if and only if)

Binary Operator, Symbol:

P Q PQ

true true true

true false false

false true false

false false true

Page 40: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

40

Statements and OperatorsStatements and operators can be combined in any

way to form new statements.

P Q P Q (P)(Q)

true true false false false

true false false true true

false true true false true

false false true true true

Page 41: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

41

Statements and OperationsStatements and operators can be combined in any way

to form new statements.

P Q PQ (PQ) (P)(Q)

true true true false false

true false false true true

false true false true true

false false false true true

Page 42: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

42

Equivalent Statements

P Q (PQ) (P)(Q) (PQ)(P)(Q)

true true false false true

true false true true true

false true true true true

false false true true true

The statements (PQ) and (P)(Q) are logically equivalent,

because (PQ)(P)(Q) is always true.

Page 43: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

43

Tautologies and Contradictions

A tautology is a statement that is always true.

Examples: • R(R)• (PQ)(P)(Q)

If ST is a tautology, we write ST.

If ST is a tautology, we write ST.

Page 44: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

44

Tautologies and Contradictions

A contradiction is a statement that is always

false.

Examples: • R(R)• ((PQ)(P)(Q))

The negation of any tautology is a contra-

diction, and the negation of any contradiction is

a tautology.

Page 45: January 29, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015 Instructor: Marc

January 29, 2015 Applied Discrete Mathematics Week 1: Logic and Sets

45

ExercisesWe already know the following tautology:

(PQ) (P)(Q)

Nice home exercise:

Show that (PQ) (P)(Q).

These two tautologies are known as De Morgan’s laws.