, if x 1 and f(x) = x, if x 0.

Similar documents
First Midterm Examination

Finite-State Automata: Recap

p-adic Egyptian Fractions

Bases for Vector Spaces

CM10196 Topic 4: Functions and Relations

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Lecture 3: Equivalence Relations

Coalgebra, Lecture 15: Equations for Deterministic Automata

1 Nondeterministic Finite Automata

Designing finite automata II

A negative answer to a question of Wilke on varieties of!-languages

Quadratic Forms. Quadratic Forms

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Lecture 09: Myhill-Nerode Theorem

dx dt dy = G(t, x, y), dt where the functions are defined on I Ω, and are locally Lipschitz w.r.t. variable (x, y) Ω.

Formal Languages and Automata

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Myhill-Nerode Theorem

Homework 3 Solutions

set is not closed under matrix [ multiplication, ] and does not form a group.

Torsion in Groups of Integral Triangles

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

The graphs of Rational Functions

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Chapter 1: Fundamentals

Parse trees, ambiguity, and Chomsky normal form

The Regulated and Riemann Integrals

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Harvard University Computer Science 121 Midterm October 23, 2012

Linear Inequalities. Work Sheet 1

UniversitaireWiskundeCompetitie. Problem 2005/4-A We have k=1. Show that for every q Q satisfying 0 < q < 1, there exists a finite subset K N so that

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Nondeterminism and Nodeterministic Automata

THE QUADRATIC RECIPROCITY LAW OF DUKE-HOPKINS. Circa 1870, G. Zolotarev observed that the Legendre symbol ( a p

Review of Gaussian Quadrature method

Review of Riemann Integral

The practical version

First Midterm Examination

QUADRATIC RESIDUES MATH 372. FALL INSTRUCTOR: PROFESSOR AITKEN

Math 61CM - Solutions to homework 9

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Convert the NFA into DFA

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

Minimal DFA. minimal DFA for L starting from any other

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

7.2 Riemann Integrable Functions

Beginning Darboux Integration, Math 317, Intro to Analysis II

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

MA123, Chapter 10: Formulas for integrals: integrals, antiderivatives, and the Fundamental Theorem of Calculus (pp.

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

expression simply by forming an OR of the ANDs of all input variables for which the output is

Section 3.1: Exponent Properties

2.4 Linear Inequalities and Interval Notation

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

QUADRATIC EQUATIONS OBJECTIVE PROBLEMS

Review of Calculus, cont d

10. AREAS BETWEEN CURVES

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

Riemann is the Mann! (But Lebesgue may besgue to differ.)

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

The Henstock-Kurzweil integral

More on automata. Michael George. March 24 April 7, 2014

Theoretical foundations of Gaussian quadrature

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

Homework Solution - Set 5 Due: Friday 10/03/08

The Evaluation Theorem

Name Ima Sample ASU ID

MTH 505: Number Theory Spring 2017

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

1 Sets Functions and Relations Mathematical Induction Equivalence of Sets and Countability The Real Numbers...

SOME INTEGRAL INEQUALITIES OF GRÜSS TYPE

arxiv:math/ v2 [math.ho] 16 Dec 2003

Formal languages, automata, and theory of computation

3 Regular expressions

Revision Sheet. (a) Give a regular expression for each of the following languages:

Domino Recognizability of Triangular Picture Languages

1B40 Practical Skills

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

Recitation 3: More Applications of the Derivative

ad = cb (1) cf = ed (2) adf = cbf (3) cf b = edb (4)

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

A study of Pythagoras Theorem

Exploring parametric representation with the TI-84 Plus CE graphing calculator

Calculus Module C21. Areas by Integration. Copyright This publication The Northern Alberta Institute of Technology All Rights Reserved.

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

New Expansion and Infinite Series

Exponentials - Grade 10 [CAPS] *

Intuitionistic Fuzzy Lattices and Intuitionistic Fuzzy Boolean Algebras

0.1 THE REAL NUMBER LINE AND ORDER

Chapter 3. Vector Spaces

Further Topics in Analysis

Transcription:

Indin Institute of Informtion Technology Design nd Mnufcturing, Kncheepurm Chenni 600 7, Indi An Autonomous Institute under MHRD, Govt of Indi An Institute of Ntionl Importnce wwwiiitdmcin COM05T Discrete Structures for Computing-Lecture Notes Instructor NSdgopn Scrie: SDhnlkshmi Functions nd Infinite Sets Ojective: We shll introduce functions, specil functions nd relted counting prolems We shll see the importnce of functions in the context of innite sets nd discuss innite sets in detil Further, we introduce the notion of counting in the context of innite sets Denition (Function) Let A nd B e two non-empty sets A function or mpping f from A to B, written s f : A B, where every element A is mpped to unique element B Note: The element B is clled the imge of under f nd is written s f() If f() = then is clled the pre-imge of under f A is clled the domin of f nd {f() A} is clled the rnge of f B is clled the co-domin of f Exmples for function: ) Domin = Set of pples nd Rnge = weight of pples ) Domin = Set of students nd Rnge = CGPA of students 5 Every function is reltion ut the converse is not true ie Every reltion is not function 6 For every element A, there exist n imge f() ie, f() is well dened 7 Let A = n nd B = m The numer of dierent functions f : A B is m n, where A represents the crdinlity of A, the numer of elements of A 8 Let A = n nd B = m If X = {R R is reltion dened wrt (A, B)} nd Y = {R R is function wrt (A, B)} then, X Y (Since, X = mn nd Y = m n ) Things to know: Is there function f : A B, if A = nd B? Yes, n empty function Is there function f : A B, if A nd B =? No Is there function f : A B, if A = nd B =? Yes, void function Denition (One-one function/injective) A function is sid to e injective if for every element in the rnge there exists unique pre-imge ie, no two elements in the domin mp to sme element in the co-domin Denition (Onto function/surjective) A function is sid to e surjective if for every element in the co-domin there exists pre-imge A function is sid to e ijective if it is oth one-one nd onto function

