#OK to post homework #Tianyi Liu, Oct 25, Assignment 13 1. A={t,n,y,l,u,a,i} (i)14241559172178076907244742309864685716538724001320296751801726664701 (ii)11455104864158963058415040968357154256427201297864137228613052764297821644 (iii)6370306705001504841329309692739796427449006822279610368 (iv)f(t)=-(24*t+7)/(12*t^2-1) 2. Let S represent Sheep, W represent Wolf and C represent Cabbage, SW represent the state where Sheep and Wolf are left. Then we can define a set of states of the other side. So we have the set of 0,S,W,C,SC,WC,SW,SWC. We define a undirected graph where 0...SWC are 1...8. G:=[{2},{5,7},{6,7},{5,6},{2,4},{3,4,8},{2,3},{}] seq(NuPaths(G,1,8,k),k=1..6) 0, 0, 0, 0, 2, 0 There are 2 ways to do it. 4. Let A be a set of all allowed state of the other side:0,2C,3CC,4CCC,5CM,6MMM,7CMMM,8CCMM,9CCMMM,10CCCMMM. We define a graph using numbers to represent each vertex: 0...CCCMMM as 1...10. There are two sets of vertices in the graph. The first set of edges means incoming changes and the second set means outgoing changes. G:=[{13,15},{14,15},{14,18},{},{17,18},{17,19},{19,20},{19,20},{20},{}, {},{},{2},{2,3},{2},{},{5,6},{3,5},{6,7,8},{}] seq(NuPaths(G,1,20,k),k=1..12) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 Paths(G,1,20,11) {[1, 13, 2, 14, 3, 18, 5, 17, 6, 19, 7, 20], [1, 13, 2, 14, 3, 18, 5, 17, 6, 19, 8, 20], [1, 15, 2, 14, 3, 18, 5, 17, 6, 19, 7, 20], [1, 15, 2, 14, 3, 18, 5, 17, 6, 19, 8, 20]}