Mathematical Logic Part Two

Size: px
Start display at page:

Download "Mathematical Logic Part Two"

Transcription

1 Mathematical Logic Part Two

2 A Note on the Career Fair

3 Recap from Last Time

4 Recap So Far A propositional variable is a variable that is either true or false. The propositional connectives are as follows: Negation: p Conjunction: p q Disjunction: p q Implication: p q Biconditional: p q True: False:

5 Take out a sheet of paper!

6 What's the truth table for the connective?

7 What's the negation of p q?

8 New Stuff!

9 First-Order Logic

10 What is First-Order Logic? First-order logic is a logical system for reasoning about properties of objects. Augments the logical connectives from propositional logic with predicates that describe properties of objects, functions that map objects to one another, and quantifiers that allow us to reason about multiple objects.

11 Some Examples

12 Likes(You, Eggs) Likes(You, Tomato) Likes(You, Shakshuka) AreNetflixingAndChilling(You, Him) WatchesNetflix(You) WatchesNetflix(Him) IsStranded(MattDamon) WillBringHome(MattDamon)

13 Likes(You, Eggs) Likes(You, Tomato) Likes(You, Shakshuka) AreNetflixingAndChilling(You, Him) WatchesNetflix(You) WatchesNetflix(Him) IsStranded(MattDamon) WillBringHome(MattDamon) These These blue blue terms terms are are called called constant constant symbols. symbols. Unlike Unlike propositional propositional variables, variables, they they refer refer to to objects, objects, not not propositions. propositions.

14 Likes(You, Eggs) Likes(You, Tomato) Likes(You, Shakshuka) AreNetflixingAndChilling(You, Him) WatchesNetflix(You) WatchesNetflix(Him) IsStranded(MattDamon) WillBringHome(MattDamon) The The red red things things that that look look like like function function calls calls are are called called predicates. predicates. Predicates Predicates take take objects objects as as arguments arguments and and evaluate evaluate to to true true or or false. false.

15 Likes(You, Eggs) Likes(You, Tomato) Likes(You, Shakshuka) AreNetflixingAndChilling(You, Him) WatchesNetflix(You) WatchesNetflix(Him) IsStranded(MattDamon) WillBringHome(MattDamon) What What remains remains are are traditional traditional propositional propositional connectives. connectives. Because Because each each predicate predicate evaluates evaluates to to true true or or false, false, we we can can connect connect the the truth truth values values of of predicates predicates using using normal normal propositional propositional connectives. connectives.

16 Reasoning about Objects To reason about objects, first-order logic uses predicates. Examples: ExtremelyCute(Quokka) DeadlockEachOther(Democrats, Republicans) Predicates can take any number of arguments, but each predicate has a fixed number of arguments (called its arity). The arity and meaning of each predicate are typically specified in advance. Applying a predicate to arguments produces a proposition, which is either true or false.

17 First-Order Sentences Sentences in first-order logic can be constructed from predicates applied to objects: LikesToEat(V, M) Near(V, M) WillEat(V, M) Cute(t) Dikdik(t) Kitty(t) Puppy(t) x < 8 x < 137 The The notation notation xx<<88 isis just just aa shorthand shorthand for for something something like like LessThan(x, LessThan(x,8). 8). Binary Binary predicates predicates inin math math are are often often written written like like this, this, but but symbols symbols like like << are are not not aa part part of of first-order first-order logic. logic.

18 Equality First-order logic is equipped with a special predicate = that says whether two objects are equal to one another. Equality is a part of first-order logic, just as and are. Examples: TomMarvoloRiddle = LordVoldemort MorningStar = EveningStar Equality can only be applied to objects; to state that two propositions are equal, use.

19 For notational simplicity, define as x y (x = y)

20 Let's see some more examples.

21 FavoriteMovieOf(You) FavoriteMovieOf(Her) StarOf(FavoriteMovieOf(You)) = StarOf(FavoriteMovieOf(Her)) These These purple purple terms terms are are functions. functions. Functions Functions take take objects objects as as input input and and produce produce objects objects as as output. output.

22 Functions First-order logic allows functions that return objects associated with other objects. Examples: LengthOf(path) MedianOf(x, y, z) x+y As with predicates, functions can take in any number of arguments, but each function has a fixed arity. As with predicates, the arity and interpretation of functions are specified in advance. Functions evaluate to objects, not propositions. There is no syntactic way to distinguish functions and predicates; you'll have to look at how they're used.

23 Objects and Predicates When working in first-order logic, be careful to keep objects (actual things) and predicates (true or false) separate. You cannot apply connectives to objects: Venus TheSun You cannot apply functions to propositions: StarOf(IsRed(Sun) IsGreen(Mars)) Ever get confused? Just ask!

