15
Math 51/COEN 19 Dr. Linnell

Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Embed Size (px)

DESCRIPTION

Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Citation preview

Page 1: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Math 51/COEN 19

Dr. Linnell

Page 2: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Who am I?

Page 3: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Who are you?

• What’s your major? Year?• Do you have any programming experience?• Something else about yourself

Page 4: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Logic is the basis of:

• Circuits• Programming• Mathematical proof• Good decision making

Page 5: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Predicate

• A statement that is either true of false• Are these predicates or not?– Joe Biden hates taking out the trash.– Did you take out the trash?– Take out the trash!– Taking out the trash is fun!– Don’t make me make you take out the trash.

Page 6: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Predicate or not?

• 2+4=6• 2+2=5• 3+x=4• x+y=z• 8<6

Page 7: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Predicate or not?

• 2+4=6• 2+2=5• 3+x=4• x+y=z• 8<6

• Mathematical sense of =• We don’t assume variables have values

Page 8: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

NegationEnglish Logic Programming Logic name

not ! negation

• Negation of “Joe Biden loves Prince”

• Negation of the negation?

Page 9: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

ConjunctionEnglish Logic Programming Logic name

and && Conjunction

• Conjunction of “Joe Biden loves Prince”, “Joe Biden hates Kanye West”

Page 10: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Disjunction

• Disjunction of “Joe Biden loves Prince”, “Joe Biden hates Kanye West”

English Logic Programming Logic name

or || Disjunction

Page 11: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Exclusive orEnglish Logic Programming Logic name

or Exclusive or

• xor of “Joe Biden loves Prince”, “Joe Biden hates Kanye West”

Page 12: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Implication

• Implication of “Joe took out the trash”, “Joe can have cake”

English Logic Programming Logic name

if p then qq if pq unless not p

Implication, conditional

Page 13: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Double ImplicationEnglish Logic Programming Logic name

p if and only if qif p then q

if() {}(kind of)

Bidirectional implication

Page 14: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

English Logic Programming Logic name

not ! negation

and && Conjunction

or || Disjunction

or Exclusive or

if-then implication

If and only if if() {} (kind of)

Bidirectional implication

Page 15: Math 51/COEN 19 Dr. Linnell. Who am I? Who are you? What’s your major? Year? Do you have any programming experience? Something else about yourself

Commonly seen conditionals

• p ->q• Converse

• Contrapositive

• Inverse