Lecture 6,

Similar documents
Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

2.1 Sets 2.2 Set Operations

Chapter Seven: Regular Expressions

Today s Topics. What is a set?

CSC Discrete Math I, Spring Sets

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Slides for Faculty Oxford University Press All rights reserved.

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

This Lecture. We will first introduce some basic set theory before we do counting. Basic Definitions. Operations on Sets.

Discrete Mathematics Lecture 4. Harper Langston New York University

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

SET DEFINITION 1 elements members

Chapter Seven: Regular Expressions. Formal Language, chapter 7, slide 1

4&5 Binary Operations and Relations. The Integers. (part I)

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Discrete Mathematics

Mathematical Induction

Lecture 1. 1 Notation

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

Recursive Definitions Structural Induction Recursive Algorithms

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

CSE 20 DISCRETE MATH. Fall

Announcements. CS243: Discrete Structures. Strong Induction and Recursively Defined Structures. Review. Example (review) Example (review), cont.

CSE 20 DISCRETE MATH. Winter

CS100: DISCRETE STRUCTURES

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

THEORY OF COMPUTATION

Theory Bridge Exam Example Questions Version of June 6, 2008

CMPSCI 250: Introduction to Computation. Lecture #1: Things, Sets and Strings David Mix Barrington 22 January 2014

Power Set of a set and Relations

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

Alphabets, strings and formal. An introduction to information representation

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

Recursively Enumerable Languages, Turing Machines, and Decidability

Last lecture CMSC330. This lecture. Finite Automata: States. Finite Automata. Implementing Regular Expressions. Languages. Regular expressions

SOFTWARE ENGINEERING DESIGN I

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

Ordered structures. Dr. C. Constantinides. Department of Computer Science and Software Engineering Concordia University Montreal, Canada

Chapter 3. Set Theory. 3.1 What is a Set?

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Closure Properties of CFLs; Introducing TMs. CS154 Chris Pollett Apr 9, 2007.

Languages and Strings. Chapter 2

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5

CSE 20 DISCRETE MATH WINTER

9.5 Equivalence Relations

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures

Introduction to Sets and Logic (MATH 1190)

Scribe: Virginia Williams, Sam Kim (2016), Mary Wootters (2017) Date: May 22, 2017

Recursively Defined Functions

Enumerating Pseudo-Intents in a Partial Order

CMPSCI 250: Introduction to Computation. Lecture #22: Graphs, Paths, and Trees David Mix Barrington 12 March 2014

Regular Expressions. A Language for Specifying Languages. Thursday, September 20, 2007 Reading: Stoughton 3.1

Notes for Recitation 8

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Discrete Mathematics. Kruskal, order, sorting, induction

Generell Topologi. Richard Williamson. May 6, 2013

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

CS 361 Data Structures & Algs Lecture 11. Prof. Tom Hayes University of New Mexico

Bootcamp. Christoph Thiele. Summer An example of a primitive universe

Problem Set 2 Solutions

Welcome! CSC445 Models Of Computation Dr. Lutz Hamel Tyler 251

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

CS103 Handout 14 Winter February 8, 2013 Problem Set 5

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Algebra of Sets. Aditya Ghosh. April 6, 2018 It is recommended that while reading it, sit with a pen and a paper.

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

Solutions to Homework 10

14.1 Encoding for different models of computation

ACM-ICPC Indonesia National Contest Problem A. The Best Team. Time Limit: 2s


Discrete mathematics , Fall Instructor: prof. János Pach

CS103 Spring 2018 Mathematical Vocabulary

10/11/2018. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

CS525 Winter 2012 \ Class Assignment #2 Preparation

The Further Mathematics Support Programme

15 150: Principles of Functional Programming Some Notes on Regular Expression Matching

4 KARNAUGH MAP MINIMIZATION

Recursion. Dr. Jürgen Eckerle FS Recursive Functions

Nim-Regularity of Graphs