24 One last (and major) change

25 x. (IsPuppy(x) IsAdorable(x)) ( All puppies are adorable ) a. (IsAdorable(a) IsPuppy(a)) ( Something is adorable but not a puppy ) These These green green terms terms are are called called quantifiers. quantifiers. The The symbol symbol isis read read for for all, all, and and the the symbol symbol isis read read there there exists exists

26 x. (IsPuppy(x) IsAdorable(x)) ( All puppies are adorable ) a. (IsAdorable(a) IsPuppy(a)) ( Something is adorable but not a puppy ) The The teal teal terms terms are are variables. variables. Each Each quantifier quantifier introduces introduces aa variable variable that that itit quantifies quantifies over. over. In In the the first first case, case, we're we're saying saying that that for for any any choice choice of of x, x, ifif xx isis aa puppy, puppy, then then xx isis adorable. adorable. In In the the second, second, we're we're saying saying that that there there exists exists some some choice choice of of aa where where aa isis adorable adorable and and aa isis not not aa puppy. puppy.

27 x. (IsPuppy(x) IsAdorable(x)) ( All puppies are adorable ) a. (IsAdorable(a) IsPuppy(a)) ( Something is adorable but not a puppy )

28 Quantifiers The biggest change from propositional logic to first-order logic is the use of quantifiers. A quantifier is an operator that expresses that some statement is true for some or all choices that could be made.

29 For any natural number n, n is even iff n2 is even n. (n ℕ (Even(n) Even(n2))) isis the the universal universalquantifier quantifier and and says says for for any any choice choice of of n, n, the the following following isis true. true.

30 The Universal Quantifier A statement of the form x. ψ asserts that for every choice of x, the statement ψ is true when we plug in that choice of x. Examples: v. (Puppy(v) Cute(v)) x. (IsMillennial(x) IsSpecial(x)) Tallest(SK) x. (SK x ShorterThan(x, SK))

31 Some muggles are intelligent. m. (Muggle(m) Intelligent(m)) isis the the existential existentialquantifier quantifier and and says says for for some some choice choice of of m, m, the the following following isis true. true.

32 The Existential Quantifier A statement of the form x. ψ asserts that there is some choice of x where ψ is true when we plug in that x. Examples: x. (Even(x) Prime(x)) x. (TallerThan(x, me) LighterThan(x, me)) ( x. Appreciates(x, me)) Happy(me)

33 Variables and Quantifiers Each quantifier has two parts: the variable that is introduced, and the statement that's being quantified. The variable introduced is scoped just to the statement being quantified. ( x. Loves(You, x)) ( y. Loves(y, You)) The The variable variable xx just just lives lives here. here. The The variable variable yy just just lives lives here. here.

34 Variables and Quantifiers Each quantifier has two parts: the variable that is introduced, and the statement that's being quantified. The variable introduced is scoped just to the statement being quantified. ( x. Loves(You, x)) ( x. Loves(x, You)) The The variable variable xx just just lives lives here. here. AA different different variable, variable, also also named named x, x, just just lives lives here. here.

35 Operator Precedence (Again) When writing out a formula in first-order logic, the quantifiers and have precedence just below. The statement x. P(x) R(x) Q(x) is parsed like this: ( ( x. P (x) ) R (x) ) Q ( x ) This is syntactically invalid because the variable x is out of scope in the back half of the formula. To ensure that x is properly quantified, explicitly put parentheses around the region you want to quantify: x. (P(x) R(x) Q(x))

36 Time-Out for Announcements!

37 Checkpoints Graded The PS1 checkpoint assignment has been graded. Review your feedback on GradeScope. Contact the staff (via Piazza or by stopping by office hours) if you have any questions. Some notes: Make sure to list your collaborators through GradeScope. There's a space to list your collaborators when you submit the assignment. If you forget to do this, they won't get credit for the assignment! Make sure to check your grade ASAP. For the reason listed above, make sure you have a grade recorded. If not, contact the course staff. Plus, that way, you can take our feedback into account when writing up your answers to the rest of the problem set questions. Best of luck on the rest of the problem set!

38 WiCS Casual CS Dinner WiCS (Women in Computer Science) will be holding a Casual CS Dinner next Wednesday, January 20 in the Women's Community Center at 6PM. These events are fantastic and are a great way to meet cool people, find study groups, and get Good Life Advice. Highly recommended!

39

40 Your Questions

