200 likes | 303 Views
Introduction. Tomáš Vaníček Czech Technical University Faculty of Civil Engeneering, Thákurova 7, Praha Dejvice, B407 vanicek @fsv.cvut.cz On CZU office 414, old building PEF. Lecture Constents. Sets, set operations, mappings, cardinality Relations and Operations Logic, language PROLOG
E N D
Introduction • Tomáš Vaníček • Czech Technical University • Faculty of Civil Engeneering, Thákurova 7, Praha Dejvice, B407 • vanicek@fsv.cvut.cz • On CZU office 414, old building PEF
Lecture Constents • Sets, set operations, mappings, cardinality • Relations and Operations • Logic, language PROLOG • Formal languages • Finite Automata, regular languages • Other formal model of computing • Computational complexity of algorithms • Graphs • Analysis of algorithms: graph, sortinh, searching of extrems, heuristic algorithms
Literature • Vaníček,J., Papík,M., Pergl,R., Vaníček,T.: Teoretické základy informatiky, Kernberg Publishing, 2007 • Vaníček,J., Papík,M., Pergl,R., Vaníček,T.: Mathematical Foundation of Computer Science, Kernberg Publishing, 2008
Set Theory • Set is a well defined collection of items • The question wheather element belongs to the set or no, must be clearly answered • Element x belongs to set A, x A. • The element can be member of the set or no. • The element cannot be member of the set more times
Classes and Sets • Sets can be members of aother sets • Russels paradox • Mathematic needs to deal with proper defined terms • For proper foundation of mathematic the axiomatic set theory is necessary
Equality of sets, Subsets • Two sets are equal, if they have same members • Set with no elements is called empty: ø • Set A is subset of set B, if each element of A is element of B. • Set A if proper subset of B, if A is subset of B and A is not equal to B
Describing of sets • By enumeration of elemnts • A={1,2,3} • B={Prague, Vienna, Budapest, Bartislava} • C={1,2,1,2,3,4,1}={1,2,3,4}={1,3,4,2} • By distinctive predicate A={x|P(x)} • A={x|x N, x<4} • B={x|x is capital of central European country} • By using already defined set • C={x N| x<4}
Common set notations • Z… Set of Integers • Z+ … Set of positive integers • N… Set of nonnegative integers (natural numbers) • Q… Set of rational numbers • R… Set of real numbers • C… Set of complex numbers • R+, R-, Q+,…
Set operations • Union • Intersection • Difference • Symmetric difference • Potency set
Ordered pair • Ordered pair (a,b) is a set {{a,b},a}. a is assigned to be the first element. • Ordered n-tuple (a1,a2,…,an) could be defined by induction • For n=2 it is a ordered pair (a1,a2) • For n>2 it is a ordered pair of (n-1)-tuple (a2,…,an) and an element a1.
Cartesian product • Cartesian product A x B is a set of all ordered pairs (a,b), where a is from A and b is from B. • Cartesian product of finite system of sets A1xA2x…xAn is a set of all n-tuples (a1,…,an) where ai is from Ai.
Mappings • Mapping from set A to set B: for some elements of A there exist exactly one element of B • Mapping of set A to set B: for all elements of A there exist exactly one element of B • Mapping fromset A onto set B (surjection): Each element of B has its element in a such that m(a)=b (a is the pattern of b).
Mappings • Simple mapping (injection): for different patterns a1,a2 there are different images b1,b2. • Bijection (one-to-one mapping) is injection A onto B.
Cardinality of sets • Two finite sets A,B have same cardinality if there exist one-to-one mapping A onto B. • Cardinality of set A is represented as card(A), |A|, moh(A) • If card(A)≤card(B) there exist injection of A into B. • If card(A)≥card(B) there exist surjection of A onto B.
Cardinality of infinite sets • Two infinite sets A,B have same cardinality if there exist one-to-one mapping A onto B. • card(N) = card(Z) = card(Q) = aleph0 • Set of all (infinite) lists of 0,1 (L) has bigger cardinality then aleph0. • card(L)=card(R). • card(2M)>card(M)
Fuzziness • Reasons for uncertainty: • Stochastic character of the process (tomorrow will come rain) • Quantum uncertainty (temperature of water in the sink is 10 degrees) • Fuzziness of the term (I am a tall man)
Fuzzy sets • Classical set theory: element belongs to set or no. • There exist characteristic function of set A, MA. • MA = 1, while x A, MA = 0, while not x A. • Fuzzy set is determined by characteristic function μA from universe U to interval <0,1> • μA (x)= 1, while x is definitely in A. • μA (x)= 0, while x is definitely not in A. • μA is between 0 and 1, while x is not definitely in A not definitely outside of A.
Fuzzy sets • Support of A: supp(A)={xU|μA (x) > 0}. • Core of A: supp(A)={xU|μA (x) = 1}. • Height of fuzzy set: sup(supp(A)). • Normal fuzzy set: Height equal to 1. • α-level of the fuzzy set A {xU|μA (x) ≥ α}. • Α-cut of the fuzzy set A {xU|μA (x) = α}.
Fuzzy set operations • A is subset of B: μA (x) ≤ μB(x) • B is difference of A: μB(x) = 1 - μA(x) • C is (standard) union of A and B: μC(x)=max(μA(x), μB(x)) • C is (standard) intersection of A and B: μC(x)=min(μA(x), μB(x))
Fuzzy numbers • Let a≤b≤c≤d be four real numbers such that: • μA(x)=0 , for x<a and x>d • μA(x)=1 , for x between b and c • μA(x) is increasing between a and b. • μA(x)is decreasing between c and d. • Such set A we call fuzzy interval. • If b=c we call such a set fuzzy number.