COMP Intro to Logic for Computer Scientists. Lecture 9

Similar documents
Pigeonhole Principle

24 The Pigeonhole Principle

THE PIGEONHOLE PRINCIPLE AND ITS APPLICATIONS

The purpose of this lab was to examine inheritance patters in cats through a

Functions Introduction to Functions 7.2 One-to-One, Onto, Inverse functions. mjarrar Watch this lecture and download the slides

ST NICHOLAS COLLEGE HALF YEARLY PRIMARY EXAMINATIONS. February YEAR 5 ENGLISH (Listening Comprehension) TIME: 30 minutes TEACHER S COPY

Lecture 4: Controllability and observability

Lab Developed: 6/2007 Lab Revised: 2/2015. Crickthermometer

An Introduction to Formal Logic

Lab 10: Color Sort Turtles not yet sorted by color

Recording Form. Part One: Oral Reading. Excerpt is taken from pages 2 6. Running words: 236

On Some Counterexamples to the Transitivity of Grounding

Introduction to Python Dictionaries

Design of Low Power and High Speed Carry Select Adder Using Brent Kung Adder

Excerpted from. click here to BUY THIS BOOK

Superlative Quantifiers as Meta Speech Acts

Copyright 2015 ISBN Published by. United States of America

Study Skills-Paragraph & Essay Structure

Biology 3201 Sex Linked Review Mr.Gillam Name:

The Beginning of the Armadillos

Feline Environmental Enrichment Gentle Paws

Design of High Speed Vedic Multiplier Using Carry Select Adder with Brent Kung Adder

Lesson Plan Title: Sled Dog Genetics

Designing, simulation and layout of 6bit full adder in cadence software

MOR CHANGE TEACHERS. TRICERATOPS GROWTH Activity Overview BIG IDEA

SEVENTH'ANNUAL'JUILFS'CONTEST' SPRING'2015' ' '

The True Context of an American Dream. The American Dream is a bit of shameless propaganda that s been attempting to show

Amazing Grace. Answer the following journal prompt. Your answer needs to be written in 3 to 5 complete sentences.

Anglia Examination Syndicate (England) Certificate in English for Overseas Candidates

Design of Carry Select Adder Using Brent Kung Adder and BEC Adder

Ground Fighting with a Police Service Dog (K-9) By Terry Fleck

Be Doggone Smart at Work

Jack s Rabbits Book 3

Bugsy the Super Dog. Children s Bed Time Story

Design of 64-bit hybrid carry select adder using CMOS 32nm Technology

INTRODUCTION. and a hat, a hot pot, a cat hops, a cat in a hat, a fat cat. and Pat are fat, Jat is a big cat, Pat is a little bat.

Python 3 Turtle graphics. Lecture 24 COMPSCI111/111G SS 2017

Comm 104 Midterm. True or False. 1. Argumentation is a form of instrumental communication.

1 INTRODUCTION 2 GENERAL

Celebrating Felines. Welcome to Crazy for Kitties and Cats!

Training Test. Prepared by Ibrahim Ali and Mohammad Surwar

Understanding Heredity one example

Case Study: In Sickness and in Health: A Trip to the Genetic Counselor

The Dihybrid Problem Solve

Part4. Saint Fatima Language School Form 3 Second Term 2018 / The Vision of the School : Distinct Environment for Refined Education

278 Metaphysics. Tibbles, the Cat. Chapter 34

Enrichments for captive Andean Condor (Vultur gryphus) in Zuleta, North Ecuador. Yann Potaufeu (2014)

Lesson 9. Class Level. Pet Adoption. 3 rd /4 th Class

Design of Carry Select Adder with Binary Excess Converter and Brent Kung Adder Using Verilog HDL

Allen County SPCA Working Cat Program

Understanding Heredity one example

James wants a dog. Questions. 1) What kind of pet does James want? A. a bird B. a cat C. a dog

ONTARIO SUPERIOR COURT OF JUSTICE ) ) ) ) Plaintiff ) ) ) ) Defendant. ) J. Keenan Sprague, for the Plaintiff REASONS FOR DECISION

Feral Animals in Australia. An environmental education and sustainability resource kit for educators

