Top Banner
CS322 Week 1 - Friday
36

Week 1 - Friday. What did we talk about last time? Tautologies Contradictions Laws of Boolean algebra Implications Inverses Converses

Dec 24, 2015

Download

Documents

Lilian Lloyd
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

CS322Week 1 - Friday

Page 2: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Last time

What did we talk about last time? Tautologies Contradictions Laws of Boolean algebra Implications

Inverses Converses Bidirectional

Page 3: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Questions?

Page 4: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Logical warmup

For Diwali, Mr. Patel's five daughters gave each other books as presents.

Each presented four books and each received four books, but no two girls divided her books in the same way.

That is, only one gave two books to one sister and two to another. Bharat gave all her books to Abhilasha; Chandra gave three to Esha.

Who gave how many books to whom?

Page 5: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Necessary and sufficient

One note about implications and wording them: p is a sufficient condition for q means p q p is a necessary condition for q means q p

This nomenclature is a touch counterintuitive Think of it this way:

p q means that p is enough to get you q, but there might be other things that will get you q

q p means that, since you automatically get p when you've got q, there's no way to have q without p

Page 6: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Arguments

Page 7: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Arguments

An argument is a list of statements (called premises) followed by a single statement (called a conclusion)

Whenever all of the premises are true, the conclusion must also be true, in order to make the argument valid

Page 8: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Examples

Are the following arguments valid? p q ~r (premise) q p r (premise) p q (conclusion)

p (q r) (premise) ~r (premise) p q (conclusion)

Page 9: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Common argument tools

Modus ponens is a valid argument of the following form: p q p q

Modus tollens is a contrapositive reworking of the argument, which is also valid: p q ~q ~p

Give verbal examples of each We call these short valid arguments rules of

inference

Page 10: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Generalization

The following are also valid rules of inference: p p q

q p q

English example: “If pigs can fly, then pigs can fly or swans can breakdance.”

Page 11: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Specialization

The following are also valid rules of inference: p q p

p q q

English example: “If the beat is out of control and the bassline just won’t stop, then the beat is out of control.”

Page 12: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Conjunction

The following is also a valid rule of inference: p q p q

English example: “If the beat is out of control and the bassline just won’t stop, then the beat is out of control and the bassline just won’t stop.”

Page 13: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Elimination

The following are also valid rules of inference: p q ~q p

p q ~p q

English example: “If you’re playing it cool or I’m maxing and relaxing, and you’re not playing it cool, then I’m maxing and relaxing.”

Page 14: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Transitivity

The following is also a valid rule of inference: p q q r p r

English example: “If you call my mom ugly I will call my brother, and if I call my brother he will beat you up, then if you call my mom ugly my brother will beat you up.”

Page 15: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Division into cases

The following is also a valid rule of inference: p q p r q r r

English example: “If am fat or sassy, and being fat implies that I will give you trouble, and being sassy implies that I will give you trouble, then I will give you trouble.”

Page 16: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Contradiction Rule

The following is also a valid rule of inference: ~p c p

English example: “If my water is at absolute zero then the universe does not exist, thus my water must not be at absolute zero.”

Page 17: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Fallacies

A fallacy is an argument that is not valid

It could mean that the conclusion is not true in only a single case in the truth table

But, if the conclusion is ever false whenever all the premises are true, the argument is a fallacy

Most arguments presented by politicians are fallacies for one reason or another

Page 18: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Common fallacies

Converse error If Joe sings a sad song, then Joe will

make it better. Joes makes it better. Conclusion: Joe sings a sad song.

FALLACY Inverse error

If you eat too much, you will get sick. You are not eating too much. Conclusion: You will not get sick.

FALLACY

Page 19: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Digital Logic Circuits

Page 20: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Digital logic circuits

Digital logic circuits are the foundation of all computer hardware

Circuits are built out of components called gates

A gate has one or more inputs and an output

Gates model Boolean operations Usually, in digital logic, we use a 1

for true and a 0 for false

Page 21: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Common gates

The following gates have the same function as the logical operators with the same names:

NOT gate:

AND gate:

OR gate:

Page 22: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Example

Draw the digital logic circuit corresponding to:

(p ~q) ~(p r)

What’s the corresponding truth table?

Page 23: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Predicate Logic

Page 24: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Student Lecture: Universal and Existential Quantifiers

Page 25: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Predicates

A predicate is a sentence with a fixed number of variables that becomes a statement when specific values are substituted for to the variables

The domain gives all the possible values that can be substituted

The truth set of a predicate P(x) are those elements of the domain that make P(x) true when they are substituted

Page 26: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Predicate examples

Let P(x) be “x has had 4 wisdom teeth removed”

What is the truth set if the domain is the people in this classroom?

Let Q(n) be “n is divisible by exactly itself and 1”

What is the truth set if the domain is the set of positive integers Z+?

Page 27: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

A note about sets

We will frequently be referring to various sets of numbers in this class

Some typical notation used for these sets:

Some authors use Z+ to refer to non-negative integers and only N for the natural numbers

Symbol

Set Examples

R Real numbers Virtually everything that isn’t imaginary

Z Integers {…, -2, -1, 0, 1, 2,…}

Z- Negative integers {-1, -2, -3, …}

Z+ Positive integers {1, 2, 3, …}

N Natural numbers {1, 2, 3, …}

Q Rational numbers a/b where a,b Z and b 0

Page 28: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Universal quantification

The universal quantifier means “for all”

The statement “All DJ’s are mad ill” can be written more formally as:

x D, M(x) Where D is the set of DJ’s and M(x)

denotes that x is mad ill

Page 29: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Universal quantification examples

Let S = {1, 2, 3, 4, 5} Show that the following statement is

true: x S, x2 ≥ x

Show that the following statement is false: x R, x2 ≥ x

Page 30: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Existential quantification

The universal quantifier means “there exists”

The statement “Some emcee can bust a rhyme” can be written more formally as:

y E, B(y) Where E is the set of emcees and B(y)

denotes that y can bust a rhyme

Page 31: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Existential quantification examples

Let S = {2, 4, 6, 8} Show that the following statement is

false: x S, 1/x = x

Show that the following statement is true: x Z, 1/x = x

Page 32: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Tarski’s World

Tarski’s World provides an easy framework for testing knowledge of quantifiers

The following notation is used: Triangle(x) means “x is a triangle” Blue(y) means “y is blue” RightOf(x, y) means “x is to the right of

y (but not necessarily on the same row)”

Page 33: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Tarski’s World Example

Are the following statements true or false? t, Triangle(t) Blue(t) x, Blue(x) Triangle(x) y such that Square(y) RightOf(d, y) z such that Square(z) Gray(z)

a

c

g

b

d

f

i

k

e

h

j

Page 34: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Upcoming

Page 35: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Next time…

Negating quantifications Multiple quantifications

Page 36: Week 1 - Friday.  What did we talk about last time?  Tautologies  Contradictions  Laws of Boolean algebra  Implications  Inverses  Converses

Reminders

Keep reading Chapter 3 Start working on Assignment 1

Due next Friday