版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Module #2:The Theory of Sets,Rosen 7th ed., §§2.1-2.2,2 Basic Structures: Sets, Functions, Sequences , Sums and Matrices,2.1 Sets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 2.5 Cardinali
2、ty of Sets2.6 Matrices,Introduction to Set Theory 集合論(§2.1),A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different) objects.Set theory deals
3、with operations between, relations among, and statements about sets.Sets are ubiquitous in computer software systems.All of mathematics can be defined in terms of some form of set theory (using predicate logic).,Na
4、9;ve set theory,Basic premise: Any collection or class of objects (elements) that we can describe (by any means whatsoever) constitutes a set.But, the resulting theory turns out to be logically inconsistent! This means
5、, there exist naïve set theory propositions p such that you can prove that both p and ?p follow logically from the axioms of the theory!? The conjunction of the axioms is a contradiction!This theory is fundamental
6、ly uninteresting, because any possible statement in it can be (very trivially) “proved” by contradiction!More sophisticated set theories fix this problem.,Basic notations for sets,For sets, we’ll use variables S, T, U,
7、… We can denote a set S in writing by listing all of its elements in curly braces: {a, b, c} is the set of whatever 3 objects are denoted by a, b, c.Set builder notation: For any proposition P(x) over any universe of
8、discourse, {x|P(x)} is the set of all x such that P(x).,Basic properties of sets,Sets are inherently unordered:No matter what objects a, b, and c denote, {a, b, c} = {a, c, b} = {b, a, c} ={b, c, a} = {c, a, b} = {c,
9、b, a}.All elements are distinct (unequal);multiple listings make no difference!If a=b, then {a, b, c} = {a, c} = {b, c} = {a, a, b, a, b, c, c, c, c}. This set contains (at most) 2 elements!,Definition of Set Equali
10、ty集合相等,Two sets are declared to be equal if and only if they contain exactly the same elements.In particular, it does not matter how the set is defined or denoted.For example: The set {1, 2, 3, 4} = {x | x is an int
11、eger where x>0 and x0 and <25},Infinite Sets無限集,Conceptually, sets may be infinite (i.e., not finite, without end, unending).Symbols for some special infinite sets:N = {0, 1, 2, …} The Natural numbers.Z = {…,
12、 -2, -1, 0, 1, 2, …} The Zntegers.R = The “Real” numbers, such as 374.1828471929498181917281943125…“Blackboard Bold” or double-struck font (?,?,?) is also often used for these special number sets.Infinite sets come i
13、n different sizes!,Venn Diagrams文氏圖,0,-1,1,2,3,4,5,6,7,8,9,,,,,,Integers from -1 to 9,Positive integers less than 10,Even integers from 2 to 9,Odd integers from 1 to 9,Primes <10,John Venn1834-1923,Basic Set Relatio
14、ns:Member of成員,x?S (“x is in S”) is the proposition that object x is an ?lement or member of set S.e.g. 3?N, “a”?{x | x is a letter of the alphabet}Can define set equality in terms of ? relation:?S,T: S=T ? (?x: x?S ?
15、 x?T)“Two sets are equal iff they have all the same members.”x?S :? ?(x?S) “x is not in S”,The Empty Set空集,? (“null”, “the empty set”) is the unique set that contains no elements whatsoever.? = {} = {x|False}No
16、matter the domain of discourse,we have the axiom ??x: x??.,Subset子集,S?T (“S is a subset of T”) means that every element of S is also an element of T.S?T ? ?x (x?S ? x?T)??S, S?S.,Proper (Strict) Subsets真子集,S?T (“S is
17、a proper subset of T”) means that S?T but .,,,S,T,Venn Diagram equivalent of S?T,Example:{1,2} ?{1,2,3},Sets Are Objects, Too!,The objects that are elements of a set may themselves be sets.E.g. let S={x | x
18、? {1,2,3}}then S={?, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}}Note that 1 ? {1} ? {{1}} !!!!,,VeryImportant!,,Cardinality and Finiteness基數(shù),|S| (read “the cardinality of S”
19、) is a measure of how many different elements S has.E.g., |?|=0, |{1,2,3}| = 3, |{a,b}| = 2, |{{1,2,3},{4,5}}| = ____If |S|?N, then we say S is finite.Otherwise, we say S is infinite.What are some infini
20、te sets we’ve seen?,2,N,Z,R,The Power Set 冪集Operation,The power set P(S) of a set S is the set of all subsets of S. P(S) :≡ {x | x?S}.E.g. P({a,b}) = {?, {a}, , {a,b}}.Sometimes P(S) is written 2S.Note that for fi
21、nite S, |P(S)| = 2|S|.It turns out ?S:|P(S)|>|S|, e.g. |P(N)| > |N|.There are different sizes of infinite sets!,Review: Set Notations So Far,Variable objects x, y, z; sets S, T, U.Literal set {a, b, c} and set
22、-builder {x|P(x)}.? relational operator, and the empty set ?.Set relations =, ?, ?, ?, ?, ?, etc.Venn diagrams.Cardinality |S| and infinite sets N, Z, R.Power sets P(S).,Naïve Set Theory is Inconsistent,There a
23、re some naïve set descriptions that lead to pathological structures that are not well-defined.(That do not have self-consistent properties.)These “sets” mathematically cannot exist.E.g. let S = {x | x?x }. Is S?
24、S?Therefore, consistent set theories must restrict the language that can be used to describe sets.For purposes of this class, don’t worry about it!,Bertrand Russell1872-1970,Ordered n-tuples 有序n元組,These are like sets,
25、 except that duplicates matter, and the order makes a difference. Ordered pairs 序偶For n?N, an ordered n-tuple or a sequence or list of length n is written (a1, a2, …, an). Its first element is a1, etc.Note that
26、(1, 2) ? (2, 1) ? (2, 1, 1).Empty sequence, singlets, pairs, triples, quadruples, quintuples, …, n-tuples.,Contrast withsets’ {},,Cartesian Products of Sets迪卡爾集,For sets A, B, their Cartesian productA?B :? {(a, b) |
27、 a?A ? b?B }.E.g. {a,b}?{1,2} = {(a,1),(a,2),(b,1),(b,2)}Note that for finite A, B, |A?B|=|A||B|.Note that the Cartesian product is not commutative: i.e., ??AB: A?B=B?A.Extends to A1 ? A2 ? … ? An...,René Desc
28、artes (1596-1650),Definition of relations,Let A and B be two sets. A binary relation R from A to B is a subset of A × B.Note that the order of the two sets matters.More generally, let A1, A2, ..., An be n sets. A
29、n n-ary relation R on these sets is a subset of A1 × A2 × ... × An.The sets Ai are known as the domains of the relation, and n as its degreeAgain, the order of the domains matters.,Review of §2.1,Se
30、ts S, T, U… Special sets N, Z, R.Set notations {a,b,...}, {x|P(x)}…Set relation operators x?S, S?T, S?T, S=T, S?T, S?T. (These form propositions.)Finite vs. infinite sets.Set operations |S|, P(S), S?T.,Start §2
31、.2: 集合運算The Union Operator并,For sets A, B, their?nion A?B is the set containing all elements that are either in A, or (“?”) in B (or, of course, in both).Formally, ?A,B: A?B = {x | x?A ? x?B}.Note that A?B is a supers
32、et of both A and B (in fact, it is the smallest such superset): ?A, B: (A?B ? A) ? (A?B ? B),{a,b,c}?{2,3} = {a,b,c,2,3}{2,3,5}?{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7},Union Examples,The Intersection Operator交,For sets A,
33、B, their intersection A?B is the set containing all elements that are simultaneously in A and (“?”) in B.Formally, ?A,B: A?B={x | x?A ? x?B}.Note that A?B is a subset of both A and B (in fact it is the largest such sub
34、set): ?A, B: (A?B ? A) ? (A?B ? B),{a,b,c}?{2,3} = ___{2,4,6}?{3,4,5} = ______,,Intersection Examples,?,{4},Disjointedness 互斥,Two sets A, B are calleddisjoint (i.e., unjoined)iff their intersection isempty. (A?B=?
35、)Example: the set of evenintegers is disjoint withthe set of odd integers.,Inclusion-Exclusion Principle容斥原理,How many elements are in A?B? |A?B| = |A| ? |B| ? |A?B|Example: How many students are on our class email
36、list? Consider set E ? I ? M, I = {s | s turned in an information sheet}M = {s | s sent the TAs their email address}Some students did both! |E| = |I?M| = |I| ? |M| ? |I?M|,Subtract out itemsin intersection, tocomp
37、ensate fordouble-counting them!,Set Difference差,For sets A, B, the difference of A and B, written A?B, is the set of all elements that are in A but not B. Formally: A ? B :? ?x ? x?A ? x?B? ? ?x ?
38、??x?A ? x?B? ?Also called: The complement of B with respect to A.,Set Difference Examples,{1,2,3,4,5,6} ? {2,3,5,7,9,11} = ___________Z ? N ? {… , ?1, 0, 1, 2, … } ? {0, 1, … } = {x | x is an inte
39、ger but not a nat. #} = {x | x is a negative integer} = {… , ?3, ?2, ?1},{1,4,6},,,,,,,,,,Set Difference - Venn Diagram,A?B is what’s left after B“takes a bite out of A”,,Set A,,Set B,Set Complemen
40、ts補,The universe of discourse can itself be considered a set, call it U.When the context clearly defines U, we say that for any set A?U, the complement of A, written , is the complement of A w.r.t. U, i.e., it is U?A
41、.E.g., If U=N,,More on Set Complements,An equivalent definition, when U is clear:,,,A,U,,,Set Identities特性,Identity: A?? = A = A?UDomination: A?U = U , A?? = ?Idempotent: A?A = A = A?ADouble complem
42、ent: Commutative: A?B = B?A , A?B = B?AAssociative: A?(B?C)=(A?B)?C , A?(B?C)=(A?B)?C,DeMorgan’s Law for Sets,Exactly analogous to (and provable from) DeMorgan’s Law for propositions.,Prov
43、ing Set Identities,To prove statements about sets, of the form E1 = E2 (where the Es are set expressions), here are three useful techniques:1. Prove E1 ? E2 and E2 ? E1 separately.2. Use set builder notation & lo
44、gical equivalences.3. Use a membership table.,Method 1: Mutual subsets,Example: Show A?(B?C)=(A?B)?(A?C).Part 1: Show A?(B?C)?(A?B)?(A?C).Assume x?A?(B?C), & show x?(A?B)?(A?C).We know that x?A, and either x?B or
45、 x?C.Case 1: x?B. Then x?A?B, so x?(A?B)?(A?C).Case 2: x?C. Then x?A?C , so x?(A?B)?(A?C).Therefore, x?(A?B)?(A?C).Therefore, A?(B?C)?(A?B)?(A?C).Part 2: Show (A?B)?(A?C) ? A?(B?C). …,Method 3: Membership Tables,Ju
46、st like truth tables for propositional logic.Columns for different set expressions.Rows for all combinations of memberships in constituent sets.Use “1” to indicate membership in the derived set, “0” for non-membership
47、.Prove equivalence with identical columns.,Membership Table Example,Prove (A?B)?B = A?B.,,,Membership Table Exercise,Prove (A?B)?C = (A?C)?(B?C).,Review of §2.1-2.2,Sets S, T, U… Special sets N, Z, R.Set notations
48、 {a,b,...}, {x|P(x)}…Relations x?S, S?T, S?T, S=T, S?T, S?T. Operations |S|, P(S), ?, ?, ?, ?, Set equality proof techniques:Mutual subsets.Derivation using logical equivalences.,Generalized Unions & Intersecti
49、ons,Since union & intersection are commutative and associative, we can extend them from operating on ordered pairs of sets (A,B) to operating on sequences of sets (A1,…,An), or even on unordered sets of sets,X={A |
50、P(A)}.,Generalized Union,Binary union operator: A?Bn-ary union:A?A2?…?An :? ((…((A1? A2) ?…)? An)(grouping & order is irrelevant)“Big U” notation:Or for infinite sets of sets:,Generalized Intersection,Binary in
51、tersection operator: A?Bn-ary intersection:A1?A2?…?An?((…((A1?A2)?…)?An)(grouping & order is irrelevant)“Big Arch” notation:Or for infinite sets of sets:,Representations,A frequent theme of this course will be
52、methods of representing one discrete structure using another discrete structure of a different type. E.g., one can represent natural numbers asSets: 0:??, 1:?{0}, 2:?{0,1}, 3:?{0,1,2}, …Bit strings: 0:?0, 1:?1, 2:?1
53、0, 3:?11, 4:?100, …,Representing Sets with Bit Strings,For an enumerable u.d. U with ordering x1, x2, …, represent a finite set S?U as the finite bit string B=b1b2…bn where?i: xi?S ? (i<n ? bi=1).E.g. U=N, S={2,3,5
54、,7,11}, B=001101010001.In this representation, the set operators“?”, “?”, “? ” are implemented directly by bitwise OR, AND, NOT!,作業(yè),2.1 6,10,16,22,32,442.2 4,19,30,48,52,56,Module #3:Functions,Rosen 7th ed.,
55、167;2.3,On to section 2.3… Functions,From calculus, you are familiar with the concept of a real-valued function f, which assigns to each number x?R a particular value y=f(x), where y?R.But, the notion of a function can
56、 also be naturally generalized to the concept of assigning elements of any set to elementsof any set. (Also known as a map.),Function: Formal Definition,For any sets A, B, we say that a function f from (or “mapping”) A
57、 to B (f:A?B) is a particular assignment of exactly one element f(x)?B to each element x?A.Some further generalizations of this idea:A partial (non-total) function f assigns zero or one elements of B to each element x?
58、A.Functions of n arguments; relations (ch. 6).,Graphical Representations,Functions can be represented graphically in several ways:,,,?,?,,A,B,,a,b,f,f,?,?,?,?,?,?,?,?,,,,,,?,,,,x,y,Plot,Bipartite Graph,Like Venn diagram
59、s,A,B,Functions We’ve Seen So Far,A proposition can be viewed as a function from “situations” to truth values {T,F}A logic system called situation theory.p=“It is raining.”; s=our situation here,nowp(s)?{T,F}.A propo
60、sitional operator can be viewed as a function from ordered pairs of truth values to truth values: e.g., ?((F,T)) = T.,Another example: →((T,F)) = F.,More functions so far…,A predicate can be viewed as a function from obj
61、ects to propositions (or truth values): P :≡ “is 7 feet tall”; P(Mike) = “Mike is 7 feet tall.” = False.A bit string B of length n can be viewed as a function from the numbers {1,…,n}(bit positions) to the bits {0,1}
62、.E.g., B=101 ? B(3)=1.,Still More Functions,A set S over universe U can be viewed as a function from the elements of U to{T, F}, saying for each element of U whether it is in S. S={3}? S(0)=F, S(3)=T.A set operato
63、r such as ?,?,? can be viewed as a function from pairs of setsto sets. Example: ?(({1,3},{3,4})) = {3},A Neat Trick,Sometimes we write YX to denote the set F of all possible functions f:X?Y.This notation is especial
64、ly appropriate, because for finite X, Y, we have |F| = |Y||X|. If we use representations F?0, T?1, 2:?{0,1}={F,T}, then a subset T?S is just a function from S to 2, so the power set of S (set of all such fns.) is 2S in
65、 this notation.,Some Function Terminology,If it is written that f:A?B, and f(a)=b (where a?A & b?B), then we say:A is the domain of f. B is the codomain of f.b is the image of a under f.a is a pre-image of b und
66、er f.In general, b may have more than 1 pre-image.The range R?B of f is R={b | ?a f(a)=b }.,We also saythe signatureof f is A→B.,Range versus Codomain,The range of a function might not be its whole codomain.The codo
67、main is the set that the function is declared to map all domain values into.The range is the particular set of values in the codomain that the function actually maps elements of the domain to.,Images of Sets under Funct
68、ions,Given f:A?B, and S?A,The image of S under f is simply the set of all images (under f) of the elements of S.f(S) :? {f(s) | s?S} :? {b | ? s?S: f(s)=b}.Note the range of f can be defined as simply the
69、 image (under f) of f’s domain!,Range vs. Codomain - Example,Suppose I declare to you that: “f is a function mapping students in this class to the set of grades {A,B,C,D,E}.”At this point, you know f’s codomain is: ____
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 離散數(shù)學(xué) 7
- 離散數(shù)學(xué)第2.1陳瑜 1
- 離散數(shù)學(xué)第7章
- 離散數(shù)學(xué)第二版答案6-7章
- 離散數(shù)學(xué)
- 離散數(shù)學(xué)課件第7章
- 離散數(shù)學(xué)第7章-圖論-習(xí)題
- 離散數(shù)學(xué)課件第6章
- 離散數(shù)學(xué)-7-6對偶圖與著色7-7-樹復(fù)習(xí)
- 離散數(shù)學(xué)緒論
- 離散數(shù)學(xué)基礎(chǔ)
- 離散數(shù)學(xué)a答案
- 離散數(shù)學(xué)謂詞
- 離散數(shù)學(xué)圖論
- 離散數(shù)學(xué)高等里離散數(shù)學(xué)-課件-chapt15
- 離散數(shù)學(xué)答案
- 離散數(shù)學(xué)答案
- 范式--離散數(shù)學(xué)
- 離散數(shù)學(xué) 2
- 離散數(shù)學(xué)符號
評論
0/150
提交評論