Design of Modified Low Power and High Speed Carry Select Adder Using Brent Kung Adder

Wombat Protection Society

Above and right: A prize winning American Rhode Island Red and Rhode Island Red bantam. Photos courtesy of the American RIR Club.

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION ENGLISH Class: VI Total Marks: 80

Describe one way in which scientists could find out whether cichlids from two different populations belong to the same species

Amphibians and Reptiles

Novel Study Units By E. M. Warren

Purpose: In this activity, students will understand that both parents and offspring have behaviors that help the offspring to survive.

Animal Behavior. Problem Area: Animal Health and Administering Veterinary Care. Corresponding E-unit(s). Danville, IL: CAERT, Inc.

Tips on Report Writing

Pre-1998 General Education Equivalency Tables (February, 2007)

Data Mining Classification: Alternative Techniques. Lecture Notes for Chapter 4. Rule-Based. Introduction to Data Mining, 2 nd Edition

Service Animals Factsheet Q & A

Here are some ground rules that you should ALWAYS follow when tackling an Inheritance Problem:

Copyright 2015 Edmentum - All rights reserved.

Here Kitty, Kitty, Kitty Created by E r i n - Updated on June

Monohybrid Mice! III. Cross a gray female, whose father was albino, with a heterozygous male.

Approximating the position of a hidden agent in a graph

Aggression and social structure

The Year of the Dog. thank them for their loyalty, the Buddha gave each one of these animals their own year in the Chinese zodiac cycle.

Math Olympiad for Elementary and Middle School Students

SAN ĠORĠ PRECA COLLEGE PRIMARY SCHOOLS. Half Yearly Exams 2014

The teacher in charge distributes the examination papers to the pupils and asks them to write their name, surname and class on the front cover.

HOW TO... Feather Sex Day-Old Chicks in the Hatchery

Sample Guide. Not for sale. or distribution. Henry & Mudge in Puddle Trouble. Oscar Otter by Nathaniel Benchley. CD Version.

o you have o you ve o youh ve o youve Read each description. Write the correct compound word in the blank. Use the WORD BANK.

JUNIOR FAIR LIVESTOCK RULES

DOG BITES 101 IN ARKANSAS. Recovery can be sought from not only the animal s owner, but sometimes from other responsible individuals as well

DOGBITES - LOS ANGELES TIMES. Los Angeles Times - Valley Section October 12, 1998 p. B1. Man's Best Friend a Worst Nightmare

Solving Problems Part 2 - Addition and Subtraction

1 SB By Senators Livingston and Scofield. 4 RFD: Agriculture, Conservation, and Forestry. 5 First Read: 25-JAN-18.

Lab 5: Bumper Turtles

The trusted, student-friendly online reference tool. Name: Date: Cats

5 State of the Turtles

ENGLISH COMPETITION LEVEL 3 4 (Γ - Δ ΔΗΜΟΤΙΚΟΥ) 15 February am-11am

The Cat s Meow! Kids learn about our relationship with cats. Hot Diggity Dogs! Explains how dogs became members of our. ASPCA AnimaLessons


If it s called chicken wire, it must be for chickens, right? There are certain topics that veteran chicken owners are all

King Fahd University of Petroleum & Minerals College of Industrial Management

Notes for teachers C3 / 31

A short story by Leo Schoof, Kelmscott, Western Australia. My new dog

Visible and Invisible Illnesses. I created this project to illustrate the similarities and differences between visible and

Vicious Dog Ordinance

OWNERS AND APPROPRIATORS

A RESOLUTION OF THE CITY COUNCIL OF THE CITY OF

Helping the Cause of Macaws

Transcription:

COMP 1002 Intro to Logic for Computer Scientists Lecture 9 B 5 2 J

Puzzle 8 Suppose that nobody in our class carries more than 10 pens. There are 70 students in our class. Prove that there are at least 2 students in our class who carry the same number of pens. In fact, there are at least 7 who do.

Pigeonhole Principle Suppose that nobody in our class carries more than 10 pens. There are 70 students in our class. Prove that there are at least 2 students in our class who carry the same number of pens. In fact, there are at least 7 who do. The Pigeonhole Principle: If there are n pigeons And n-1 pigeonholes Then if every pigeon is in a pigeonhole At least two pigeons sit in the same hole

