• No se han encontrado resultados

Huellas en el camino: empresas, Estado y vida cotidiana

A directed graph (digraph)is an ordered pair of the formD =< A, R >where Ais a set andRis a binary relation onA. RA×A.Elements ofAare thenodesorverticesof the graph. Elements ofRare the edges

orarcsorlinesof the graph. We will assume thatAis finite. If< x, y >R,then we writex R y.This will mean that there is an arrow fromxtoy in the graph.

Example: A={a, b, c}. R={< a, b >, < b, c >, < c, c >}. G:< A, R >is a graph. To represent a graph in a computer:

1. Incidence matrix

a b c

a 0 1 0

b 0 0 1

c 0 0 1

This representation takes alot of space. 2. Adjacency list

An edge orginates at a and terminates at b. A= {a, b, c}. D =< A, R > . R A×A. R= {< a, b >, < a, c >, < b, a >, < b, c >, < c, c >}. LetD =< A, R > be a directed graph witha, bA. An undirected path

P fromatob is a finite sequence of verticies such thatP=< c0, c1, c2, ..., cn>such that 3 things are true:

1. c0=a.

2. cn=b.

3. Either ci R ci+1 orci+1 R ci,∀0≤i≤n.The latter is not in directed graphs. The path from b to c

for undirected graphs is < b, c >, < b, a, c >, < b, a, b, c, c > .The path from ctob is undirected.

IfP is a directed path fromatob then:

1. Vertexais the initial vertex. Vertex bis the terminal vertex.

2. The length of the path isnedges.

3. If all the verticies ofP are distinct except possiblyc0andcn,thenP is asimple orcordless path.

4. Ifc0=cn,thenP is a cycle.

DigraphD=< A, R >is strongly connected if for all verticies,a, bA,there is a directed path from ato

b and fromb toa. D isconnected ifa, bAthere is an undirected path from ato b. Dis disconnected if there exist verticies a, bAsuch that there is no undirected path between aandb.

Example: See Figure 1.15.

D iscomplete overA ifR=A×A.See Figure 1.16. LetRbe a binary relation on setA. R⊂A×A.Then,

42 CHAPTER 1. DISCRETE STRUCTURES

Figure 1.15: Diagram of a disconnected, strongly connected, and connected graphs.

Figure 1.16: Diagram of a complete graph.

Figure 1.17: Diagram A for problem 2 on page 130 in the textbook.

Figure 1.19: Diagram of the solution to homework question 3a on page 130 in the textbook.

Figure 1.20: Diagram of the solution to homework question 3b on page 130 in the textbook.

2. Risirreflexiveifx R/ x xA.No loops.

3. Rissymmetricifx R yy R xx, yA.2 edges.

4. Risantisymmetricif (x R yy R x)(x=y)x, yA.No double edges. 5. Ristransitiveif (x R yy R z)x R zx, y, zA.

Do problems on page 130, #1, 2a, b, c, 3, 4, 5, 6.

1.3.2

Homework and Answers

Problems on page 130 in the textbook. #1, 2a, b, c, 3, 4, 5, 6.

1. Let A = {0,1,2,3,4}. For each of the predicates given below, specify the set of n-tuples in the n- ary relation over A which corresponds to the predicate. For parts (d) - (f), draw the diagram which represents the relation.

a. P(x)⇔x≤1.Solution:R={<0>, <1>}.

b. P(x)3>2.Solution: {<0>, <1>, <2>, <3>, <4>}.

c. P(x)⇔2>3.Solution: Always false ∅.

e. P(x, y)⇔ ∃k[x=ky∧k <2].Solution: K= 0,1. R={<0,0>, <0,2>, <0,3>, <0,4>, <1,1> , <2,2>, <3,3>, <4,4>}.

2. For the following digraphs AandB in Figures 1.17 and 1.18.

a. Find all simple paths from nodeato nodec.Give the path lengths. Solution: GraphA. < a, b, d, c > . n= 3.GraphB {< a, c >},{< a, b >, < b, c >}.

44 CHAPTER 1. DISCRETE STRUCTURES