A B A B c c d d e () () A B A B c c d (c) (d) Fig () Not one-one nd not onto () one-one ut not onto (c) onto ut not one-one (d) one-one nd onto Let A = B = N(set of nturl numers) - Give n exmple of function f : N N, tht is one-one nd not onto? f(x) = x + - Give n exmple of function f : N N, tht is not one-one ut onto? f(x) = x - Give n exmple of function f : N N, tht is one-one nd onto? f(x) = x Let A = B = I(set of integers) - Give n exmple of function f : I I, tht is one-one nd not onto? f(x) = x - Give n exmple of function f : I I, tht is not one-one ut onto? f(x) = x, if x nd f(x) = x, if x 0 - Give n exmple of function f : I I, tht is one-one nd onto? f(x) = x Give ijective function f : (0, ) (, 5) in rel numers? f(x) = x + Let A = n nd B = m The numer of dierent one-one functions re m Cn n! = m Pn Food for Thought Let A = n nd B = m The numer of dierent onto functions? Let A = n nd B = m The numer of dierent ijective functions? Give ijective function f : (0, ) (, ) in rel numers?

An invittion to innite sets Motivtion: - Mny interesting sets such s (i) Set of prime numers (ii) Set of C-progrms (iii) Set of C-progrms with exctly three sttements re innite in nture - Between I nd N, which set is igger? - Between I nd N N, which set is igger? - Is [0, ] is igger thn R? - Cn we list ll C-progrms? Denition (Finite) A set A is nite if there exists n N, n-represents the crdinlity of A such tht there is ijection f : {0,,, n } A A is innite if A is not nite Denition 5 (Innite) Let A e set If there exists function f : A A such tht f is n injection nd f(a) A then A is innite Let B e nite set, B = {,,, 0} Cn you estlish - function f : B B such tht f(b) B? No Cn you estlish - function f : N N such tht f(n) N? Yes, f(x) = x + Every - function from f : B B is lso ijection from B B if B is nite Prolem : Show tht N is innite Proof y contrdiction: Suppose N is nite By denition, there exists n, n represents the crdinlity of N such tht f(n) = n Let K = MAX{f(0), f(),, f(n )} + There does not exist x {0,,, n } such tht f(x) = k Therefore, f is not onto nd thus, f is not ijection Hence, our ssumption is wrong nd N is innite Prolem : Show tht R is innite Proof: To prove R is innite, estlish function f : R R such tht f is - nd f(r) R Consider f : R R such tht f(x) = x +, if x 0 nd f(x) = x, if x < 0 This function f is - ut not onto (Since, 0 does not hve pre-imge) nd f(r) R Hence, R is innite Prolem : Let = {, } nd f : Show tht is innite Proof: To prove is innite, estlish function f : such tht f is - nd f( ) Consider f : such tht f(x) = x The elements ɛ,,,, will not hve preimge Therefore f is not onto ut - nd f( ) Hence, is innite