Pigeonhole Principle Suppose that nobody in our class carries more than 10 pens. There are 70 students in our class. Prove that there are at least 2 students in our class who carry the same number of pens. In fact, there are at least 7 who do. The Pigeonhole Principle: If there are n pigeons and n-1 pigeonholes Then if every pigeon is in a pigeonhole At least two pigeons sit in the same hole Applying to our problem: n-1 = 11 possible numbers of pens (from 0 to 10) Even with n=12 people, there would be 2 who have the same number. If there were less than 7, say 6 for each scenario, total would be 66. Note that it does not tell us which number or who these people are!

Resolution and Pigeons It is not that hard to write the Pigeonhole Principle as a tautology But we can prove that resolution has trouble with this kind of reasoning the smallest resolution proof of this tautology is exponential size! By contrast, natural deduction (and you!) can figure it out fairly quickly though it is not straightforward. The problem is that resolution cannot count. But ability to count makes things harder...

Meow-stery One evening there was a cat fight in a family consisting of a mother cat, a father cat, and their son and daughter kittens. One of these four cats attacked and bit another! One of the cats watched the fight. The other one hissed at the fighters. These are the things we know for sure: 1. The watcher and the hisser were not of the same sex. 2. The oldest cat and the watcher were not of the same sex. 3. The youngest cat and the victim were not of the same sex. 4. The hissing cat was older than the victim. 5. The father was the oldest of the four. 6. The attacker was not the youngest of the four. Which nasty cat was the attacker?

Boolean functions and circuits What is the relation between propositional logic we studied and logic circuits? View a formula as computing a function (called a Boolean function), inputs are values of variables, output is either true (1) or false (0). For example, MMMMMMMM x, y, z = tttt when at least two out of x, y, z are true, and false otherwise. Such a function is fully described by a truth table of its formula (or its circuit: circuits have truth tables too).

Boolean functions and circuits What is the relation between propositional logic and logic circuits? So both formulas and circuits compute Boolean functions that is, truth tables. In a circuit, can reuse a piece in several places, so a circuit can be smaller than a formula. Still, most circuits are big! MMMMMMMM x, y, z is x y x z y z x y z AND AND AND OR

Canonical CNF Every truth table (Boolean function) can be written as a CNF: Take every falsifying assignment Say, A = False, B = True, C=False. Write it as a formula which is true only on this assignment: A B C To say that this assignment does not happen, write its negation: A B C A B C Take an AND of these for all falsifying assignments It is equivalent to the original formula. And it is a CNF! Called the canonical CNF of this formula.

Canonical DNF So for every formula, there is a unique canonical CNF (and a truth table, and a Boolean function). And for every possible truth table (a Boolean function), there is a formula (the canonical CNF). A negation of a CNF is an OR of ANDs of literals. It is called a DNF (disjunctive normal form). To make a canonical DNF from a truth table: take all satisfying assignments. Write each as an AND of literals, as before. Then take an OR of these ANDs.

Complete set of connectives CNFs only have,,, yet any formula can be converted into a CNF Any truth table can be coded as a CNF Call a set of connectives which can be used to express any formula a complete set of connectives. In fact,, is already complete. So is,. By DeMorgan, A B ( A B) No need for! But, is not: cannot do with just,. Because when both inputs have the same value, both, leave them unchanged.

Complete set of connectives How many connectives is enough? Just one: NAND (NotAND), also called the Sheffer stroke, written as A A A A B A B True True False A B ( A B) A B) A A (B B)) True False True False True True False False True In practice, most often stick to,,

Puzzle 9 Susan is 28 years old, single, outspoken, and very bright. She majored in philosophy. As a student she was deeply concerned with issues of discrimination and social justice and also participated in anti-nuke demonstrations. Please rank the following possibilities by how likely they are. List them from least likely to most likely. Susan is: 1. a kindergarden teacher 2. works in a bookstore and takes yoga classes 3. an active feminist 4. a psychiatric social worker 5. a member of an outdoors club 6. a bank teller 7. an insurance salesperson 8. a bank teller and an active feminist