CS 270 Lecture 1 In Class Problems. Q1: Logic Puzzle You arrive at the end of a long hallway. There are two knights guarding two doors. One knight always.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

Exercises for CS1512 Weeks 7 and 8 Propositional Logic 1 (questions)
AE1APS Algorithmic Problem Solving John Drake. The island of Knights and Knaves is a fictional island to test peoples ability to reason logically. There.
Logic Gates.
PROOF BY CONTRADICTION
MATH Truth Tables and Equivalent Statements Judy Ahrens, 2005 Pellissippi State Technical Community College slide 1 The conditional: If p, then.
Gremlins and Goblins Gremlins always tell the truth. Goblins sometimes lie. Unfortunately, their appearance is identical. You are in a dungeon with two.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–5 and 6: Propositional Calculus.
Basic Logical Operations (fascinating)
Basic Logical Operations (Fascinating)
James Tam AND OR NOT NAND NOR XOR Basic logic operations (fascinating)
Statements The most important idea in logic: Validity of an argument.
Chapter 9: Boolean Algebra
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
22C:19 Discrete Math Introduction and Scope Propositions Fall 2011 Sukumar Ghosh.
Propositions and Truth Tables
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
CS1Q Computer Systems Lecture 5 Simon Gay. Lecture 5CS1Q Computer Systems - Simon Gay2 Where we are Global computing: the Internet Networks and distributed.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Lecture 5 Knights and Knaves.. Administration Show hand in form. Show plagiarism form. Any problems with coursework? Google knight and knaves and look.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 24.
1 10/13/2015 MATH 224 – Discrete Mathematics Why Study Discrete Math  Determination of the efficiency of algorithms, e.g., insertion sort versus selection.
Digital Systems: Boolean Algebra and Logic Gates
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
CS 2210 (22C:019) Discrete Structures Introduction and Scope: Propositions Spring 2015 Sukumar Ghosh.
MATH 224 – Discrete Mathematics
Lecture Propositional Equivalences. Compound Propositions Compound propositions are made by combining existing propositions using logical operators.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Venn Diagrams Truth Sets & Valid Arguments Truth Sets & Valid Arguments Truth Tables Implications Truth Tables Implications Truth Tables Converse, Inverse,
COMBINATIONAL LOGIC Circuit Design. Steps Create the truth table Extract the Boolean Expression from the truth table or create a K-Map Simplify the expression.
CS621: Artificial Intelligence Lecture 28: Propositional calculus; Puzzle Solving Pushpak Bhattacharyya Computer Science and Engineering Department IIT.
Chapter 1: The Foundations: Logic and Proofs
Chapter-3: BOOLEAN ALGEBRA & LOGIC GATES Analysis and logical design.
Circuits & Boolean Expressions. A ABC BC ABC C B A Example # 1: Boolean Expression: Develop a Boolean expression from a circuit.
Current Assignments Homework 2 is available and is due tomorrow (June 19th). Boolean expressions, if statements and the while loop. Project 1 due in 5.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 25.
Thinking Mathematically Logic 3.4 Truth Tables for the Conditional and Biconditional.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–10: Soundness of Propositional Calculus 12 th August, 2010.
 Conjunctive Normal Form: A logic form must satisfy one of the following conditions 1) It must be a single variable (A) 2) It must be the negation of.
Propositional Equivalences
22C:19 Discrete Structures Introduction and Scope: Propositions
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
The Foundations: Logic and Proofs
DISCRETE MATHEMATICS CHAPTER I.
CS 2210:0001 Discrete Structures Introduction and Scope: Propositions
Python: Logic Gates Damian Gordon.
A statement is a contradiction
Logic Gates.
Logic Gates Benchmark Companies Inc PO Box Aurora CO
Basic Logical Operations (Fascinating)
Liar liar.
Conditional Statements
Argument Lecture 5.
Logic Gates.
CS 220: Discrete Structures and their Applications
A Brief Summary for Exam 1
Logical Truth To show a statement A is a logic truth (tautology) ...
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Statements of Symbolic Logic
Truth tables Mrs. Palmer.
1.2 Propositional Equivalences
Section 3.3 Truth Tables for the Conditional and Biconditional
Truth Tables for the Conditional and Biconditional
Selection—Making Decisions
Topics discussed in this section:
1.3 Propositional Equivalences
A THREE-BALL GAME.
Truth Tables for Conditional and Biconditional Statements
Presentation transcript:

CS 270 Lecture 1 In Class Problems

Q1: Logic Puzzle You arrive at the end of a long hallway. There are two knights guarding two doors. One knight always speaks the truth. One knight always tells lies. One door leads to safety. One door leads to death. You may ask 1 question yes/no question to one knight before picking a door to go through. Use a table to prove your question works.

Q2: Truth Tables Prove using Truth Tables that NAND is functionally complete Relation between NAND and NOT and: (X NAND Y) NAND (X NAND Y) or: (X NAND X) NAND (Y NAND Y) XNOT XX NAND X FalseTrueF NAND F = T TrueFalse?

Q3: Tautology Checker You have a magic function Boolean Tautology(Expression){ … } Given any expression, it will return true if the expression is a tautology and false otherwise. Example: Tautology(A or (not A)) returns True Use Tautology to write a function that tells you if the statement is a contradiction. (A contradiction is always false)