b. Find the indegree and outdegree of each node. Solution: GraphA.Indegreea1, b1,andc 1.Outdegree

a1, b1,andc1.GraphB.Indegreea3, b3, andc 3.Outdegreea3, b 3,andc 3.

c. Find all simple cycles with initial and terminal node a. Solution: Graph A : < a, bd, c, a >, < a > .

GraphB:{< a, b, c, a >} {< a, c, b, a >}.

3. For each of the following, sketch a digraph of the given binary relation onA.State whether the digraph is disconnected, connected, or strongly connected and state how many components the digraph has. a. [<1,2>, <1,3>, <2,4>] whereA={1,2,3,4}.Solution: Connected. See Figure 1.19.

b. [<1,2>, <3,1>, <3,3>] whereA={1,2,3,4}.Solution: Disconnected. See Figure 1.20. c. [< x, y >|0≤x < y≤3] whereA={0,1,2,3,4}.Solution: Disconnected.

e. [< x, y >|0xy <3] where A={0,1,2,3,4}.Solution: R={<0,0>, <1,0>, <1,1>, <2,0> , <2,1>, <2,3>, <3,1>, <3,2>, <3,3>, <4,2>, <4,3>, <4,4>}.

4. Construct the incidence matrix for the following binary relation on [0,1,2,3,4,5,6] : {< x, y >|x < yxis prime}.Solution: Connected.

1 2 3 4 5 6 7 8 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 4 0 0 0 0 0 1 1 5 1 1 1 1 1 1 1 4 0 0 0 0 0 0 0

5. For each of the following, give an inductive definition for the relation RonN. In each case, use your definition to showxR.

a. R={< a, b >|a b};x=< 3,1> . Solution: Basis: 00 or<0,0>Ror 0R0. Induction: if

x≥y,thenx+ 1≥y andx+ 1≥y+ 1.For example, prove that 5≥3.

0≥0 basis 1≥0 2≥0 3≥1 42 53.

b. R={< a, b >|a= 2b};x=<6,3> .Solution: Basis: <0,0>∈R.Induction: if< x, y >∈R,then

< x+ 2, y+ 1>∈R.

c. R = {< a, b, c > |a+b = c};x =< 1,1,2 > . Solution: Basis: < 0,0,0 > R. Induction: If

< x, y, z >Rthen< x+ 1, y, z+ 1>R.If< x, y, z >Rthen< x, y+ 1, z+ 1>R.Show that

<2,3,5>R. <0,0,0>R <1,0,1>R <2,0,2>R <2,1,3>R <2,2,4>R <2,3,5>R. 6. LetA={1,2,3}.

a. List the unary relation onA.Solution: IfRis a unary relation onA,thenR⊂A. R=∅. R={<1> , <2>, <3>}. R={<1>},{<2>},{<3>},{<1,2>},{<1,3>},{<2,3>}.

b. How many binary relations are there on A? Solution: RA×A is a binary relation. A×A has 9 elements. ∴29subsets = 512.

1.3.3

Homework and Answers

Figure 1.21: Diagram to homework question 1a on page 147 in the textbook.

Figure 1.22: Diagram to homework question 1b on page 147 in the textbook.

Page 147 and 148 in the textbook.

1. List the properties defined in Definition 3.3.1 which hold for the relations represented by the following graphs.

a. See Figure 1.21. Solution: Not reflexive. Not irreflexive. Not symmetric. Antisymmetric. Transitive. b. See Figure 1.22. Solution: Relfexive. Not irreflexive. Symmetric. Not antisymmetric. Transitive. 3. Consider the set of integers I. Fill in the following table with Yes and No according to whether the

relation possesses the property. The notationdenotes the empty set, I×I is the universal relation, andD denotes ”divides with an integer quotient” (e.g. 4D8 but 4D/7). Solution: D:R={< x, y >|x

divides y}.For example,<4,8>R.

I×I D

Reflective Reflexive Not reflexive Not Irreflective Not Irreflective Not Irreflective Symmetric Not symmetric No Not antisymmetric Antisymmetric No Transitive Transitive Yes