Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Cardinality and Algebraic Structures Dr Jonathan Lawry Dept. Eng. Maths. Room 2.19(a) email:[email protected] Contents • 1 Introduction • 2 Combinatorics, permutations and combinations. • 3 Algebraic Structures and matrices: Homomorphism, commutative diagrams, isomorphism, semigroup, monoid, rings and fields • 4 Lattice and Boolean algebras Introduction • Computer programs frequently handle real world data. • This data might be financial e.g. processing the accounts of a company. • It may be engineering data e.g. from sensors or actuators in a robotic system. • It may be scientific data e.g. weather data or geological data concerning rock strata. • In all these cases data typically consists of a set of discrete elements. • Furthermore there may exist orderings or relationships among elements or objects. • It may be meaningful to combine objects in some way using operators. • We hope to clarify our concepts of orderings and relationships among elements or objects • We look at the idea of formal structures such as groups , rings and and formal systems such as lattices and Boolean algebras Number Systems • The set of natural numbers is the infinite set of the positive integers. It is denoted N and can have different representations: {1,2,3,4,........} {1,10,11,100,101,.....} are alternative representations of the same set expressed in different bases. Nm is the set of the first m positive numbers i.e. {1,2,3,4, ......,m}. N0 is the set of natural numbers including 0 i.e. {0,1,2,3,5,....} • Q denotes the set of rational numbers i.e. signed integers and fractions {0,1,-2,2,-3,3,-3,....,1/2,-1/2,3/2,-3/2,5/2, -5/2,....,1/3,-1/3,2/3,-2/3,........} • R is the set of real numbers i.e. the coordinates of all the points on a line. • Z is the set of all integers, both positive and negative {.....,-3,-2,-1,0,1,2,3,......} 2 Combinatorics: Permutations • A permutation of the elements of a set A is a bijection from A onto itself. • If A is finite we can calculate the number of different permutations. Suppose A={a1,...,an} n choices a1 n-1 choices a2 1 choice an total number of ways of filling the n boxes n x (n-1)x(n-2)x(n-3)..............x1=n! nPn=n! eg a possible permutation of {1,2,3,4,5,6} is 1 2 3 4 5 6 5 6 3 1 4 2 Composition of Permutations • If :A A and :A A are permutations of A then the composition or product .of and satisfies for all x in A .x)= (x)) Notice that since both and are bijections from A into A so is . In other words . is a permutation of A. • Example: Let A={1,2,3,4,5,6} then two possible permutations are 1 2 3 4 5 6 5 6 3 1 4 2 1 2 3 4 5 3 2 6 1 4 For . we have that 1 5 4,2 6 5,3 3 6 4 1 3,5 4 1,6 2 2 1 2 3 4 5 6 . 4 5 6 3 1 2 6 5 Cyclic Permutations A cyclic permutation on a set A of n elements has the form where k n : a1 a 2 a2 a3 a k-1 ak ak a1 a k +1 a k +1 a n a n For shorthand we often write a 1 a 2 ak is said to be a k cycle Example 6 1 1 4 4 2 3 5 6 2 3 5 or (6 1 4) is a cyclic permutation Two cyclic permutations a 1 a 2 ak b t are said to be disjoint if and b1 b2 a1, ,a k b1 , , bt e.g. (4 5 2) and (3 1 6) are disjoint Notice that 1 2 3 4 5 6 1 5 5 6 3 1 4 2 4 2,6 3 Other examples are 1 2 4 2 3 4 5 1 2 5 3 1 4 2 3 4 5 3 5 1 4 2 5 3 1 or 1 2 3 4 2 3 1 5 5 6 1 2 3 4 4 6 5 6 Can you spot a product of disjoint cyclic permutations equivalent to the following permutation ? 1 2 1 7 3 4 4 6 5 6 7 2 3 5 • Theorem: Every permutation of a finite set A can be expressed as a combination of disjoint cycles. Structure underlying permutations Note that the following hold: (1) The product of two permutations is a uniquely determined permutation of the same set. (2) The composition of permutations is associative. (3) The permutation a1 a2 a n I= a 1 a 2 a n is called the identity permutation and has the property that I. = .I = (4) For every permutation a1 = b1 b1 = a 1 1 a2 b2 b2 a2 a n there is an inverse b n bn a n such that 1 1 . . I Combinations • When we think about combinations we do not allow repeats and unlike permutations we do not consider order. • Combinations look at the number of different ways of picking a subset of k elements from a set of n elements. • Think of the number of ways of picking a list of k distinct elements of n no. of choices n n-1 n-k-2 n-k-1 places = n(n-1)(n-2) ........... (n-k-1) = n!/(n-k)! For each possible list there are k! permutations so since we are not interested in order we should divide the above by k!. C(n,k) = Cnk = n!/(n-k)!k! • Example: Choosing 2 elements from {a,b,c,d} {a,b},{a,c},{a,d}, {b,c},{b d},{c,d} C(4,2)= 4!/(2! 2!) =6 Combinations with Repetitions We could also consider combinations with repetitions. With repetitions the number of distinct combinations of k elements chosen from n is: C(n+k-1,k)= (n+k-1)!/k!(n-1)! Number of different throws of 2 identical dice (1 1)(2 2)(3 3)(4 4)(5 5)(6 6) (1 2)(1 3)(1 4)(1 5)(1 6) (2 3)(2 4)(2 5)(2 6) (3 4)(3 5)(3 6)(4 5)(4 6)(5 6) C(7,2)=21 Algebraic Structures • When we consider the behaviour of permutations under the composition operation we noticed certain underlying structures. • Permutations are closed under this operation, they exhibit associativity, an identity element exists and an inverse exists for each permutation • These properties define a general type of algebraic structure called a group. • In this section we shall look at groups in more detail as well as other similar algebraic structures such as semigroups and monoids. • Later we wll progress to consider more complex algebraic structures such as rings, integral domains and fields. • We will see that many real life situations are examples of these algebraic structures Groups A group G, or G, is a set G with binary operation which satisfies the following properties 1. is a closed operation i.e. if a G and b G then a b G 2. a,b,c G a b c a b c this is the associative law 3. G has an element e, called the identity, such that a G a e = e a = a 4. a G there corresponds an element a-1 G such that a a-1 a-1 a = e Examples: (1) The set of all permutations of a set A onto itself is group (called the symmetric group Sn for n elements). (2) The set consisting of all (nxn) matrices that have inverses is a group under ordinary matrix multiplication( it is called GL(n) ). Group of Symmetries of a Triangle Consider the triangle l X O Y Z n m We can perform the following transformations on the triangle 1=identity mapping from the plane to itself p=rotation anticlockwise about O through 120 degrees q=rotation clockwise about O through 120 degrees a=reflection in l b=reflection in m c=reflection in n Let x y denote transformation y followed by transformation x for x and y in {1,p,q,a,b,c} So for example p a = c l l X X a O mY l Y p O O Z n mZ m X Y n 1 p q a b c 1 1 p q a b c p p q 1 c a b q q 1 p b c a a a b c 1 p q b b c a q 1 p c c b p q 1 a Notice the table is not symmetric Zn Abelian Groups If G, is a group and is also commutative then G, is referred to as an Abelian group (the name is taken from the 19’th century mathematician N.H. Abel) is commutative means that a,b G, a b = b a Examples: R,+ , Z , and R - 0, are abelian groups. Why is R, not a group at all? If a,b Z a b = a + b if a + b < n = a + b - n if a + b n then Z , is an abelian group and is usually referred to as the group of integers modulo n Two show that an algebraic system is a group we must show that it satisfies all the axioms of a group. Question: Let A,,, be a Boolean algebra so that A is a set of propositional elements, is like ‘or’, is like ‘and’ and is like ‘not’. Show that A, is an abelian group where a,b A a b = a b a b Answer: (1) Associative since a b c = a b c prove this ? (2) Has an identity element 0 (false) since a a 0 = a 0 a 0 a 1 0 a 0 = a (3) Each element is its own inverse a a = a a a a 0 0 0 (4) The operation commutes a b = b a prove this ? Semigroup An Abelian group is a strengthening of the notion of group (i.e. requires more axioms to be satisfied) We might also look at those algebraic structures corresponding to a weakening of the group axioms A, is a semigroup if the following conditions are satisfied: 1. is a closed operation i.e. if a A and b G then a b A 2. is associative Example: The set of positive even integers {2,4,6,.....} under the operation of ordinary addition since • The sum or two even numbers is an even number • + is associative The reals or integers are not semigroups under why? Monoid A, is a monoid if the following conditions are satisfied: 1. is a closed operation i.e. if a A and b G then a b A 2. is associative 3. There is an identity element Examples: Let A be a finite set of heights. Let be a binary operation such that a b is equal to the taller of a and b. Then A, is a monoid where the identity is the shortest person in A true, false , is a monoid: is associative, true is the identity, but false has no inverse true, false , is a monoid: is associative false is the identity, but true has no inverse Properties of Algebraic Structures properties Semigroup monoid group Abelian Group Theorem: (unique identity) Suppose that A, is a monoid then the identity element is unique Proof: Suppose there exist two identity elements e and f. [We shall prove that e=f] e = e f since f is an identity = f since e is an identity Theorem: (unique inverse) Suppose that A, is a monoid and the element x in A has an inverse. Then this inverse is unique. Proof: ?? Properties of Groups Theorem (The cancellation laws): Let G , be a group then a,x, y G (i) a x = a y x = y (ii) x a = y a x = y Proof: (i) Suppose that a x = a y then by axiom 3 -1 a a has an identity and we have that a -1 a x a -1 a y a -1 a x = a -1 a y associativity e x = e y a -1 is the inverse x y identity (ii) is proved similarly Theorem (The division laws): Let a group then a,x, y G (i) a x = b x = a-1 b (ii) x a = b x = b -1 a Proof ?? G , be Theorem (double inverse) :If x is an element of the group G , then x -1 -1 =x Proof: x is inverse of x x x x = e x = x x -1 -1 -1 x = e -1 -1 x -1 -1 -1 -1 x x x associativity x e = x x is inverse of x x = x identity -1 -1 -1 -1 -1 -1 -1 -1 Theorem (reversal rule) If x and y are elements of the group G , then x y1 x -1 y-1 Proof ?? For a an arbitrary element of a group G , we can define functions a : G G and a : G G such that x G a x a x and a x x a Theorem: a : G G and a : G G are permutations of G Proof: Consider a [prove 1-1] suppose for x,y in G a x a y a x = a y x = y (cancellation laws) [Prove onto] For any y in G a a -1 y a a -1 y a a -1 y (associativity) = e y (a -1 is inverse of a) = y (identity) Corollary: In every row or column of the multiplication table of G each element of G appears exactly once. Cosets Consider a set A with a subset H. Let a A . Then the left coset of H with respect to a is the set of elements: a x x H This is denoted by a H Similarly the right coset of H with respect to a is x a x H and is denoted by H a Example: Let A be the set of rotations 0 ,60 ,120 ,180 ,240 ,300 and H 60 ,120 ,240 . Let a = 60 then x a x H 60 ,180 ,300 which is the right coset with respect to 60 Isomorphism • Two groups are isomorphic if there is a bijection of one onto the other which preserves the group operations i.e. if G1 , and G2 , are groups then a bijection f : G1 G2 is an isomorphism provided x, y G1 f x y f x f y Example: Consider the group of matrices 1 t of the form where t R under matrix 0 1 multiplication. This is isomorphic to the group R,+ The mapping is 1 t t 0 1 An isomorphism from a group onto itself is called an automorphism. Homomorphisms The idea of isomorphic algebraic structures can be readily generalised by dropping the requirement that the functional mapping be a bijection. Let A, and B, be two algebraic systems then a homomorphism from A, to B, is a functional mapping f : A B such that x, y A f x y f x f y Example: consider the two structures 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 then f such that f = 1, f = 1,f 1,f 0 f 0,f 1 is a homomorphism between ,, ,,,, and 1,0,1, Subgroups H, is a subgroup of the group G, if H G and H, is also a group Examples: Q - 0, is a subgroup of R - 0, 1,1, i, -i, is a subgroup of C - 0, Test for a subgroup Let H be a subset of G. Then H, is a subgroup of G, iff the following conditions all hold: (1) H (2) H is closed under multiplication -1 x H x H (3) For every group G, , G, and e, are subgroups e, is called the trivial subgroup of G, a proper subgroup of G, is a subgroup different from G A non-trivial proper subgroup is a subgroup equal neither to G, or to e, Normal Subgroups Let H, be a subgroup of G, . Then H, is a normal subgroup if, for any a G , the left coset a H is equal to the right coset H a H, is a normal subgroup where H = , , e.g. H = , , ,, H , , ,, Theorem: In an Abelian group, every subgroup is a normal subgroup Algebraic Structures with two Operations • So far we have studied algebraic systems with one binary operation. We now consider systems with two binary operations. • In such a system a natural way in which two operations can be related is through the property of distributivity; Let A, , be an algebraic system with two binary operations and . Then the operation is said to distribute over the operation if x, y, z A x y z x y x z and y z x = y x z x Example: distributes over + distributes over distributes over Ring An algebraic system A, , is called a ring if the following conditions are satisfied: (1) A, is an Abelian group (2) A, is a semigroup (3) The operation is distributive over the operation Example: Z, +, is a ring since Z, + is an Abelian group Z, is a semigroup distributes over + A commutative ring is a ring in which is commutative A ring with unity contains an element 1 such that x A x 1 = 1 x = x where 1 0 (0 is the identity of A, ) Example: the ring of 2x2 matrices under matrix addition and multiplication is a ring with unity. 1 0 The element 1=I= 0 1 Integral Domains and Fields A, , is an integral domain if it is a commutative ring with unity that also satisfies the following property; x, y A x y = 0 x = 0 or y = 0 Z, +, is also an integral domain A, , is a field if: (1) A, is an Abelian group (2) A - 0, is an Abelian group (3) The operation is distributive over the operation Example:The set of real numbers with respect to + and is a field. Z, +, is not a field. Why? A Field is an Integral Domain Let A, , be a field then certainly A, , is a commutative ring with unity. Hence, it only remains to prove that x, y A x y = 0 x = 0 or y = 0 Now suppose x y = 0 then if x=0 the above holds. Consider the case then where x 0 Since A - 0, is an Abelian group then it -1 x must contain an inverse to x, , for which the following holds y = 1 y = x x y x x y x 0 -1 -1 -1 Now a 0 0 a 0 a 0 a 0 = a 0 (distributivity) a 0 a 0 = a 0 0 0 is identity a 0 = 0 cancellation laws for Therefore y=0 as required Properties Theorem: if A, , is a ring. Then x A 0 x = x 0 = 0 Proof: as for previous argument Let -x denote the inverse of x under Theorem: if A, , is a ring then the following hold (i) -x y = x -y -x y (ii) -x -y x y Proof: (i) x -x y = 0 y (additive inverse) 0 (by above theorem) x y -x y = 0 (distributivity) -x y = -x y 0 (division laws for ) = -x y (additive identity) (ii) -x -y x -y (part(i)) = --x y (part(i)) = x y (double inverse) for both (i) and (ii) the symmetric cases are proved similarly Theorem: suppose that elements a,b and c of an integer domain satisfy a b = a c and a 0 then b=c. Proof: a b -a c a c -a c 0 (additive inverse) Now - a c a -c (prev. theorem) a b c 0 (distributivity) by defn. of integer domain b c 0 since a 0 b = 0 --c (by devision law for ) b = c double inverse Partial Orderings • We have introduced formal structure governing the properties of various sets of elements under one or two binary operations. These elements can also be ordered and restricted by binary relations. • In this section we revise our understanding of binary relations in a set and also introduce a graphical notation for binary relations. A relation R on a set A is a partial order if it satisfies; (1) R is reflexive x A R(x, x) (2) R is antisymmetric x, y A R x, y = Ry, x x = y (3) R is transitive x, y, z A R x, y and R y, z Rx, z The pair (A,R) is called a partially ordered set or poset Example: Set of reals R with the relation Example: The relation can be defined on a Boolean algebra by; x y iff x y = y ( is the logical or) (1) Thus from the idempotent law x x = x we find that x x and hence the relation is reflexive. (2) If x y and y x then x y = y and y x = x From the commutative law x y = y x and hence the relation is antisymmetric (3) If x y and y z then x y = y and y z = z z = x y z x y z (associative law) = x z x z We can think of a relation as being represented by the set of pairs of elements which satisfy the relation. In this case a partial ordering on A corresponds to a subset B of AxA satisfying x A x, x B x, y A x, y B and y, x B x = y x, y, z A x, y B and y, z B x, z B Other examples of partial orderings: Divisibility on N: We say that a divides b iff there is some x in Z such that ax=b. If this divisibility exists we write a|b. Divisibility is a partial order on N. Inclusion on a set of sets X Graphical Representations We can represent partial orderings graphically by means of a directed graph where the nodes are elements of A and the directed edges give the partial order relations. e.g. the graph a b c d Denotes the partial ordering on {a,b,c,d} where a a, b b, c c, d d b a, c a, d a, d b Graphical Representations of the Axioms Reflexive: a Antisymmetric: the following does not occur a b Transitive: a b c Example: Divisibility relation on{2, 3, 4, 6, 8, 9, 18} 2|4 4|8 2|8 2|6 3|6 3|9 9|18 6|18 3|18 2|18 2 4 8 6 3 9 18 Example: The collection of all subsets of {a,b,c} {a,b,c} {a,b} {a,c} {b,c} {a} {b} {c} Hasse Diagrams Notice that some of the diagrams in the previous examples were messy and difficult to read having many links. We can simplify these diagrams by introducing certain conventions. The Hasse diagram of a partially order set is a drawing of the points in the set (as nodes) and some of the links of the graph of the order relation. The rules for drawing the Hasse diagram of a partial order are: (1) Omit all links that can be inferred from transitivity. (2) Omit all loops (3) Draw links without arrow heads (4) Understand that all arrows would point upwards Here are Hasse diagrams for the two examples given previously: Divisibility: 18 8 4 2 6 9 3 Example: subsets {a,b,c} {a,b} {a} {a,c} {b} {b,c} {c} Incomparable Elements Consider the Hasse diagram for divisibility on {2,3,....,10} 10 8 6 4 2 3 9 5 7 Notice that 5 and 6 are not related in either direction Similarly for 2 and 3 If neither R(a,b) or R(b,a) then a and b are incomparable or not comparable Linear or Total Order A linear or total order on a set A is a partial order on A in which every two elements are comparable a,b A either R a, b or Rb,a 5 4 3 2 Maximal and Minimal Elements A maximal element of A is any element t of A such that x A R(t, x) x = t A minimal element of A is any element b of A such that x A R(x, b) x = b Example:For the subset ordering {a,b,c} is the maximal element and is the minimal element For divisibility on {2,.....,10} the maximal elements are 8 and 10 and the minimal elements are 2, 3, 5 and 7 Upper Bounds and Lower Bounds Let S be a subset of A then x in A is an upper bound of S if y S Ry, x Similarly z in A is a lower bound of S if y S Rz, y An element u is the least upper bound of S if u is an upper bound of S and for every x an upper bound of S R(u,x) An element l is the greatest lower bound of S if l is an upper bound of S and for every z a lower bound of S R(z,l) The least upper bound (lub) of S is sometimes referred to as the supremum of S (sup S) The greatest lower bound (glb) of F is sometimes referred to as the infimum of S (inf S) Lattices A partially ordered set in which every pair of elements has a least upper bound and a greatest lower bound is called a lattice. a b c d e f This is not a lattice since {c,d} has no lub or glb. A lattice in which every subset has a lub and glb is called complete. Every finite lattice is complete. For a complete lattice the lub of the whole lattice is call top and the greatest lower bound bottom Example: Consider elements of the form (a,b,c) where a,b and c can take the values 0 or 1. For two such elements f and g we say that f g if each coefficient of f is less then or equal to the corresponding coefficient of g e.g. 001 011 but not 001 010 (111) (011) (001) (101) (110) (010) (000) (100) Meet and Join In a lattice A, the following equations define binary operations on A x y = lub x, y x y = glb x, y is called the meet operation and is called the join operation. They have the following properties Commutitivity: a b = b a Associativity: a b c = a b c Since a b is an upper bound of a and b a ab Similarly for the meet aba Theorem If a b and c d then a c b d a c b d Proof b b d (by definition) d b d (similarly) a b and c d (given) b d is an upper bound of a and c a c is the least upper bound of a and c a c b d Let 1 denote the lub of the whole lattice and 0 denote the glb of the whole lattice. Then x L 0 x 1 x 1 = 1 x 1 = x x 0 = 0 x 0 = x Example Let us order the following set of numbers with the operation “is a factor of”. A={3,9,12,15,36,45} 45 36 9 15 12 3 The join operation is the least common multiple The meet operation is the greatest common divisor Complemented Lattice For a complemented lattice we have that for x L there exists x L such that: x x = 0 and x x = 1 e.g. 1 a b a c b c 0 Distributive Lattice A lattice is distributive if: x y z x y x z x y z x y x z e.g. the following lattice is not distributive e b c d a Since b d c b e = b b d b c a a = a Boolean Algebra A Boolean Algebra consists of two binary operations and and the unary operation on a set B with distinct elements 0 and 1 such that the following hold. (1) The commutative laws: x y = y x x y= y x (2) The associative laws: x y z = x y z x y z = x y z (3) The Distributive laws: x y z x y x z x y z x y x z (4) The Identity Laws: x 0 = x x 1 = x (5) The Complementation Laws: x x =1 xx=0 Theorem If L, is a complemented distributive lattice then L, ,, is a Boolean algebra where , and correspond to the meet, join and complement operations on L respectively Proof ? (6) The following Idempotent Laws can be derived: x x = x x x= x Proof x x = x x 1 identity law (4) x x x x (complementation law (5)) x x x (distributive law (3)) = x 0 (complementation law (5)) =x (7) The following Identity Laws can also be derived x 1 = 1,x 0 = 0 Proof x 1 = x x x (complementation law (5)) = x x x (associative law (2) ) = x x (idempotent law (6)) = 1 (complementation law (5))