Prolem : Show tht [0, ] is innite Proof: Consider f : [0, ] [0, ] such tht f(x) = x This function f is - ut not onto (Since, (, ] does not hve pre-imge) nd f([0, ]) [0, ] Hence, [0, ] is innite Clim: Let A e suset of A If A is innite then A is innite Proof: Given A is innite Therefore, there exist function g : A A such tht g is - nd g(a ) A Consider function f : A A such tht f(x) = x, if x A\A nd f(x) = g(x), if x A The function f is lso - nd f(a) A (Since, g is - nd g(a ) A ) Thus, A is innite Corollry: Every suset of nite set is nite set Clim : Let f : A B e n injection If A is innite then B is innite Proof: Since f is - nd A is innite, f(a) is innite By previous clim, B is innite (since, f(a) B) Prolem 5: A is innite Show tht (i) P (A), power set of A is innite (ii) A B is innite (iii) A B is innite (iv) A B, the set of ll functions from B to A, is innite Solutions: (i) Consider function f : A P (A) such tht f(x) = {x} The function f is - ut not onto ie,a P (A) Thus, P (A) is innite (ii) We know tht, A A B Since A is innite, A B is innite (y clim ) (iii) Consider function f : A A B such tht f(x) = (x, ) for some B Clerly, the function f is - ut not onto Thus, A B is innite (iv) Every element in A B is function from B A Consider function f : A A B such tht f(x) = g, g is function from B A such tht g() = x, B This function f is - ut not onto Thus, A B is innite Denition 6 (Countle) A set A is countle if A is nite or if A hs n enumertion (Listing elements of A) or if there exists ijection from N to A A set A is sid to e Countly innite if there exist ijection from N to A or if there exists n enumertion Countle sets re either countly nite or countly innite A = B if nd only if there exists ijection from A to B Prolem 6: Prove: N = I Solution: To prove there exist ijection from N to I Consider the function f : N I such tht f(x) = (x+), if x = k +, for some integer k nd f(x) = x, if x = k, for some integer k Clerly, this function is - nd onto Thus, N = I Prolem 7: Prove tht the set P of prime numers is innite Solution: For every prime numer x, we know tht there exists prime numer y > x Therefore,

we estlish mp etween N nd the set of prime numers f : N P such tht f(i) = P i ie, i th nturl numer mps to P i Therefore, there exists n enumertion nd hence P is countly innite Prolem 8: Prove tht the set of positive rtionl numers, Q +, is innite Solution: We elow enumerte(list) elements of Q + in systemtic wy s illustrted in the Figure We then estlish ijective function from N to Q + y following the rrows s illustrted in the gure This yields n enumertion nd mpping to N, therefore Q + is innite Thus, Q + is countly innite Numertor 0 0/ / / / N 0 f + Q 0/ 0/ / / / / Denomintor 0/ / / / / / Enumertion without repetitions Fig Enumertion of Q + Prolem 9: Prove tht the crdinlity of is countly innite Solution: We shll estlish this clim y listing the elements of using stndrd ordering ie, we rst list strings of length one, followed y strings of length two, nd so on Strings hving sme length will e listed s per lexicogrphic ordering An illustrtion s per stndrd ordering is shown elow N 0 5 6 f E * 0 Fig Enumertion nd ijective function from N to Prolem 0: Prove tht the numer of C-progrms is countly innite Solution: Let = {,,, z, A, B,, Z, $, {, }, \, } nd = {ɛ, String, String, } Note tht is precisely the set of keys ville in key ord (ASCII chrcters) It is esy to 5

see tht every C-progrm is n element in, ie, imgine the cse where we write C-progrm in horizontl fshion insted of verticl fshion Also, we re not concerned out whether the C-progrm is syntcticlly correct or not We know tht is countly innite, thus, numer of C-progrms is countly innite Prolem : Prove tht the numer of C-progrms with exctly sttements is countly innite? Solution: Let progrm- e x = x +, progrm- e x = x +,, progrm- e x = x + Clerly, the set of progrms (Progrm-,) is innite We further know from the previous clim tht the numer of C-progrms is countly innite Since this set is only suset of ll C-progrms, implies tht, the numer of C-progrms with exctly -sttements is countly innite Uncountle Sets In erlier sections, we introduced innite sets nd techniques for showing set is innite Further, we lso presented n pproch to count innite sets (countly innite) We now sk; is every set countle? ie, either countly nite or countly innite We nswer this in negtive nd show tht there re uncountle sets We next introduce cntor's fmous technique, digonliztion technique using which we show tht the set [0, ], the set of rel numers etween 0 nd is uncountle Prolem : Show tht [0, ] uncountle Solution: We present proof y contrdiction Suppose [0, ] is countle then there exists n enumertion, ie, listing of elements in [0, ] in systemtic wy; ENUM: x, x, Further, there exists ijection from N to ENUM Let x = 0x x x x x = 0x x x x x 0 = 0x x x x We now show tht the ove listing is incomplete y exhiiting n element y [0, ] nd y is not listed in ENUM Consider y = 0y y y y, such tht y i =, if x ii = nd y i =, if x ii Clerly, y [0, ] nd ny x i nd y will dier t one position (t lest one) Therefore, y is not enumerted in x, x, Thus, ENUM is incomplete nd our ssumption tht [0, ] is countle is wrong Therefore, [0, ] uncountle Note: Since [0, ] is uncountle, the set of rel numers R is uncountle Clim: Countle union of countle sets is countle Proof: Let A, A,, e set of countle sets Since ech set A i is countle, then there exists n enumertion of A i Construct mtrix with the rst row listing the elements of A, the second row listing the elements of A, nd so on Now, similr to the proof showing the set of rtionl numers is countle, enumerte the elements of the constructed mtrix to get nturl mpping to the set of nturl numers Therefore, the clim follows 6

