Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

Similar documents
Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

CS 455/555: Mathematical preliminaries

Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Proving languages to be nonregular

Review 3. Andreas Klappenecker

In N we can do addition, but in order to do subtraction we need to extend N to the integers

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

CS 121, Section 2. Week of September 16, 2013

Automata and Languages

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

Sri vidya college of engineering and technology

A Universal Turing Machine

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

Harvard CS 121 and CSCI E-207 Lecture 6: Regular Languages and Countability

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

Section 2.1: Introduction to the Logic of Quantified Statements

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 1. I. Foundational material

At least one of us is a knave. What are A and B?

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

CS 154, Lecture 3: DFA NFA, Regular Expressions

1 Basic Combinatorics

Principles of Real Analysis I Fall I. The Real Number System

Exercises for Unit VI (Infinite constructions in set theory)

1 More finite deterministic automata

Computational Theory

BASIC MATHEMATICAL TECHNIQUES

Automata Theory, Computability and Complexity

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

1 Showing Recognizability

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Deterministic Finite Automata (DFAs)

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

One-to-one functions and onto functions

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

CSE 105 THEORY OF COMPUTATION

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs)

Theory of Computation

CS243, Logic and Computation Nondeterministic finite automata

Discrete Mathematics. Benny George K. September 22, 2011

CS 455/555: Finite automata

CS280, Spring 2004: Prelim Solutions

Section 7.5: Cardinality

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

CSE 105 THEORY OF COMPUTATION

Theory of Computation

CSE 311: Foundations of Computing. Lecture 26: More on Limits of FSMs, Cardinality

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Mathematical Preliminaries. Sipser pages 1-28

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

Theory of Computation Lecture 1. Dr. Nahla Belal

Finite Automata and Regular Languages

Nondeterminism and Epsilon Transitions

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

PGSS Discrete Math Solutions to Problem Set #4. Note: signifies the end of a problem, and signifies the end of a proof.

CPSC 421: Tutorial #1

CSE 311: Foundations of Computing. Lecture 26: Cardinality, Uncomputability

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

(Refer Slide Time: 0:21)

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Models of Computation. by Costas Busch, LSU

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

CHAPTER 8: EXPLORING R

1. Induction on Strings

Homework 1 (revised) Solutions

Sets, Functions and Relations

CS 581: Introduction to the Theory of Computation! Lecture 1!

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Homework #3: 1.4.1, a & b, 1.5.1, 1.5.3, 1.5.6, 1.5.7, 1.5.8, Prove that the set of all real numbers is uncountable.

Before we show how languages can be proven not regular, first, how would we show a language is regular?

CS 154. Finite Automata, Nondeterminism, Regular Expressions

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

Computational Models: Class 3

MATH 114 Fall 2004 Solutions to practice problems for Final Exam

Discrete Mathematics 2007: Lecture 5 Infinite sets

Mid Term-1 : Practice problems

Automata Theory and Formal Grammars: Lecture 1

Johns Hopkins Math Tournament Proof Round: Automata

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

INFINITY: CARDINAL NUMBERS

CS 154 Introduction to Automata and Complexity Theory

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

computability and complexity theory

Chapter 1 : The language of mathematics.

CS280, Spring 2004: Final

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

Transcription:

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki 1) Construct deterministic finite automata accepting each of the following languages. In (a)-(c) the alphabet is = {0,1}. In (d)-(e) the alphabet is ASCII and you can specify transitions with character classes. a) {w w begins with a 1 and ends with a 0} b) {w w contains at least 3 1s} c) {w w has length at least 3 and its third symbol is a 0} d) {w w is an integer literal} e) {w w is a Java comment} 2) Now construct non-deterministic finite automata for each of the languages in (1). 3) Give state transition diagrams of NFAs recognizing the following languages. In all cases, the alphabet is {0, 1}. (a) (b) (c) (d) (e) {w w ends with 00} with three states {w w contains an even number of 0s, or exactly two 1s} with six states {w w contains the either the substring 010 or the substring 100} with six states {0} with two states {1, 00, 111} with five states

