Question 1 Let A be the set of letters in your name e.g. in my case it is {b,d,e,i,g, o,l, r,n,z}. A = {a, d, e, g, h, i, n, s} (i) How many 100-letter "words" (i.e. sequences) in this alphabet are there where no two consonants can be adjacent? (ii) How many 100-letter "words" (i.e. sequences) in this alphabet are there where no two vowels can be adjacent? (iii) How many 100-letter "words" (i.e. sequences) in this alphabet are there where no two vowels can be adjacent and no consonants can be adjacent? (iv): Let a(n) be the number of n-letters of words in that alphabet that have neither adjacent vowels nor adjacent consonants, and let f(t)=Sum(a(n)*t^n,n=0..infinity) Find f(t) explicilty. Answer: A = {a, d, e, g, h, i, n, s} Let us use numbers to denote the nodes G:={1, 2, 3, 4, 5, 6, 7, 8} 1. We first create a graph of possible connections G := [{1, 2, 3, 4, 5, 6, 7, 8}, {1, 3, 6}, {1, 2, 3, 4, 5, 6, 7, 8}, {1, 3, 6}, {1, 3, 6}, {1, 2, 3, 4, 5, 6, 7, 8}, {1, 3, 6}, {1, 3, 6}] Then we use the NuPaths command to find the number add(add(NuPaths(G, i, j, 100), i=1..8),j=1..8) 12321340393698231163342176217144212209486354822155180752687005498958907412883 ii) We do a similar thing as we did for i. We first create a graph of possible connections G := [{2, 4, 5, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}, {2, 4, 5, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}, {2, 4, 5, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}] add(add(NuPaths(G, i, j, 100), i=1..8),j=1..8) 119524344066206672461536089579447816929356634429481420767160670948214828968048095703125 iii) G := [{2, 4, 5, 7, 8}, {1, 3, 6}, {2, 4, 5, 7, 8}, {1, 3, 6}, 1, 3, 6}, {2, 4, 5, 7, 8}, {1, 3, 6}, {1, 3, 6}] add(add(NuPaths(G, i, j, 100), i=1..8),j=1..8) 510097200171239669522726245531885069794952869415283203125000 Question 2 A farmer, a wolf, a sheep, and a (very big) cabbage have to cross a river using a row boat that can only have the farmer and one of the other animals/vegetable. The wolf and the sheep can't be left unsupervised, and neither can the sheep and the cabbage (but the wolf and the cabbage can be left safely alone). How can this be done? Answer 2: So we first start by enumerating the states We start with an empty right side and that will be our starting state. We know ennumerate all possible states Let W mean wolf, G mean Goat and C mean cabbage A:=[0, W, WC, WGC, G, WG, GC, C] Now we make a graph of possible states G:=[{G}, {WC, WG}, {WGC, C}, {WC}, {WG, GC}, {G, W}, {G, C}, {WC, GC}] A:=[0, W, WC, WGC, G3, WG, GC, C] A := [0, W, WC, WGC, G, WG, GC, C] A1:=[1, 2, 3, 4, 5, 6, 7, 8] A1 := [1, 2, 3, 4, 5, 6, 7, 8] G2:=[{1, 5}, {3, 6}, {4, 8}, {3}, {6, 7}, {5, 2}, {8, 5}, {3, 7}] G2 := [{1, 5}, {3, 6}, {4, 8}, {3}, {6, 7}, {2, 5}, {5, 8}, {3, 7} ] Paths(G2, 1, 4, 5) {[1, 5, 6, 2, 3, 4], [1, 5, 7, 8, 3, 4]} Matching up the paths with A - A:=[0, W, WC, WGC, G, WG, GC, C] 0 -> G -> WG -> W -> WC -> WGC Or O -> G -> GC -> C -> WC -> WGC