41 How did you first learn discrete math? Any advice for first-timers? II first first learned learned discrete discrete math math when when II took took CS103 CS103 many many years years back! back! The The class class was was aa lot lot of of work, work, but but II learned learned aa ton! ton! My My advice: advice: don't don't settle settle for for aa partial partial understanding understanding of of aa topic. topic. If If you you kinda kinda get get something, something, ask ask questions questions about about it! it! Don't Don't be be afraid afraid of of the the concepts concepts you you don't don't understand. understand. Take Take them them head-on. head-on. You'll You'll learn learn so so much much ifif you you do. do.

42 If you can prove that the contrapositive of a theorem is false, does that count as a proof that the theorem is false? (I understand that a true contrapositive is sufficient to prove a theorem true, but I want to know if it is necessary) Yep! Yep! AA statement statement isis logically logically equivalent equivalent to to its its contrapositive, contrapositive, so so ifif you you can can disprove disprove the the contrapositive, contrapositive, you've you've disproven disproven the the original original statement. statement.

43 What are your favorite books? Any reading recommendations? II highly highly recommend recommend Whistling Whistling Vivaldi Vivaldi by by Claude Claude Steele. Steele. This This book book talks talks about about stereotype stereotype threat, threat, its its causes, causes, and and how how to to address address it. it. It's It's fundamentally fundamentally changed changed the the way way II teach teach my my classes. classes. It's It's also also aa quick quick and and fascinating fascinating read. read. If If you you like like long-form long-form essays, essays, read read Scott Scott and and Scurvy, Scurvy, the the story story of of how how we we lost lost the the cure cure to to scurvy scurvy due due to to scientific scientific progress progress inin other other areas. areas. It's It's aa fascinating fascinating read read and and will will change change the the way way you you think think about about scientific scientific progress. progress. I'd I'd also also recommend recommend Command Command and and Control: Control: Nuclear Nuclear Weapons, Weapons, The The Damascus Damascus Incident Incident and and the the Illusion Illusion of of Nuclear Nuclear Safety Safety by by Eric Eric Schlosser. Schlosser. It's It's aa fascinating fascinating look look at at the the history history of of nuclear nuclear weapons weapons and and institutional institutional dysfunction. dysfunction. Fun Fun fact fact some some of of the the ridiculous ridiculous scenes scenes from from Dr. Dr. Strangelove Strangelove and and War War Games Games actually actually happened. happened.

44 Back to CS103!

45 Translating into First-Order Logic

46 Translating Into Logic First-order logic is an excellent tool for manipulating definitions and theorems to learn more about them. Applications: Determining the negation of a complex statement. Figuring out the contrapositive of a tricky implication.

47 Translating Into Logic Translating statements into first-order logic is a lot more difficult than it looks. There are a lot of nuances that come up when translating into first-order logic. We'll cover examples of both good and bad translations into logic so that you can learn what to watch for. We'll also show lots of examples of translations so that you can see the process that goes into it.

48 Using the predicates - Puppy(p), which states that p is a puppy, and - Cute(x), which states that x is cute, write a sentence in first-order logic that means all puppies are cute.

49 An Incorrect Translation All puppies are cute! x. (Puppy(x) Cute(x)) This This should should work work for for any any choice choice of of x, x, including including things things that that aren't aren't puppies. puppies.

50 An Incorrect Translation All puppies are cute! x. (Puppy(x) Cute(x)) This This should should work work for for any any choice choice of of x, x, including including things things that that aren't aren't puppies. puppies.

51 An Incorrect Translation All puppies are cute! x. (Puppy(x) Cute(x)) AA statement statement of of the the form form x. x. ψ ψ isis true true only only when when ψψ isis true true for for every every choice choice of of x. x.

52 An Incorrect Translation All puppies are cute! x. (Puppy(x) Cute(x)) This This first-order first-order statement statement isis false false even even though though the the English English statement statement isis true. true. Therefore, Therefore, itit can't can't be be aa correct correct translation. translation.

53 An Incorrect Translation All puppies are cute! x. (Puppy(x) Cute(x)) The The issue issue here here isis that that this this statement statement asserts asserts that that everything everything isis aa puppy. puppy. That's That's too too strong strong of of aa claim claim to to make. make.

54 A Better Translation All puppies are cute! x. (Puppy(x) Cute(x)) This This should should work work for for any any choice choice of of x, x, including including things things that that aren't aren't puppies. puppies.

55 A Better Translation All puppies are cute! x. (Puppy(x) Cute(x)) This This should should work work for for any any choice choice of of x, x, including including things things that that aren't aren't puppies. puppies.

56 A Better Translation All puppies are cute! x. (Puppy(x) Cute(x)) AA statement statement of of the the form form x. x. ψ ψ isis true true only only when when ψψ isis true true for for every every choice choice of of x. x.

57 All P's are Q's translates as x. (P(x) Q(x))

