Download presentation
Presentation is loading. Please wait.
Published byByron Ray Modified over 9 years ago
1
CS466 (Prasad)L1Sets1 Introduction Language: Set of Strings
2
CS466 (Prasad)L1Sets2 Specification and recognition of languages Sets Operations Defining sets (inductively) Proving properties about sets (using induction) Defining functions on sets (using recursion) Proving properties about functions (using induction) Strings Operations Languages : set of strings Operations
3
CS466 (Prasad)L1Sets3 Representation of Sets Set: collection of objects –Finite : can use enumeration E.g., {a,b,c} –Infinite : requires describing characteristic property of members finitely E.g., { n N | even(n) /\ square(n) } COURSE GOAL: Study techniques for finitely describing specific families of sets
4
CS466 (Prasad)L1Sets4 Semantics - Syntax Regular sets/languages –Generator Regular Expressions, Regular Grammars –Recognizer Finite State Automata Context-free languages –Generator Context-free Grammar –Recognizer Push-down Automata
5
CS466 (Prasad)L1Sets5 Member, Union, Intersection, Subset, Powerset, Cartesian product, … Set Difference DeMorgan’s Laws Operations on Sets
6
CS466 (Prasad)L1Sets6 Partition of a Set X The set partition of non-empty subsets of X is a partition of X iff (1) “covering” (2) “pair-wise disjoint” Collectively Exhaustive / Mutually Exclusive
7
CS466 (Prasad)L1Sets7 Examples Set of Natural numbers is partitioned by “mod 5” relation into five “equivalence classes”: { {0,5,10,…}, {1,6,11,…}, {2,7,12,…}, {3,8,13,…}, {4,9,14,…} } “String length” can be used to partition the set of all bit strings. { {},{0,1},{00,01,10,11},{000,…,111},… }
8
CS466 (Prasad)L1Sets8 (Total) Function A B f Domain Co-domain ( Range)
9
CS466 (Prasad)L1Sets9 One-One Function (injection) A B f Domain Co-domain ( Range)
10
CS466 (Prasad)L1Sets10 Onto Function (surjection) A B f Domain Co-domain ( Range)
11
CS466 (Prasad)L1Sets11 One to one correspondence Function (bijection) A B f Domain Co-domain ( Range)
12
CS466 (Prasad)L1Sets12 Inductive Definitions Constructive Example –Set of natural numbers N = {0,1,2,3,…} – Finite representation in terms of Seed element: zero Closure Operation: successor function {0,s(0),s(s(0)),s(s(s(0))),…} –Imposes additional structure on the domain.
13
CS466 (Prasad)L1Sets13 Basis case: Recursive step: Closure: only if it can be obtained from 0 by a finite number of applications of the operation s. (* Minimality condition to uniquely determine N *)
14
CS466 (Prasad)L1Sets14 URLs for Visualizing Recursion http://math.rice.edu/~lanius/fractals/ http://www-mickunas.cs.uiuc.edu/java- book.old/code/ch11/applets/HilbertApplet.html http://www-mickunas.cs.uiuc.edu/java- book.old/code/ch11/applets/SierpinskiApplet.html http://www-mickunas.cs.uiuc.edu/java- book.old/solutions/ch11/SierpinskiGasket.html
15
CS466 (Prasad)L1Sets15 Recursive Definitions of Functions Addition –Basis case: –Recursive step: –Closure: … Multiplication –Basis case: –Recursive step: –Closure: …
16
CS466 (Prasad)L1Sets16 Defining a Subset of Grid Points y x
17
CS466 (Prasad)L1Sets17 Explicit Definition Implicit Definition Recursive Definition
18
CS466 (Prasad)L1Sets18 Other Recursive Definitions
19
CS466 (Prasad)L1Sets19 Observations Recursive definition of a set typically contains a finite number of seed elements and a finite number of rules to generate successive sets of points, whose infinite union yields the set. Even though the various definitions “look” different, they capture the same set. Equivalence Problem.
20
CS466 (Prasad)L1Sets20 Another Example
21
CS466 (Prasad)L1Sets21 “Generation”
22
CS466 (Prasad)L1Sets22 Principle of Mathematical Induction PBasis: P holds for every element in PInduction Step: If, whenever P holds for every element in P P also holds for every element in then, by PMI, P P holds for every element in
23
CS466 (Prasad)L1Sets23 Let be the Fibonacci number. Then, prove that Basis: Hypothesis: Prove: Example
24
CS466 (Prasad)L1Sets24 Proof (Induction Hypothesis)
25
CS466 (Prasad)L1Sets25 Example Strictly Binary Tree Single node. Every node is a leaf or has precisely two children. Prove that for all SBTs: 2*leaves(T) - 2 = arcs(T) T1 T2
26
CS466 (Prasad)L1Sets26 (Induction on the number of nodes or height.) Basis: 2*1 - 2=0 Induction Hypothesis: For trees of height h <, the result holds. Induction Step: Show it holds for trees of height 2*leaves(T1) - 2=arcs(T1) (induction hypothesis) 2*leaves(T2) - 2=arcs(T2) 2*(leaves(T1)+leaves(T2)) - 2 - 2=arcs(T1)+arcs(T2) 2*leaves(T) - 2=arcs(T)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.