Lecture 22 Tuesday, April 10

Set and Set Operations

Lecture 25 : Counting DRAFT

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall

Infinity and Uncountability. Countable Countably infinite. Enumeration

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

A Little Point Set Topology

Polygon Triangulation

Transcription:

Lecture 6, 4.16.2009 Today: Review: Basic Set Operation: Recall the basic set operator,!. From this operator come other set quantifiers and operations:!,!,!,! \ Set difference (sometimes denoted, a minus sign)! - symmetric difference (xor for sets, denoted Δ in your book and sometimes denoted (circled v)) x Cartesian product A x B is the set of ordered pairs (a,b) with the 1 st element in the first set and the 2 nd element in the 2 nd set New: P Power set operator, unary operator (takes 1 input). P(x) is the set of all subsets of x P(X) = {A:A!X} Lecture 6, April 16 2009 ------------------------------------------------------ 1. Counting, Finite/Infinite Sets (Chap 1.6) ------------------------------------------------------ If A is a finite set and B is a finite set, then A U B is a finite set, and further, A U B = A + B - A \ cap B. Above is the Inclusion-Exclusion principle (we include all of A and B, then exclude those in both that are double counted). The book extends this to triples of sets (Corollary 1.10) and more broadly it can be extended to any number (with increasingly complex combinations of parts included and excluded).

------------------------------ 2. Sets of Sets, Power Sets and Partitions (1.7) ------------ Let S = {a,b,c,d,e} Let T contain subsets of S that contain two consecutive letters: T = { {a,b}, {b,c}, {c,d}, {d,e}} Note that T = 4. The Power Set of a set S, P(S) is a set that contains all subsets of S. For S={a,b,c}, P(S) = { {}, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c} } note that P(S) = 2^ S (each element of S can be in a set or not). Thus the power set is also denoted as 2^S. We can represent any subset of a base set U = (x_1, x_2,..., x_n} using an index vector of length n. The ith element of the index vector for a subset T is 1 iff x_i is in S. For example, if we use our set S above as U, then the index vector for {a,c} is 101. Note that there are 2^n possible index vectors (since each position can be 0/1), and this represents the 2^n elements of P(U). More on power sets: For example, take X={0,1,2}, then P(x)={!,{0},{1},{2},{0,1},{0,2},{1,2},{0,1,2}} We can more systematically enumerate the elements of this set by counting in binary just as in a truth table, indicating if the given element is (1) or is not (0) in the given set: 2 1 0 0 0 0! 0 0 1 {0} 0 1 0 {1} 0 1 1 {0,1}

1 0 1 {0,2} 1 1 0 {1,2} 1 1 1 {0,1,2} (Aside: you should structure our truth tables by counting in binary in the usual order, like above, as good practice for readability and to be systematic) You can also view that in the above table we have a vector of binary values where position i is 1 if the element is in the set, 0 if it is not. Notice in the table that the power set of X had 8 values in it. In general, if X is finite, then P(X) = 2 X. Indeed sometimes P(X) is written 2 X as a reminder of how big this set is. As another example, we talked about P(N), where N is the set of natural numbers. Using the other set operators (this is mostly stuff not done in class, just extra examples): Next, to help improve or facility with the operators on sets, we asked if the following claim is true or false:? ( A \ B) \ C = A \ ( B \ C) We can see from the diagram that the statement is false. Instead, based on inspection, it would appear that: ( A \ B) \ C = A \ ( B! C) Proof: It is common to show set-equalities by arguing both inclusions. But here we will do it all at once:

