{VERSION 6 1 "Windows XP" "6.1" } {USTYLETAB {PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Dash Item" -1 16 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 -1 3 3 1 0 1 0 2 2 -1 3 }{PSTYLE "Heading 4" -1 20 1 {CSTYLE "" -1 -1 "MS Serif" 1 12 0 0 0 0 1 0 0 2 2 2 0 0 0 1 }1 1 0 -1 0 0 1 0 1 0 2 2 -1 1 }{PSTYLE "Heading 3" -1 5 1 {CSTYLE "" -1 -1 " MS Serif" 1 14 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }1 1 0 -1 0 0 1 0 1 0 2 2 -1 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "A uthor" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 1 0 -1 8 8 1 0 1 0 2 2 -1 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "MS Serif" 1 16 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 1 0 -1 8 2 1 0 1 0 2 2 -1 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "MS Serif" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 1 0 -1 8 4 1 0 1 0 2 2 -1 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Maple Plot" -1 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Line Printed Output" -1 6 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 0 0 1 1 2 2 2 0 0 0 1 }3 1 0 -1 12 12 1 0 1 0 2 2 -1 1 }{PSTYLE "Map le Output" -1 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 -1 3 3 1 0 1 0 2 2 -1 5 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Ti mes" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 -1 3 3 1 0 1 0 2 2 -1 2 } {CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "2D Input" -1 19 "Times" 1 12 255 0 0 1 0 0 0 2 1 2 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "MS Serif" 1 12 0 128 128 1 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "Text" -1 200 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 1 12 0 0 0 1 0 0 0 2 2 2 0 0 0 1 } {CSTYLE "Dictionary Hyperlink" -1 45 "MS Serif" 1 12 147 0 15 1 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "Maple Input Placeholder" -1 201 "Courier" 1 12 200 0 200 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "2D Output" -1 20 "Times" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }{CSTYLE "Page Number" -1 33 "Times " 1 10 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{PSTYLE "_pstyle1" -1 200 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle1" -1 202 "Times" 1 16 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle2" -1 203 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{PSTYLE "_pstyle2" -1 201 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 } {CSTYLE "_cstyle3" -1 204 "Times" 1 14 0 0 0 1 2 1 1 2 2 2 0 0 0 1 } {CSTYLE "_cstyle4" -1 205 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 } {PSTYLE "_pstyle3" -1 202 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 0 1 0 1 0 2 1 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle5" -1 206 "Courier" 1 12 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{PSTYLE "_pstyle4 " -1 203 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }3 3 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{CSTYLE "_cstyle6" -1 207 "Times" 1 12 0 0 255 1 0 0 0 2 2 2 0 0 0 1 }{PSTYLE "_pstyle5" -1 204 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{CSTYLE "_cstyle7" -1 208 "Courier" 1 12 255 0 255 1 0 0 0 2 2 2 0 0 0 1 }{PSTYLE "_pstyle6" -1 205 1 {CSTYLE " " -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{CSTYLE "_cstyle8" -1 209 "Times" 1 14 0 0 0 1 2 1 1 2 2 2 0 0 0 1 }{CSTYLE "_cstyle9" -1 210 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle10" -1 211 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle11" -1 212 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle12" -1 213 "Times" 0 1 0 0 0 0 1 0 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle13" -1 214 "Times" 0 1 0 0 0 0 2 0 0 2 2 2 0 0 0 1 }} {SECT 0 {EXCHG {PARA 200 "" 0 "" {TEXT 202 30 "Math 365D Lab Four - Fa ll 2005" }{TEXT 203 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 204 4 "SETS " }{TEXT 203 0 "" }{TEXT 203 34 "\nAs you remember from Math s21, a " }{TEXT 205 3 "set" }{TEXT 203 108 " is an unordered collection of dist inct objects. Thus, the sets \{a,b\}, \{b,a\}, and \{b,a,a,a\} are all equal. " }{TEXT 203 0 "" }{TEXT 203 139 "\nMaple has many commands f or manipulating sets, some of which are shown below. Note that we use \+ braces \{\} to enclose the elements of a set." }{TEXT 203 0 "" }} {PARA 201 "" 0 "" {TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 24 "A:=\{2,3,5,11\}; B:=\{3,7\};" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"AG6\"<&\"\"#\"\"$\"\"&\"#6" }{TEXT 207 0 "" }} {PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"BG6\"<$\"\"$\"\"(" }{TEXT 207 0 " " }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 79 "A:=A union \{7\}; # we need the \{\} around the 7 to make the second argument a set" } {MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"AG6\"<'\"\" #\"\"$\"\"&\"\"(\"#6" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 18 "C:=A intersect B; " }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"CG6\"<$\"\"$\"\"(" }{TEXT 207 0 "" }}} {EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 13 "E:=A minus B;" } {MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"EG6\"<%\"\" #\"\"&\"#6" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 69 "member(11,E); # tests if the first argument is a member of the second" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#I%tru eGI*protectedGF$" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 82 "A[3]; # though Maple claims sets are unordered, it \+ lets us ask for the nth element" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"&" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 49 "S:=\{\}; # this is how we initialize a set as em pty" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"SG6\" <\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 109 "When w e want to use a loop to do something for each element in a set, the fo llowing alternate version of the " }{TEXT 205 9 "for...do " }{TEXT 203 123 "syntax can be very convenient as it eliminates the need to co unt the number of elements in the set (as we had to do in the " } {TEXT 205 13 "twoneighbors " }{TEXT 203 24 "procedure from Lab Two)." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 13 "for x in A do " }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 18 "\n print(x);" } {MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 8 "\nend do;" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"#" }{TEXT 207 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"$" }{TEXT 207 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"&" }{TEXT 207 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"(" }{TEXT 207 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"#6" } {TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 204 5 "LISTS" }{TEXT 203 0 "" }{TEXT 203 17 "\nUnlike a set, a " }{TEXT 205 4 "list" } {TEXT 203 274 " is an ordered sequence of objects which do not need to be distinct. Thus, the lists [a,b], [b,a], and [b,a,a,a] are all diff erent from one another. Lists are enclosed in brackets []. Lists are n ot sets, so the notions of union, intersection and the like are not ap plicable." }{TEXT 203 0 "" }{TEXT 203 1 "\n" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 15 "L:=[5,3,a,5,C]:" }{MPLTEXT 1 206 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 47 "L[2]; # displays the 2nd elemen t from the start" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"$" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 46 "L[-2]; # displays the 2nd element from the end" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"&" }{TEXT 207 0 "" }}} {EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 64 "L[5]; # an element of a \+ list may be a set, a list, or any object" }{MPLTEXT 1 206 0 "" }} {PARA 203 "" 1 "" {XPPMATH 20 "6#<$\"\"$\"\"(" }{TEXT 207 0 "" }}} {EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 59 "L[5][1]; # displays the \+ 1st element of the 5th element of L" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"$" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 83 "convert(L, 'set'); # it's sometimes useful to convert one data structure to another" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#<&\"\"$\"\"&<$F$\"\"(I\"aG6\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 60 "M:=[seq(0, i=1.. 20)]; # this is one way to initialize a list" }{MPLTEXT 1 206 0 "" }} {PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"MG6\"76\"\"!F'F'F'F'F'F'F'F'F'F'F 'F'F'F'F'F'F'F'F'" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 204 6 "ARRAYS" }{TEXT 203 0 "" }{TEXT 203 98 "\nSo far, the data struc tures we have seen (stacks, sets, lists) have all been one-dimensional . An " }{TEXT 205 5 "array" }{TEXT 203 24 " is a special form of a " } {TEXT 205 6 "table " }{TEXT 203 255 "(a structure that contains rows a nd columns - see Help for details on tables if you're interested). Lik e a list, an array is ordered and allows for repeated elements. (Of co urse, an array may contain just one row, in which case it looks much l ike a list.)" }{TEXT 203 0 "" }{TEXT 203 1 "\n" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 64 "a:=array([[2,3,5,7],[b,c,d,e]]): # creates and fill s a 2x4 array" }{MPLTEXT 1 206 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 29 "eval(a); # displays our array" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#-I'matrixG6\"6#7$7&\"\"#\"\"$\"\"& \"\"(7&I\"bGF%I\"cGF%I\"dGF%I\"eGF%" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 60 "a[2,3]:=george: eval(a); # assign a n ew value to one element" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#-I'matrixG6\"6#7$7&\"\"#\"\"$\"\"&\"\"(7&I\"bGF%I\"cGF% I'georgeGF%I\"eGF%" }{TEXT 207 0 "" }}}{EXCHG {PARA 204 "" 1 "" {TEXT 208 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 10 "Using the " }{TEXT 205 3 "op " }{TEXT 203 233 "command, we can determine various attribut es of a data structure. Below, we show how to find the number of rows \+ and columns as this will be useful to us in the future. For informatio n on returning other attributes, see the Help menu." }{TEXT 203 0 "" } }}{EXCHG {PARA 201 "" 0 "" {TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 81 "op(2,eval(a)); # the 2 indicates we want the bounds (0 would give the type, etc.)" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6$;\"\"\"\"\"#;F$\"\"%" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 58 "op(2,eval(a))[1]; # this gives \+ just the bounds on the rows" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#;\"\"\"\"\"#" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 67 "op(2,op(2,eval(a))[1]); # and this finally giv es the number of rows" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"#" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 50 "b:=array(1..4, 1..2): # creates an empty 4x2 array" }{MPLTEXT 1 206 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 9 " eval(b); " }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#-I' matrixG6\"6#7&7$&I\"?GF%6$\"\"\"F,&F*6$F,\"\"#7$&F*6$F/F,&F*6$F/F/7$&F *6$\"\"$F,&F*6$F8F/7$&F*6$\"\"%F,&F*6$F>F/" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 204 26 "NETWORKS PACKAGE, PART TWO" }{TEXT 203 0 "" }{TEXT 203 100 "\nNow that we know the difference between set s and lists, we can add some new features to our graphs." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 15 "with(networks):" } {MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 81 "\nG:=graph( \{a,b,c\}, \{ \{a, b\}, [b,c] \} ): # the second edge is DIRECTED from b to c" }{MPLTEXT 1 206 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 50 "head(e2, G ); # returns the head of a directed edge" }{MPLTEXT 1 206 0 "" }} {PARA 203 "" 1 "" {XPPMATH 20 "6#I\"cG6\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 51 "tail(e2, G); # returns the tail of a directed edge " }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#I\"bG6\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 74 "H:=graph( \{a,b,c\}, \{ \{a,b\}, \{b,c\} \} , weig hts=[5,7] ): # weights the edges" }{MPLTEXT 1 206 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 48 "eweight(e1, H); # returns the w eight of an edge " }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"&" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 47 "It's also possible to weight the vertices; see " }{TEXT 205 8 "vweigh t " }{TEXT 203 39 "in the Help menu if you are interested." }{TEXT 203 0 "" }}}{PARA 205 "" 0 "" {TEXT 209 0 "" }{TEXT 209 10 "\nEXERCISE S" }{TEXT 210 0 "" }{TEXT 210 131 "\n1. Write a procedure that takes t hree sets as its arguments and returns a set that contains the element s common to all three sets." }{TEXT 210 0 "" }{TEXT 210 157 "\n2. Writ e a procedure which takes two sets as its arguments and then indicates whether the first set is a subset of the second. Do this using a loop and the " }{TEXT 211 7 "member " }{TEXT 210 37 "command rather than b y using Maple's " }{TEXT 211 7 "subset " }{TEXT 210 8 "command." } {TEXT 212 0 "" }{TEXT 212 168 "\n3. Write a procedure that takes a gra ph and two vertices as its arguments and returns a set containing only the vertices that are neighbors of both the given vertices." }{TEXT 212 0 "" }{TEXT 212 52 "\n4. Write a procedure that takes a positive i nteger " }{TEXT 213 1 "n" }{TEXT 214 1 " " }{TEXT 212 48 "as its argum ent and returns a list of the first " }{TEXT 213 1 "n" }{TEXT 214 27 " primes in ascending order." }{TEXT 212 0 "" }{TEXT 212 81 "\n5. Write a procedure that takes a graph as its argument and returns a list, th e " }{TEXT 213 1 "i" }{TEXT 214 51 "th element of which is the set of \+ neighbors of the " }{TEXT 213 1 "i" }{TEXT 214 23 "th vertex of the gr aph." }{TEXT 212 0 "" }{TEXT 212 269 "\n6. Write a procedure that take s a graph as its argument and returns an array, the first row of which contains the vertices of the graph. Under each of these vertices shou ld be displayed all of its neighbors, but not as sets. For example, if the first vertex is called " }{TEXT 213 1 "b" }{TEXT 214 23 " and its neighbors are " }{TEXT 213 1 "c" }{TEXT 214 5 " and " }{TEXT 213 1 "m " }{TEXT 214 49 ", then the first column of the array should have " } {TEXT 213 1 "b" }{TEXT 214 19 " in the first row, " }{TEXT 213 1 "c" } {TEXT 214 20 " in the second, and " }{TEXT 213 1 "m" }{TEXT 214 14 " i n the third." }{TEXT 212 1 " " }{TEXT 212 0 "" }{TEXT 212 143 "\n7. Wr ite a procedure that takes a graph as its argument and returns a set c ontaining all the vertices that are the heads of at least one edge." } {TEXT 212 0 "" }{TEXT 212 109 "\n8. Write a procedure that takes a gra ph with weighted edges as its argument and displays the minimum weight ." }{TEXT 212 0 "" }{TEXT 212 104 "\n9. Modify your previous procedure so that it also displays the set of edges having that minimum weight. " }{TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 328 "10. Write a proce dure that takes two one-dimensional arrays as its arguments and, treat ing them as vectors, returns their dot product. Do this with a loop ra ther than any built-in Maple function. See the notes on arrays above f or information on determining the length of the vectors. We will use t his procedure again in Lab Six." }{TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT -1 0 "" }}}{MARK "0 0 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }