0_Version2 - 91.304 Foundations of Computer Science Chapter...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
1 91.304 Foundations of Computer Science Chapter 0 Lecture Notes Prof. David Martin and Prof. Giam Pecelli (with modifications by Prof. Karen Daniels) This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 About These Notes ± Designed to be used with Sipser’s Introduction to the Theory of Computation ± Available through “Lecture notes” link on course web page ± Note that examples & various other things are not included here
Background image of page 2
3 Basic Objects and Notation ± N = { 1, 2, 3, 4, . .. } ² Some texts include 0; Sipser doesn't ± Z = { . .., -2, -1, 0, 1, 2, . .. } ² Z + = N ± R = set of all real numbers ± Q = set of all rational (quotient) numbers ± PosEven = { 2n | n N } ² { x | predicate(x) } ² Tiny constraints are sometimes added to the left of |, as in ± PosEven = { n N : n % 2 = 0 } ² Sometimes : is used instead of |
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Scope of Intentional Notation ± Variables inside { x | pred(x) } are local ± Think of the specification as a mathematical program ² We will see many programming languages this term: DFAs, NFAs, Regex, PDAs, TMs, C++, . .. ² Mathematical notation is a type of precise specifier – i.e., a programming language ² Turns out it is far more powerful than our ordinary programming languages – we'll prove this later
Background image of page 4
5 Scope of Intentional Notation ± { 2n | n N } = { n N : n % 2 = 0 } ± These are two different programs that produce the same set different vars
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Set Operations ± –Un ion–D is junct ion–Or ² { 0, 3, 6, 9 } { 0, 2, 4, 6, 8 } = ? ± – Intersection – Conjunction – And ² { 0, 3, 6, 9 } { 0, 2, 4, 6, 8 } = ?
Background image of page 6
7 Set Operations ± Complement PosOdd = PosEven c ... depending ² For a set A, Universe is implicit. Be careful!!! ± Set difference PosOdd = N - PosEven = { 1, 3, 5, . ..} ² For sets A & B, A – B = { x | x A and x B } = A B c (see HW#1, Problem 1)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 More Set Operations ± Cardinality If A is a set, then is not very precise, but oh well. We’ll improve upon this later when we start counting infinities
Background image of page 8
9 More on Sets ± The empty set: = {} ± The number of {} matters: ² { } { { }, } ± Elements of a set ² { 5 } { 1, {2,3}, , { 5 }, 2 } ² { 3 } { 1, {2,3}, , { 5 }, 2 } ² { 1, {2,3}, , { 5 }, 2 } ² Is always a member of a set even if it is not explicitly listed? ± Subset ² { 1, { 5 } } { 1, {2,3}, , { 5 }, 2 } ² ∅⊆ { 1, {2,3}, , { 5 }, 2 } ² {2,3} * { 1, {2,3}, , { 5 }, 2 }
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 More Set Operations ± Cartesian Product (aka Cross Product) If A and B are sets, then ² A × B = { (a,b) | a A and b B } ± Note that the × operator "preserves structure" by wrapping parentheses and commas around its arguments ± { 1,3 } × { c, d, f } = ? ± If |A| = n and |B| = m, then |A × B| = ?
Background image of page 10
11 More Set Operations ± Generalizing to more sets:
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12 More Set Operations ± Power set P (A) = 2 A = { x | x A } ± Important equivalence ² x A means the same as x P (A) ± Examples: ² P ({1,2}) = { , {1}, {2}, {1,2} } ² P ( ) = ?
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2012 for the course CS 91.304 taught by Professor Staff during the Fall '11 term at UMass Lowell.

Page1 / 61

0_Version2 - 91.304 Foundations of Computer Science Chapter...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online