34
Discrete Discrete Mathematics II Mathematics II

Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Embed Size (px)

Citation preview

Page 1: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Discrete Mathematics IIDiscrete Mathematics II

Page 2: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

ContentsContents

• 1 Introduction

• 2 Combinatorics, permutations and combinations.

• 3 Algebraic Structures and matrices: Homomorphism, commutative diagrams, isomorphism, semigroup, monoid, rings and fields

• 4 Vector Spaces

• 5 Lattice and Boolean algebras

Page 3: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

IntroductionIntroduction• 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

Page 4: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Number SystemsNumber 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,......}

Page 5: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

2 Combinatorics: Permutations2 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}

a1

nchoices

n-1choices

1choice

a2 an

total number of ways of filling the n boxesn 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

Page 6: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Composition of PermutationsComposition 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 6

3 2 6 1 4 5

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

Page 7: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Cyclic PermutationsCyclic PermutationsA cyclic permutation on a set A of n elements has the form where :

a1 a2 ak-1 ak ak +1 an

a2 a3 a k a1 ak +1 an

k n

For shorthand we often write a1 a2 ak

Example

6 1 4 2 3 5

1 4 6 2 3 5

or (6 1 4) is a cyclic permutation

Two cyclic permutations a1 a2 ak and b1 b2 b t are said to be disjoint if

a1, ,ak b1 ,, bt

e.g. (4 5 2) and (3 1 6) are disjoint

is said to be a k cycle

Page 8: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Notice that

1 2 3 4 5 6

5 6 3 1 4 2

1 5 4 2 ,6 3

Other examples are

1 2 3 4 5

4 2 5 3 1

1 2 3 4 5

4 2 5 3 1

3 5 1 4 2

or

1 2 3 4 5 6

2 3 1 5 4 6

1 2 3 4 5 6

Can you spot a product of disjoint cyclic permutations equivalent to the following permutation ?

1 2 3 4 5 6 7

1 7 4 6 2 3 5

Page 9: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

• 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

I =

a1 a2 an

a1 a2 an

is called the identity permutation and has theproperty that I. = .I =

(4) For every permutation

=

a1 a2 an

b1 b2 bn

1 =

b1 b2 bn

a1 a2 an

there is an inverse

such that

. 1 1 . I

Page 10: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

CombinationsCombinations• 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

n n-1 n-k-2 n-k-1no. of choices

places

= n(n-1)(n-2) ........... (n-k-1) = n!/(n-k)!

For each possible list there are k! permutationsso since we are not interested in order we should divide the above by k!.

C(n,k) = Cnk = n!/(n-k)!k!

Page 11: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

• 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

Page 12: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Algebraic StructuresAlgebraic 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 will 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

Page 13: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

GroupsGroupsA 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 bG

2. a,b,c G a b c a b c this is theassociative 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 Aonto 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) ).

Page 14: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

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 algebraso that A is a set of propositional elements, islike ‘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 ab c = a b c

prove this ?

(2) Has an identity element 0 (false) sincea a0 = a 0 a 0 a 1 0

a 0 = a

(3) Each element is its own inverseaa = a a a a 0 0 0

(4) The operation commutes a b = b aprove this ?

Page 15: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Group of Symmetries of a Group of Symmetries of a TriangleTriangle

Consider the triangle

X

Y Z

O

l

nm

We can perform the following transformationson the triangle1=identity mapping from the plane to itselfp=rotation anticlockwise about O through 120 degreesq=rotation clockwise about O through 120 degreesa=reflection in lb=reflection in mc=reflection in n

Page 16: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

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

m Y n

O

X

Z

l

m n

O

l

m n

O

X

YZ X Z

Ya p

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 a b p q 1

Notice the table is not symmetric

Page 17: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Abelian GroupsAbelian GroupsIf 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

Page 18: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

SemigroupSemigroup