Homework #2 Solution C SC 381 Spring 2008 Prof. Stucki 1) 1.5.2, p. 29 Show by induction that n 4 4n 2 is divisible by 3 for all n 0. Base: n = 0 0 4 4(0) 2 = 0, which is certainly divisible by 3. IH: Assume that 3 k 4 4k 2 for 0 k n IS: Show that 3 (n+1) 4 4(n+1) 2 (n+1) 4 4(n+1) 2 = (n 4 + 4n 3 + 6n 2 + 4n + 1) (4n 2 + 8n + 4) = (n 4 4n 2 ) + (4n 3 + 6n 2 + 4n + 1 8n 4) = (n 4 4n 2 ) + (4n 3 + 6n 2 4n 3) = (n 4 4n 2 ) + 3(n 3 + 2n 2 n 1) + n 3 n = (n 4 4n 2 ) + 3(n 3 + 2n 2 n 1) + (n 1) n (n + 1) In this last expression, the IH tells us the first term is divisible by 3, the middle term is explicitly divisible by 3, and the last term, as the product of three consecutive numbers, must have a factor of 3. 2) 1.5.3, p. 29 What is wrong with the purported proof (in textbook) that all horses are the same color? The problem is that the asserted base case of one horse is not the correct one. Consider the case when n + 1 = 2. Call the horses in the set Bucephalus and Mister Ed. When you discard Bucephalus, all the remaining horses, meaning {Mister Ed}, have the same color by the inductive hypothesis. Call this color c 1. Put Bucephalus back into the set and discard another. The only possibility is Mister Ed. This time all the remaining horses, referring to {Bucephalus}, have the same color. Call this color c 2. So Bucephalus and Mister Ed have the same color as the ones that were not discarded either time, which we shall call c 3. That is c 1 = c 2 = c 3. But when n + 1 = 2, there are no horses in the set that were never discarded, so there are no horses of color c 3 to which we can apply the is the same color as relation to conclude c 1 = c 3 or c 2 = c 3, and no meaningful fixed value for c 3. Since the induction fails to show that if the claim holds for 1 horse, then the claim holds for two horses, the entire proof fails. Notice that if a proper base case were established, then the proof would show that all horses have the same color if any set of two horses were all the same color, then any set of three would be, etc. 3) 1.5.6, p. 29 Show that in any group of at least two people there are at least two persons that have the same number of acquaintances within the group. (Use the pigeonhole principle.) The pigeonhole primciple says that there is no one-to-one function from a set A of pigeons to a set B of holes, whenever A > B. So to demonstrate that at least two people in our group ( pigeons ) know the same number of people within the group ( fit into the same pigeonhole ), we must show that the set P of people has a greater cardinality than the set R of possible number of people that a person could know. We know that P = n. For this group of n people, we assume that knowing is not reflexive (we could also have assumed that knowing is reflexive; only a few minor details of the proof would be changed). So a person p can know anywhere from 0 to n 1 people in the group (i.e., can know no one, or can know everyone, or anywhere in between). Consider the set of numbers of people the p could know. That set R is {0, 1,, n 1}, and clearly has n elements. If there is a person p who knows everyone in the group, then there cannot also be a person r who knows nobody else. Either p and r know each other (and thus r knows someone), or they do not (and thus p does not know everyone). Thus R can contain either 0 or n 1, but not both, so in no case can R have a cardinality of more than n 1. As P = n, this demonstrates that R < P, so there is no one-to-one function from R to P, so by the pigeonhole principle at least two people must know the same number of people within the group.

4) 1.5.7, p. 29 Suppose we try to prove, by an argument exactly parallel to the proof of Theorem 1.5.2, that the set of all finite subsets of is uncountable. What goes, wrong? When we take the complement of a finite subset of, the set we obtain will be infinite. Thus the new diagonal set is not a finite subset of. As such it did not need to be included in our enumeration, so its absence from that enumeration poses no problem. 5) 1.5.8, p. 29 Give examples to show that the intersection of two countably infinite sets can be either finite or countably infinite, and that the intersection of two uncountable sets can be finite, countably infinite, or uncountable. The intersection of two countably infinite sets can be either finite or countably infinite: The intersection of the odd naturals with the even naturals is the empty set, which is finite. The intersection of the prime integers with the odd integers is the odd primes, which is countably infinite. On the other hand, the intersection of two uncountably infinite sets can be finite, countably infinite, or uncountably infinite: The intersection of 2 with the set of all real numbers is empty, and thus finite. The intersection of 2 with {2 2 } is, which is countably infinite. The intersection of 2 with itself is uncountable. Likewise, the intersection of the interval [0. 6) with the interval (5, 10] is the interval (5, 6), which is uncountable. 6) 1.6.1, p. 40 Are the following sets closed under the following operations? If not, what are the respective closures? a) The odd integers under multiplication. Yes, the product of any two odd integers is an odd integer (Can you prove this?). b) The positive integers under division. No, +, the positive rational numbers, is the closure of the positive integers under division. c) The negative integers under subtraction. No, the closure of the negative integers under subtraction is, the set of all integers. d) The negative integers under multiplication. No, the closure is the set of all non-zero integers. e) The odd integers under division. No, the closure is the set of all rational with only odd numerators and denominators.

7) 1.6.2, p. 40 What is the reflexive transitive closure R * of the relation R = {(a, b), (a, c), (a, d), (d, c), (d, e)}? Draw a directed graph representing R *. a b e d c 8) 1.6.3, p. 41 Is the transitive closure of the symmetric closure of a binary relation necessarily reflexive? Prove it or give a counterexample. No. Let R be the empty relation on any non-empty set S. R is its own symmetric closure, and its own transitive closure, but remains non-reflexive. 9) 1.6.5, p. 41 Give an example of a binary relation that is not reflexive but has a transitive closure that is reflexive. The relation {(0, 1), (1, 0)} on the set {0, 1} is not reflexive, but its transitive closure is the relation {(0, 0), (0, 1), (1, 0), (1, 1)}.