Prolem : Is irrtionl numers countle? Solution: Assume tht irrtionl numers re countle Since rtionl numers re countle nd y the ove clim union of rtionl numers nd irrtionl numers is countle, however, this is precisely the set of rel numers, which is contrdiction Thus, the set of ll irrtionl numers re uncountle Prolem : Given tht is countly innite Is P ( ) countly innite? Solution: Suppose P ( ) is countly innite Since is countly innite we cn enumerte s x, x, x, Since P ( ) is countly innite, there exists n enumertion A, A, A,, where ech A i is suset of We now construct mtrix with row representing the sets (A i s) nd column representing x Tle entries s illustrted in Figure re lled s follows; if you nd x i in A j, plce in the corresponding cell, else plce 0 We now show tht there is suset in which is not listed s prt of the enumertion Choose x x x x A 0 0 A A 0 0 0 Fig Listing P ( ) nd in Mtrix B = {x j (A j, x j ) = 0} B P ( ) ut not listed s prt of the enumertion Therefore, the enumertion is incomplete Thus our ssumption is wrong Hence, P ( ) is uncountle Prolem 5: How mny computtionl prolems re there? Is it countle/uncountle Solution: Let prolem- sks for printing {0}, prolem- sks for printing {0, },, prolem-i sks for printing set contining i elements from N ie, ech prolem prints suset of N This prolem collection is sme s counting i element suset of P (N), power set of N Clerly, ll re computtionl prolems (well dened input nd output) nd hence the numer of computtionl prolems is strictly greter thn P (N) We hve lredy shown tht P (N) is uncountle, therefore, the numer of computtionl prolems is uncountle Solution: In the erlier section, while showing the numer of C-progrms is countly innite, we ssumed tht the lphet is nite lphet contining ll ASCII chrcters This ssumption is true while counting the numer of progrms s progrm size is nite However, this ssumption need not e true for descriing the prolem In other words, consider computtionl prolem, Print the irrtionl numer 0567, this description contins n innite string s sustring So, the prolem description tkes innite chrcters, which is P ( ) Thus, the numer of computtionl prolems is uncountle 7

Remrk on Solvility/Unsolvility: Every prolem is either solvle or unsolvle A prolem is sid to e solvle if there exists n lgorithm/progrm A prolem is sid to e unsolvle if there does not exists n lgorithm (Exmple: Print N, Print I) Prolem 6: How mny solvle prolems re there? Since ech solvle prolem hs n lgorithm or progrm, this count is equivlent to the numer of C-progrms nd therefore, the numer of solvle prolems is countly innite Prolem 7: How mny unsolvle prolems re there? Consider the set of progrms print [i, j] where i, j R, ech progrm in this set is unsolvle prolem s there is no lgorithm to list ll vlues of the closed intervl [0, ] nd this is true for ll [i, j] Since the size of this set is R, the numer of unsolvle prolems is uncountle Acknowledgements: Lecture contents presented in this module nd susequent modules re sed on the text ooks mentioned t the reference nd most importntly, lectures y discrete mthemtics exponents lited to IIT Mdrs; Prof PSreenivs Kumr, Prof Kml Krithivsn, Prof NSNrynswmy, Prof SAChoudum, Prof Arindm Singh, nd Prof RRm Author sincerely cknowledges ll of them Specil thnks to Teching Assistnts MrRenjithP nd MsDhnlkshmiS for their sincere nd dedicted eort nd mking this scrie possile This lecture scrie is sed on the course 'Discrete Structures for Computing' oered to BTech COE 0 tch during Aug-Nov 05 The uthor gretly eneted y the clss room interctions nd wishes to pprecite the following students: MrVignesh Sirj, MsKritik Prksh, nd MsLlith Finlly, uthor expresses sincere grtitude to MrSreerjR for thorough proof reding nd vlule suggestions for improving the presenttion of this rticle His vlule comments hve resulted in etter rticle References: KHRosen, Discrete Mthemtics nd its Applictions, McGrw Hill, 6th Edition, 007 DFStnt nd DFMcAllister, Discrete Mthemtics in Computer Science, Prentice Hll, 977 CLLiu, Elements of Discrete Mthemtics, Tt McGrw Hill, 995 8