Download presentation
Presentation is loading. Please wait.
Published byKenneth Cooper Modified over 8 years ago
1
CS 270 Lecture 1 In Class Problems
2
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.
3
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?
4
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)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.