CS Module 1. Ben Harsha Apr 12, 2017

Similar documents
PROBLEM SET 3: PROOF TECHNIQUES

CSE 240 Logic and Discrete Mathematics

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Compound Propositions

Mat 243 Exam 1 Review

CS 340: Discrete Structures for Engineers

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

EECS 1028 M: Discrete Mathematics for Engineers

MAT2345 Discrete Math

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Course Staff. Textbook

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Computer Science 280 Spring 2002 Homework 2 Solutions by Omar Nayeem

CS70 is a course about on Discrete Mathematics for Computer Scientists. The purpose of the course is to teach you about:

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 1

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

CSE 20 DISCRETE MATH. Fall

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

CSC Discrete Math I, Spring Propositional Logic

Section 1.3. Let I be a set. When I is used in the following context,

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Midterm Exam Solution

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

Introduction to Decision Sciences Lecture 2

CS70: Discrete Math and Probability. Slides adopted from Satish Rao, CS70 Spring 2016 June 20, 2016

ICS141: Discrete Mathematics for Computer Science I

AMTH140 Lecture 8. Symbolic Logic

A statement is a sentence that is definitely either true or false but not both.

CSE 20 DISCRETE MATH WINTER

Chapter 1: Formal Logic

Discrete Mathematics and Its Applications

MAT 243 Test 1 SOLUTIONS, FORM A

Proofs. Joe Patten August 10, 2018

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Math 10850, fall 2017, University of Notre Dame

Some Review Problems for Exam 1: Solutions

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Boolean Logic. CS 231 Dianna Xu

CSE 20 DISCRETE MATH WINTER

CS173 Lecture B, September 10, 2015

Math.3336: Discrete Mathematics. Nested Quantifiers

MATH CSE20 Homework 5 Due Monday November 4

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

Readings: Conjecture. Theorem. Rosen Section 1.5

1. Propositions: Contrapositives and Converses

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

Contradiction MATH Contradiction. Benjamin V.C. Collins, James A. Swenson MATH 2730

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Section 1.1: Logical Form and Logical Equivalence

Propositional Logic Not Enough

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

CSC165. Larry Zhang, October 7, 2014

ICS141: Discrete Mathematics for Computer Science I

Discrete Mathematics and Its Applications

Definition 2. Conjunction of p and q

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Logic and Proofs. (A brief summary)

Logic and Proof. On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes!

Recommended Reading. A Brief History of Infinity The Mystery of the Aleph Everything and More

On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes! 26-Aug-2011 MA

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Stanford University CS103: Math for Computer Science Handout LN9 Luca Trevisan April 25, 2014

Mathematical Logic Part One

CA320 - Computability & Complexity

MATH 2200 Final LC Review

2.2: Logical Equivalence: The Laws of Logic

Tecniche di Verifica. Introduction to Propositional Logic

Sec$on Summary. Mathematical Proofs Forms of Theorems Trivial & Vacuous Proofs Direct Proofs Indirect Proofs

Introduction Propositional Logic

Learning Goals of CS245 Logic and Computation

MATH 271 Summer 2016 Practice problem solutions Week 1

Discrete Mathematics

Introduction to Sets and Logic (MATH 1190)

Logic, Sets, and Proofs

Solutions to Homework I (1.1)

We last time we began introducing equivalency laws.

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

UNIT-I: Propositional Logic

Solutions to Exercises (Sections )

Foundations of Discrete Mathematics

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

1.1 Language and Logic

Discrete Mathematics for CS Spring 2006 Forbes HW 1 Solutions

Logic Gate Level. Part 2

1.1 Language and Logic

Chapter 4, Logic using Propositional Calculus Handout

Mathematical Reasoning. The Foundation of Algorithmics

Math.3336: Discrete Mathematics. Propositional Equivalences

Chapter 2. Logical Notation. Bahar Aameri. Department of Computer Science University of Toronto. Jan 09, Mathematical Expression and Reasoning 1

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Automata Theory and Formal Grammars: Lecture 1

Transcription:

CS 50010 Module 1 Ben Harsha Apr 12, 2017