58 Useful Intuition: Universally-quantified statements are true unless there's a counterexample. x. (P(x) Q(x)) If If xx isis aa counterexample, counterexample, itit must must have have property property PP but but not not have have property property Q. Q.

59 Using the predicates - Blobfish(b), which states that b is a blobfish, and - Cute(x), which states that x is cute, write a sentence in first-order logic that means some blobfish is cute.

60 An Incorrect Translation Some blobfish is cute. x. (Blobfish(x) Cute(x))

61 An Incorrect Translation Some blobfish is cute. x. (Blobfish(x) Cute(x))

62 An Incorrect Translation Some blobfish is cute. x. (Blobfish(x) Cute(x))

63 An Incorrect Translation Some blobfish is cute. x. (Blobfish(x) Cute(x)) AA statement statement of of the the form form x. x. ψ ψ isis true true only only when when ψψ isis true true for for some some choice choice of of x. x.

64 An Incorrect Translation Some blobfish is cute. x. (Blobfish(x) Cute(x)) This This first-order first-order statement statement isis true true even even though though the the English English statement statement isis false. false. Therefore, Therefore, itit can't can't be be aa correct correct translation. translation.

65 An Incorrect Translation Some blobfish is cute. x. (Blobfish(x) Cute(x)) The The issue issue here here isis that that implications implications are are true true whenever whenever the the antecedent antecedent isis false. false. This This statement statement accidentally accidentally isis true true because because of of what what happens happens when when xx isn't isn't aa blobfish. blobfish.

66 A Correct Translation Some blobfish is cute. x. (Blobfish(x) Cute(x))

67 A Correct Translation Some blobfish is cute. x. (Blobfish(x) Cute(x)) AA statement statement of of the the form form x. x. ψ ψ isis true true only only when when ψψ isis true true for for some some choice choice of of x. x.

68 Some P is a Q translates as x. (P(x) Q(x))

69 Useful Intuition: Existentially-quantified statements are false unless there's a positive example. x. (P(x) Q(x)) If If xx isis an an example, example, itit must must have have property property PP on on top top of of property property Q. Q.

70 Good Pairings The quantifier usually is paired with. The quantifier usually is paired with. In the case of, the connective prevents the statement from being false when speaking about some object you don't care about. In the case of, the connective prevents the statement from being true when speaking about some object you don't care about.

Mathematical Logic Part Two

Mathematical Logic Part Two Mathematical Logic Part Two A Note on the Career Fair Recap from Last Time Recap So Far A propositional variable is a variable that is either true or false. The propositional connectives are as follows:

More information

Mathematical Logic Part Two

Mathematical Logic Part Two Mathematical Logic Part Two Recap from Last Time Recap So Far A propositional variable is a variable that is either true or false. The propositional connectives are as follows: Negation: p Conjunction:

More information

Mathematical Logic Part Two

Mathematical Logic Part Two Mathematical Logic Part Two Recap from Last Time Recap So Far A propositional variable a variable that either true or false. The propositional connectives are as follows: Negation: p Conjunction: p q Djunction:

More information

Mathematical Logic Part One

Mathematical Logic Part One Mathematical Logic Part One Question: How do we formalize the logic we've been using in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical equivalences.

More information

Mathematical Logic Part One

Mathematical Logic Part One Mathematical Logic Part One Question: How do we formalize the logic we've been using in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical equivalences.

More information

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 [talking head] Formal Methods of Software Engineering means the use of mathematics as an aid to writing programs. Before we can

More information

Functions, High-School Edition

Functions, High-School Edition Functions What is a function? Functions, High-School Edition f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png source: http://study.com/cimages/multimages/16/asymptote_1.jpg

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true.

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true. You can t prove a predicate is true because a predicate is not an assertion, you can t prove it is valid as it is not a deduction! If someone asks you to prove P(x), it is not totally clear what they mean.

More information

Program Verification & Testing; Review of Propositional Logic

Program Verification & Testing; Review of Propositional Logic 8/24: p.1, solved; 9/20: p.5 Program Verification & Testing; Review of Propositional Logic CS 536: Science of Programming, Fall 2018 A. Why Course guidelines are important. Active learning is the style

More information

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012 University of Illinois at Chicago Department of Computer Science Final Examination CS 151 Mathematical Foundations of Computer Science Fall 2012 Thursday, October 18, 2012 Name: Email: Print your name

More information

Guide to First-Order Logic Translations

Guide to First-Order Logic Translations Guide to First-Order Logic Translations Hi everybody! In last Friday's lecture, we talked about how to translate statements from English into frst-order logic. Translating into logic is a skill that takes

More information

Section 2.2: Introduction to the Logic of Quantified Statements