An Abelian group is a strengthening of the notion ofgroup (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 conditionsare satisfied:

1. is a closed operation i.e. if a A and

b G thena bA

2. is associative

Example: The set of positive even integers {2,4,6,.....} under the operation of ordinary additionsince• The sum or two even numbers is an even number• + is associative

The reals or integers are not semigroups under -why?

Page 19: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

MonoidMonoidA, is a monoid if the following conditionsare satisfied:

1. is a closed operation i.e. if a A and b G thena bA

2. is associative3. There is an identity element

Examples: Let A be a finite set of heights. Let

be a binary operation such that a bis 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

Page 20: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Properties of Algebraic Properties of Algebraic StructuresStructures

Semigroup monoid group Abelian Groupproperties

Theorem: (unique identity) Suppose that A,is a monoid then the identity element is unique

Proof: Suppose there exist two identity elementse 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: ??

Page 21: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Properties of GroupsProperties of GroupsTheorem (The cancellation laws): Let G , bea 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

a has an identity a-1

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 G , bea group then a,x,y G

(i) a x = b x = a -1 b

(ii) x a = b x = b -1 a

Proof ??

Page 22: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Theorem (double inverse) :If x is an element ofthe group thenG ,

x -1 -1 = x

Proof:

x -1 -1 x-1 = e x-1 -1 is inverse of x -1 x-1 -1 x-1 x = e x = x

x-1 -1 x-1 x x associativity

x-1 -1 e = x x -1 is inverse of x x-1 -1 = x identity

Theorem (reversal rule) If x and y are elements of the group thenG ,

x y 1 y-1 x -1

Proof ??

Page 23: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

For a an arbitrary element of a group G , we

can define functionsa : G G and a : G G

such thatxG 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 appearsexactly once.

Page 24: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

CosetsCosetsConsider a set A with a subset H. Let a A .Then the left coset of H with respect to a isthe 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

Page 25: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

IsomorphismIsomorphism

• 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 bijectionf : G1 G2 is an isomorphism provided

x,y G1 f x y f x f y

Example: Consider the group of matricesof the form where under matrix

1 t

0 1

t R

multiplication. This is isomorphic to the group

The mapping is

R,+1 t

0 1

t

An isomorphism from a group onto itself iscalled an automorphism.

Page 26: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

HomomorphismsHomomorphisms 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 systemsthen a homomorphism from A, to B,

is a functional mapping f : A Bsuch that

x,y A f x y f x f y Example: consider the two structures

1 0 1

1 1 1 0

0 1 0 1

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 ,

Page 27: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

SubgroupsSubgroupsH, 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 subgroupLet H be a subset of G. Then H, is a subgroupof G, iff the following conditions all hold:

(1) H

(2) H is closed under multiplication

(3) x H x -1 H

For every group G, , G, and e , aresubgroups

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 subgroupequal neither to or to G, e ,

Page 28: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Normal SubgroupsNormal 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 subgroupis a normal subgroup

Page 29: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Algebraic Structures with two Algebraic Structures with two OperationsOperations

• 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 twobinary operations and . Then the operation is said to distribute over the operation ifx,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

Page 30: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

RingRingAn 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 sinceZ, + is an Abelian group

Z, is a semigroup distributes over +

A commutative ring is a ring in which iscommutative

A ring with unity contains an element 1 suchthatxA x 1 = 1 x = x where 10

Example: the ring of 2x2 matrices under matrixaddition and multiplication is a ring with unity.The element 1=I=

1 0

0 1

(0 is the identity of )A,

Page 31: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

Integral Domains and FieldsIntegral Domains and FieldsA,, is an integral domain if it is a commutativering with unity that also satisfies the followingproperty;

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?

Page 32: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

A Field is an Integral Domain A Field is an Integral Domain Let A,, be a field then certainly A,,

is a commutative ring with unity. Hence, it onlyremains 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

must contain an inverse to x, x-1

, for which the

following holds

y = 1 y = x -1 x yx -1 x y x -1 0

Nowa 0 0 a 0

a 0a 0 = a 0 (distributivity)

a 0a 0 = a 0 0 0 is identity a 0 = 0 cancellation laws for

Therefore y=0 as required

Page 33: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

PropertiesProperties

Theorem: if A,, is a ring. ThenxA 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)

Page 34: Discrete Mathematics II. Contents 1 Introduction 2 Combinatorics, permutations and combinations. 3 Algebraic Structures and matrices: Homomorphism, commutative

(ii) -x -y x -y (part(i))

= - - x y (part(i))

= x y (double inverse)

for both (i) and (ii) the symmetric cases areproved similarly

Theorem: suppose that elements a,b and c ofan integer domain satisfy anda b = a c 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)

b c 0 by defn. of integer domain

since a 0

b = 0 - -c (by devision law for )

b = c double inverse