Course details Course is split into 2 modules Module 1 (this one): Covers basic data structures and algorithms, along with math review. Module 2: Probability, Statistics, Crypto Goal for module 1: Review basics needed for CS and specifically Information Security Review topics you may not have seen in awhile Cover relevant topics you may not have seen before

IMPORTANT This course cannot be used on a plan of study except for the IS Professional Masters program

Administrative details Office: HAAS G60 Office Hours: 1:00-2:00pm in my office Can also email for an appointment, I ll be in there often Course website cs.purdue.edu/homes/bharsha/cs50010.html Contains syllabus, homeworks, and projects

Grading Module 1 and module are each 50% of the grade for CS 50010 Module 1 55% final 20% projects 20% assignments 5% participation

Boolean Logic Variables/Symbols: Can only be used to represent 1 or 0 Operations: Negation Conjunction (AND) Disjunction (OR) Exclusive or (XOR) Implication Double Implication Truth Tables: Can be defined for all of these functions

Operations Negation ( p, p, p C, not p) - inverts the symbol. 1 becomes 0, 0 becomes 1 Conjunction (p q, p && q, p and q) - true when both p and q are true. False otherwise Disjunction (p v q, p q, p or q) - True if at least one of p or q is true Exclusive Or (p xor q, p q, p q) - True if exactly one of p or q is true Implication (p q) - True if p is false or q is true (q v p) Double implication (p q) true if p and q are the same

Translating from English We often need to represent an idea logically to work with it If it is raining then the ground is wet p = it is raining q = the ground is wet p -> q Identify the variables Identify the relationship Combine

De Morgan s Laws Allows you to apply negation to and and or statements De Morgan s Laws: (p v q) = p ^ q (p ^ q) = p v q All ands become ors and vice versa

De Morgans examples p -> q (p v q) -> a (p v q v a) ^ b

Quantifiers Universal quantifier For all - Means that a statement applies to any possible choice real x, 2x is also real Existential quantifier There exists - Means that there is at least one example where the statement is true x such x 2 = x! - Shows up sometimes. Means Exists a unique, as in there exists exactly one item

Negating quantifiers During negation becomes and vice versa There is a person who has been to Indianapolis p, p has been to Indy Negated: p, p has not been to Indy Someone has taken a flight on every airline in the world p a, p has taken a flight on all airlines Negated: p a, p has not taken a flight on a

Logical Equivalence Often need to show that two things are the same Most basic way to show this: truth tables Example on the board (p -> q) ^ (q -> p) = p <-> q

Contraposition The following is true for all implications If p -> q then q -> p Proof is by truth table, on board If it is raining then the ground is wet If the ground is not wet, then it is not raining Used often in proofs - if you prove the contraposition you have proven the original statement

Contraposition examples (p v q) a If x and y are two integers for which x+y is even, then x and y have the same parity (oddness/evenness)

Solving more complicated logic problems Break the problem into parts - treat groups of logical statements as chunks. Work on the larger chunks first, then solve for smaller parts (p^q)v(z^y) (a v b v c)

Proofs Slides adapted from TAMU Relevant XKCD

Intermission Questions?

Sample questions For all integers n, if n 2 is odd, then n is odd. (Contradiction) Prove that if n 2 is even then n is even (Direct) If x*y is even then at least one of the two is even(contrapositive)

Induction Final method for today Very common in computer science (as it will relate to recursion) Start with a base case, show that it is true Assume it is true for n, show that it is true for n+1

How to prove something by induction Sum from i=1 to n of 2 i = 2 n+1-2 Step 1: Establish a base case Step 2: Assume that it is true for n Step 3: Prove that if it is true for n, it is true for n+1

Examples Prove that 1+2+3+...+n-1+n = (n(n+1))/2 Prove that n! > 3 n for all n >= 7 1 2 + 2 2 + 3 2 +.. + n 2 = n(n+1)(2n+1) / 6

Assignments First assignment is posted, it is due in one week. Download from cs.purdue.edu/homes/bharsha/cs50010.html Can also just go to cs.purdue.edu/homes/bharsha and follow links 2-3 questions per lecture, recommended to work as we go

End of lecture 1 If time remaining: See if we can work through the blue-eyed island puzzle Also - survey to fill out