Section 2.2: Introduction to the Logic of Quantified Statements Section 2.2: Introduction to the Logic of Quantified Statements In this section, we shall continue to examine some of the fundamentals of predicate calculus. Specifically, we shall look at the negations

More information

First-Order Translation Checklist

First-Order Translation Checklist CS103 Winter 2019 First-Order Translation Checklist Cynthia Lee Keith Schwarz In this handout, we ve distilled five specific points that you should check in your first-order logic statements before submitting

More information

Range Minimum Queries Part Two

Range Minimum Queries Part Two Range Minimum Queries Part Two Recap from Last Time The RMQ Problem The Range Minimum Query (RMQ) problem is the following: Given a fixed array A and two indices i j, what is the smallest element out of

More information

CSC 501 Semantics of Programming Languages

CSC 501 Semantics of Programming Languages CSC 501 Semantics of Programming Languages Subtitle: An Introduction to Formal Methods. Instructor: Dr. Lutz Hamel Email: hamel@cs.uri.edu Office: Tyler, Rm 251 Books There are no required books in this

More information

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.3 1.4 of Rosen cse235@cse.unl.edu Introduction

More information

CS103 Handout 50 Fall 2018 November 30, 2018 Problem Set 9

CS103 Handout 50 Fall 2018 November 30, 2018 Problem Set 9 CS103 Handout 50 Fall 2018 November 30, 2018 Problem Set 9 What problems are beyond our capacity to solve? Why are they so hard? And why is anything that we've discussed this quarter at all practically

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning

More information

L05 - Negating Statements

L05 - Negating Statements L05 - Negating Statements CSci/Math 2112 15 May 2015 1 / 14 Assignment 1 Assignment 1 is now posted Due May 22 at the beginning of class Can work on it in groups, but separate write-up Don t forget your

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 7 This lecture returns to the topic of propositional logic. Whereas in Lecture Notes 1 we studied this topic as a way of understanding

More information

Proofwriting Checklist

Proofwriting Checklist CS103 Winter 2019 Proofwriting Checklist Cynthia Lee Keith Schwarz Over the years, we ve found many common proofwriting errors that can easily be spotted once you know how to look for them. In this handout,

More information

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. Guide to and Hi everybody! In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. This guide focuses on two of those symbols: and. These symbols represent concepts

More information

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation Chapter 1.3 Quantifiers, Predicates, and Validity Reading: 1.3 Next Class: 1.4 1 Motivation Propositional logic allows to translate and prove certain arguments from natural language If John s wallet was

More information

The Stack, Free Store, and Global Namespace

The Stack, Free Store, and Global Namespace Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information

More information

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson Lecture Notes 15 Number systems and logic CSS 501 - Data Structures and Object-Oriented Programming Professor Clark F. Olson Number systems The use of alternative number systems is important in computer

More information

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus: Boolean Algebra and Simplification CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Topics Motivation: Simplifying Conditional Expressions

More information

Strategies for Proofs

Strategies for Proofs Strategies for Proofs Landscape with House and Ploughman Van Gogh Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois 1 Goals of this lecture A bit more logic Reviewing Implication

More information

CS103 Handout 35 Spring 2017 May 19, 2017 Problem Set 7

CS103 Handout 35 Spring 2017 May 19, 2017 Problem Set 7 CS103 Handout 35 Spring 2017 May 19, 2017 Problem Set 7 What can you do with regular expressions? What are the limits of regular languages? In this problem set, you'll explore the answers to these questions

More information

Summary of Course Coverage

Summary of Course Coverage CS-227, Discrete Structures I Spring 2006 Semester Summary of Course Coverage 1) Propositional Calculus a) Negation (logical NOT) b) Conjunction (logical AND) c) Disjunction (logical inclusive-or) d) Inequalities

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

Outline for Today. The Pigeonhole Principle. Graph Theory Party Tricks. The Hadwiger-Nelson Problem. Results that are too big to fail.

Outline for Today. The Pigeonhole Principle. Graph Theory Party Tricks. The Hadwiger-Nelson Problem. Results that are too big to fail. Graphs Part Two Outline for Today The Pigeonhole Principle Graph Theory Party Tricks Results that are too big to fail. Applying graph theory to real life! The Hadwiger-Nelson Problem A glimpse of advanced

More information

MITOCW watch?v=4dj1oguwtem

MITOCW watch?v=4dj1oguwtem MITOCW watch?v=4dj1oguwtem PROFESSOR: So it's time to examine uncountable sets. And that's what we're going to do in this segment. So Cantor's question was, are all sets the same size? And he gives a definitive

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 9 Normal Forms In the last class we have seen some consequences and some equivalences,