x! ( A\ B) \ C iff x! A\ B " x# C iff ( x! A) " ( x# B) " ( x# C) iff x! A" x! B " x! C iff x! A" ( x! B $ x! C) iff x! A" ( x! B % C) iff x! A\ ( B % C) Set vocabulary definitions A few more words we often use: - singleton set a set with only one element. - the empty set is the set with no elements. Denoted. Note this symbol is not the same as a Greek letter phi. (Indeed I believe the origin is Norwegian). - Partitions of Sets For a set S, a partition of splits the elements into subsets S_1, S_2,..., S_k such that each element of S is in exactly one of the subsets S_i (and no S_i is empty). Alternately, S_1 U S_2 U... U S_k = S, and for any i,j S_i \cap S_j = {} The S_i are called cells (sometimes). For our set S above, if we split into vowels and consents: P= { {a,e}, {b,c,d} } we get a partition of size 2. --------------- Induction: 1.8 ---------------- Special property that goes with N = {1,2,3, } Mathematical Induction: Let P be a proposition define on numbers i in N: that is P(i) is True or False for each i in N (e.g. P(i) is true if i is even). Now suppose P has the following two properties: i) P(1) is true // this is know as the Basis ii) P(k) -> P(k+1). (for k >= 1) // This is known as the Induction Step

Then P(i) is true for all i in N. Often use more general (or less structured) induction in CS. Example in book. Another example: P(S) = 2^ S : (P(i) is for S =i, P(S) = 2^i = 2^ S Basis: (i) S =1, so P(S) = { {}. S}, P(S) = 2 = 2^1 = 2^ S Induction Step ii) Assume P(k), (Induction Hypothesis) so for S =k, P(S) = 2^k = 2^ S. Now show P(k+1) (using the assumption that P(k)). Recall from our discussion of Arguments in Logic that: P(k) AND P(k) -> P(k+1) - P(k+1) To show P(k+1) let S = {x_1, x_2,..., x_k+1} for P(S) we can consider two types of subsets: those that include x_k+1 and those that don't. Let A be those not using x_k+1 and B be those that use x_k+1. Claim: A = P({x_1,..., x_k}), and thus A = 2^k (by our Induction Hypothesis). Claim: each set in B is of the form T U x_k+1 (alternately, if we remove x_k+1 from any set in B, we get a set in A). thus B = A, so P(S) = 2 * A = 2* 2^k = 2^(k+1) = 2^ S Induction II (strong induction): i) P(1) is true ii) (For all i < k, P(i)) -> P(k). Then P(i) is true for all i in N. Some formal language theory! - an alphabet an alphabet is a finite, nonempty set. Eg, {0, 1}, {a, b}, {0,1,2,3,4,5,6,7,8,9}, {1}, ASCII these are all alphabets. Elements in an alphabet are called characters (or sometimes symbols). - Is an alphabet? NO, it is empty. An alphabet must be nonempty. - is N, the set of natural numbers, an alphabet? No, it is infinite. An alphabet must be finite.

A string is a finite sequence of characters. The characters all come from some understood alphabet. Examples and more definitions *! represents all the strings over the alphabet Σ. This is an infinite set. But all the elements in this infinite set are strings of finite length. If! = {0,1} Then * " =! K L {, 0,1, 00, 01,10,11, 000,,111, 0000, } In this case,! represents the empty string. It is the unique string of length 0. In the case of the English alphabet:! = { a, K, z} *! contains dog, fish,!, etc Suppose x and y are strings, x, y Σ, - Then xo y = xy denotes the characters of x, in order, followed by the characters of y, again in order This is known as the concatenation operator; we have concatenated the two strings. Consider x = dog, y = fish, then xy = dogfish. - The symbols, when applied to strings, as in x, denotes the length of the string x. So the symbol has a different meaning when applied to sets and strings. - True or False? A string exists of length!. False, strings are finite. - True or False? There exists a unique string of length 1. The answer depends upon the set. For! = {1}, the unary alphabet, it s true. For alphabets with 2 or more characters, it is false. - The exponential operator in strings is defined as in 1 3 = 111, or more generally, xn = x x n-1 for n>0 and x 0 = ε. We define the 0 th power as the 1 empty string, is so the last statement holds true for n=1, i.e. = xo = x. x!