Prelims

Prelims - Harvard CS121 and CSCI E-207 Lecture 2:...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Harvard CS121 and CSCI E-207 Lecture 2: Mathematical Preliminaries Harry Lewis September 8, 2009 Reading: Sipser, Chapter 0 Harvard CS 121 & CSCI E-207 September 8, 2009 Sets Sets are defined by their members A = B means that for every x , x A iff x B Example: N = { , 1 , 2 ,... } Cardinality Sets can be finite (e.g. { 1 , 3 , 5 } ) or infinite (e.g. N ). Q: Is {N} finite? If A is finite ( A = { a 1 ,...,a n } for some n N ), then its cardinality (or size ) | A | is the number of elements in A . The empty set has cardinality 0. Cardinality of infinite sets to be discussed later! 1 Harvard CS 121 & CSCI E-207 September 8, 2009 Set Operations union { a,b } { b,c } = { a,b,c } intersection { a,b } { b,c } = { b }- difference { a,b } - { b,c } = { a } A and B are disjoint iff A B = The power set of S = P ( S ) = { X : X S } e.g. P ( { a,b } ) = { , { a } , { b } , { a,b }} Q: What is | P ( S ) | ? The Cartesian product of sets A,B A B = { ( a,b ) : a A,b B } triples, . . . 2 Harvard CS 121 & CSCI E-207 September 8, 2009 Set Operations union { a,b } { b,c } = { a,b,c } intersection { a,b } { b,c } = { b }- difference { a,b } - { b,c } = { a } A and B are disjoint iff A B = The power set of S = P ( S ) = { X : X S } e.g. P ( { a,b } ) = { , { a } , { b } , { a,b }} Q: What is | P ( S ) | ? The Cartesian product of sets A,B A B = { ( a,b ) : a A,b B } triples, . . . 3 Harvard CS 121 & CSCI E-207 September 8, 2009 Set Operations union { a,b } { b,c } = { a,b,c } intersection { a,b } { b,c } = { b }- difference { a,b } - { b,c } = { a } A and B are disjoint iff A B = The power set of S = P ( S ) = { X : X S } e.g. P ( { a,b } ) = { , { a } , { b } , { a,b }} Q: What is | P ( S ) | ? The Cartesian product of sets A,B A B = { ( a,b ) : a A,b B } triples, . . . 4 Harvard CS 121 & CSCI E-207 September 8, 2009 Functions A function f : S T maps each element s S to (exactly one) element of T , denoted f ( s ) . For example, f ( n ) = n 2 is a function from Z N ( Z = all integers) 5 Harvard CS 121 & CSCI E-207 September 8, 2009 Special varieties of functions S T 1-1: s 1 6 = s 2 f ( s 1 ) 6 = f ( s 2 ) S T Onto: For every t T there is an s S such that f ( s ) = t S T Bijection: 1-1 and onto 1-1 Correspondence Formal definition of cardinality:...
View Full Document

Page1 / 31

Prelims - Harvard CS121 and CSCI E-207 Lecture 2:...

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

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