More information

MITOCW watch?v=kz7jjltq9r4

MITOCW watch?v=kz7jjltq9r4 MITOCW watch?v=kz7jjltq9r4 PROFESSOR: We're going to look at the most fundamental of all mathematical data types, namely sets, and let's begin with the definitions. So informally, a set is a collection

More information

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements CPSC 121: Models of Computation Module 6: Rewriting predicate logic statements Module 6: Rewriting predicate logic statements Pre-class quiz #7 is due March 1st at 19:00. Assigned reading for the quiz:

More information

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics. Computability and Logic Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

More information

Remember, this question was mis-worded: you could also add quoted words and sentences in the blanks below. This allowed for a solution to [4] below.

Remember, this question was mis-worded: you could also add quoted words and sentences in the blanks below. This allowed for a solution to [4] below. CS3 Fall 04 Midterm 1 Solutions and Grading standards Problem 1 (6 points, 10 minutes): Make the expressions correct Add parentheses and procedures in the underlined areas to make these expressions return

More information

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 CS 3512, Spring 2011 Instructor: Doug Dunham Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 Prerequisites: Calc I, CS2511 Rough course outline:

More information

MITOCW watch?v=0jljzrnhwoi

MITOCW watch?v=0jljzrnhwoi MITOCW watch?v=0jljzrnhwoi The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

Binary Relations Part One

Binary Relations Part One Binary Relations Part One Outline for Today Binary Relations Reasoning about connections between objects. Equivalence Relations Reasoning about clusters. A Fundamental Theorem How do we know we have the

More information

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013 61A LECTURE 1 FUNCTIONS, VALUES Steven Tang and Eric Tzeng June 24, 2013 Welcome to CS61A! The Course Staff - Lecturers Steven Tang Graduated L&S CS from Cal Back for a PhD in Education Eric Tzeng Graduated

More information

6.034 Notes: Section 10.1

6.034 Notes: Section 10.1 6.034 Notes: Section 10.1 Slide 10.1.1 A sentence written in conjunctive normal form looks like ((A or B or not C) and (B or D) and (not A) and (B or C)). Slide 10.1.2 Its outermost structure is a conjunction.

More information

Skill 1: Multiplying Polynomials

Skill 1: Multiplying Polynomials CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need

More information

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures Lecture 5: Predicate Calculus ffl Predicate Logic ffl The Language ffl Semantics: Structures 1 Why Predicate Logic? Propositional logic is not powerful enough to express statements such as ffl For every

More information

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture Homework 1 Due Date: Wednesday 11/26/07 - at the beginning of the lecture Problems marked with a [*] are a littlebit harder and count as extra credit. Note 1. For any of the given problems make sure that

More information

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers. CSE 240, Fall, 2013 Homework 2 Due, Tuesday September 17. Can turn in class, at the beginning of class, or earlier in the mailbox labelled Pless in Bryan Hall, room 509c. Practice Problems: 1. Consider

More information

Turing Machines Part Two

Turing Machines Part Two Turing Machines Part Two Recap from Last Time The Turing Machine A Turing machine consists of three parts: A finite-state control that issues commands, an infinite tape for input and scratch space, and

More information

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist In Handout 28, the Guide to Inductive Proofs, we outlined a number of specifc issues and concepts to be mindful about when

More information

Context-Free Grammars

Context-Free Grammars Context-Free Grammars Describing Languages We've seen two models for the regular languages: Automata accept precisely the strings in the language. Regular expressions describe precisely the strings in

More information

Shared Variables and Interference

Shared Variables and Interference Solved Shared Variables and Interference CS 536: Science of Programming, Fall 2018 A. Why Parallel programs can coordinate their work using shared variables, but it s important for threads to not interfere

More information

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th COMS 1003 Fall 2005 Introduction to Computer Programming in C Bits, Boolean Logic & Discrete Math September 13 th Hello World! Logistics See the website: http://www.cs.columbia.edu/~locasto/ Course Web

More information

CPSC 121: Models of Computation. Module 5: Predicate Logic

CPSC 121: Models of Computation. Module 5: Predicate Logic CPSC 121: Models of Computation Module 5: Predicate Logic Module 5: Predicate Logic Midterm 1: Friday February 9 th, 17:00 to 18:15 A to C (by last name): room DMP 310 D to K: room MATH 100 L to P: room

More information

CITS2211 Discrete Structures Logic

CITS2211 Discrete Structures Logic CITS2211 Discrete Structures Logic Unit coordinator: Rachel Cardell-Oliver August 6, 2017 Highlights All men are mortal, Socrates is a man, therefore Socrates is mortal. Reading Chapter 3: Logical Formulas

More information

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between MITOCW Lecture 10A [MUSIC PLAYING] PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between all these high-level languages like Lisp and the query

More information

Propositional Logic. Application of Propositional logic

Propositional Logic. Application of Propositional logic DISCRETE STRUCTURE Propositional Logic Application of Propositional logic Propositional logic is the study of propositions (true or false statements) and ways of combining them (logical operators) to

More information

Shared Variables and Interference

Shared Variables and Interference Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but

More information

Section 2.4: Arguments with Quantified Statements

Section 2.4: Arguments with Quantified Statements Section 2.4: Arguments with Quantified Statements In this section, we shall generalize the ideas we developed in Section 1.3 to arguments which involve quantified statements. Most of the concepts we shall

More information

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1 CS 70 Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1 PRINT Your Name:, (last) SIGN Your Name: (first) PRINT Your Student ID: CIRCLE your exam room: 1 Pimentel 141 Mccone

More information

Formal Predicate Calculus. Michael Meyling

Formal Predicate Calculus. Michael Meyling Formal Predicate Calculus Michael Meyling May 24, 2013 2 The source for this document can be found here: http://www.qedeq.org/0_04_07/doc/math/qedeq_formal_logic_v1.xml Copyright by the authors. All rights

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

A Survey of Mathematics with Applications 8 th Edition, 2009

A Survey of Mathematics with Applications 8 th Edition, 2009 A Correlation of A Survey of Mathematics with Applications 8 th Edition, 2009 South Carolina Discrete Mathematics Sample Course Outline including Alternate Topics and Related Objectives INTRODUCTION This

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

Quiz 3; Tuesday, January 27; 5 minutes; 5 points [Solutions follow on next page]

Quiz 3; Tuesday, January 27; 5 minutes; 5 points [Solutions follow on next page] Quiz 3; Tuesday, January 27; 5 minutes; 5 points [Solutions follow on next page] 1. Does the Java expression x + y == z have a side-effect? If so, what is it? 2. Write a function named add that can add

More information

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F 1 Logical Operations 1.1 And The and operator is a binary operator, denoted as, &,, or sometimes by just concatenating symbols, is true only if both parameters are true. A B A B F T F F F F The expression

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 2.1-2.7 p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

CPSC 121 Midterm 1 Friday October 14th, Signature: Section (circle one): 11:00 15:30 17:00

CPSC 121 Midterm 1 Friday October 14th, Signature: Section (circle one): 11:00 15:30 17:00 CPSC 121 Midterm 1 Friday October 14th, 2016 Name: Student ID: Signature: Section (circle one): 11:00 15:30 17:00 You have 70 minutes to write the 9 questions on this examination. A total of 60 marks are

More information

COMP Intro to Logic for Computer Scientists. Lecture 2

COMP Intro to Logic for Computer Scientists. Lecture 2 COMP 1002 Intro to Logic for Computer Scientists Lecture 2 B 5 2 J Language of logic: building blocks Proposition: A sentence that can be true or false. A: It is raining in St. John s right now. B: 2+2=7

More information

Predicate Logic CHAPTER What This Chapter Is About

Predicate Logic CHAPTER What This Chapter Is About CHAPTER 14 Predicate Logic We now turn our attention to a generalization of propositional logic, called predicate, or first-order, logic. Predicates are functions of zero or more variables that return

More information

Well, Hal just told us how you build robust systems. The key idea was-- I'm sure that many of

Well, Hal just told us how you build robust systems. The key idea was-- I'm sure that many of MITOCW Lecture 3B [MUSIC PLAYING] Well, Hal just told us how you build robust systems. The key idea was-- I'm sure that many of you don't really assimilate that yet-- but the key idea is that in order

More information

Computation Club: Gödel s theorem

Computation Club: Gödel s theorem Computation Club: Gödel s theorem The big picture mathematicians do a lot of reasoning and write a lot of proofs formal systems try to capture the ideas of reasoning and proof in a purely mechanical set

More information

Interpretations and Models. Chapter Axiomatic Systems and Incidence Geometry

Interpretations and Models. Chapter Axiomatic Systems and Incidence Geometry Interpretations and Models Chapter 2.1-2.4 - Axiomatic Systems and Incidence Geometry Axiomatic Systems in Mathematics The gold standard for rigor in an area of mathematics Not fully achieved in most areas

More information

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences.

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences. Quantification In this and subsequent chapters, we will develop a more formal system of dealing with categorical statements, one that will be much more flexible than traditional logic, allow a deeper analysis

More information

Propositional Logic:

Propositional Logic: CS2209A 2017 Applied Logic for Computer Science Lecture 2 Propositional Logic: Syntax, semantics, truth table Instructor: Yu Zhen Xie Language of logic: building blocks Proposition: A sentence that can

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi is another way of showing that an argument is correct. Definitions: Literal: A variable or a negation of a variable is called a literal. Sum and Product: A disjunction of literals is called a sum and a

More information

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability theory,

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

CS103 Handout 39 Winter 2018 February 23, 2018 Problem Set 7

CS103 Handout 39 Winter 2018 February 23, 2018 Problem Set 7 CS103 Handout 39 Winter 2018 February 23, 2018 Problem Set 7 What can you do with regular expressions? What are the limits of regular languages? In this problem set, you'll explore the answers to these

More information

Functions, High-School Edition

Functions, High-School Edition Functions What is a function? Functions, High-School Edition f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png source: http://study.com/cimages/multimages/16/asymptote_1.jpg

More information

PHIL 240, Introduction to Logic, Sections Fall 2011 FINAL EXAM 14 December Name (5 points): Section (5 points):

PHIL 240, Introduction to Logic, Sections Fall 2011 FINAL EXAM 14 December Name (5 points): Section (5 points): Section I True / False questions (2 points each) 1. TRUE Any argument that is sound is also valid. 2. FALSE_ If the premises of an argument are all true, then that argument is sound. 3. TRUE Every universal

More information

Post Experiment Interview Questions

Post Experiment Interview Questions Post Experiment Interview Questions Questions about the Maximum Problem 1. What is this problem statement asking? 2. What is meant by positive integers? 3. What does it mean by the user entering valid

More information

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1 CS 70 Discrete Mathematics for CS Fall 2000 Wagner MT1 Sol Solutions to Midterm 1 1. (16 pts.) Theorems and proofs (a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are

More information

CS 161 Computer Security

CS 161 Computer Security Wagner Spring 2014 CS 161 Computer Security 1/27 Reasoning About Code Often functions make certain assumptions about their arguments, and it is the caller s responsibility to make sure those assumptions

More information

MITOCW watch?v=zm5mw5nkzjg

MITOCW watch?v=zm5mw5nkzjg MITOCW watch?v=zm5mw5nkzjg The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

Lecture 5. Logic I. Statement Logic

Lecture 5. Logic I. Statement Logic Ling 726: Mathematical Linguistics, Logic. Statement Logic V. Borschev and B. Partee, September 27, 2 p. Lecture 5. Logic I. Statement Logic. Statement Logic...... Goals..... Syntax of Statement Logic....2.

More information

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus: Boolean Functions and Expressions CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Objective: To provide students with the concepts and

More information

Setting Your Site Preferences

Setting Your Site Preferences Setting Your Site Preferences Created on October 1, 2016 This Page Intentionally Left Blank Setting Your Preferences ii 02-Jan-17 ii Table of Contents Introduction... 4 Opening the Setting or Preferences

More information

Outline for Today. Why could we construct them in time O(n)? Analyzing data structures over the long term.

Outline for Today. Why could we construct them in time O(n)? Analyzing data structures over the long term. Amortized Analysis Outline for Today Euler Tour Trees A quick bug fix from last time. Cartesian Trees Revisited Why could we construct them in time O(n)? Amortized Analysis Analyzing data structures over

More information

Problem One: A Quick Algebra Review

Problem One: A Quick Algebra Review CS103A Winter 2019 Solutions for Week One Handout 01S Problem One: A Quick Algebra Review In the first week of CS103, we'll be doing a few proofs that will require some algebraic manipulations and reasoning

More information

Lecture 6,

Lecture 6, Lecture 6, 4.16.2009 Today: Review: Basic Set Operation: Recall the basic set operator,!. From this operator come other set quantifiers and operations:!,!,!,! \ Set difference (sometimes denoted, a minus

More information

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 PRINT Your Name:, (last) READ AND SIGN The Honor Code: As a member of the UC Berkeley community, I act with honesty,

More information

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 01 Course Overview (Refer Slide Time: 00:45) Welcome

More information

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday For next Tuesday Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday Any questions? Program 1 Imperfect Knowledge What issues arise when we don t know

More information

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.080 / Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.8 / 6.89 Great Ideas in Theoretical Computer Science Spring 28 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

Denotational semantics

Denotational semantics 1 Denotational semantics 2 What we're doing today We're looking at how to reason about the effect of a program by mapping it into mathematical objects Specifically, answering the question which function

More information

MITOCW ocw f99-lec12_300k

MITOCW ocw f99-lec12_300k MITOCW ocw-18.06-f99-lec12_300k This is lecture twelve. OK. We've reached twelve lectures. And this one is more than the others about applications of linear algebra. And I'll confess. When I'm giving you

More information