#Please do not post homework #Ravali Bommanaboina, 10/25/20, Assignment 13 #Question 1 #{1,2,3,4,5,6,7,8,9} #A:={r,v,l,b,m,n,a,i,o} # The list A above shows the letters in my full name with a number assigned to it. For example r=1 v=2 and so on. #L:=[{7,8,9},{7,8,9},{7,8,9},{7,8,9},{7,8,9},{7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9}] #The graph L represented above represents all the neighbors of each letter in A where no two consonants can be neighbors. #To compute the total number of paths I used the function NuPaths and computed all possible paths starting and ending at any two letters using L. #B := 3*(NuPaths(L, 9, 1, 100) + NuPaths(L, 9, 2, 100) + NuPaths(L, 9, 3, 100) + NuPaths(L, 9, 4, 100) + NuPaths(L, 9, 5, 100) + NuPaths(L, 9, 6, 100) + NuPaths(L, 9, 7, 100) + NuPaths(L, 9, 8, 100) + NuPaths(L, 9, 9, 100)) #C := 6*(NuPaths(L, 2, 1, 100) + NuPaths(L, 2, 2, 100) + NuPaths(L, 2, 3, 100) + NuPaths(L, 2, 4, 100) + NuPaths(L, 2, 5, 100) + NuPaths(L, 2, 6, 100) + NuPaths(L, 2, 7, 100) + NuPaths(L, 2, 8, 100) + NuPaths(L, 2, 9, 100)) #B + C; #The equation above gave me the result below. #5226548988000567248773522137264977941817881695114675433474341352228679239341009 #{1,2,3,4,5,6,7,8,9} #A:={r,v,l,b,m,n,a,i,o} # The list A above shows the letters in my full name with a number assigned to it. For example r=1 v=2 and so on. #L:=[{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6},{1,2,3,4,5,6},{1,2,3,4,5,6}] #The graph L represented above represents all the neighbors of each letter in A where no two vowels can be neighbors. #To compute the total number of paths I used the function NuPaths and computed all possible paths starting and ending at any two letters using L. #B := 3*(NuPaths(L, 9, 1, 100) + NuPaths(L, 9, 2, 100) + NuPaths(L, 9, 3, 100) + NuPaths(L, 9, 4, 100) + NuPaths(L, 9, 5, 100) + NuPaths(L, 9, 6, 100) + NuPaths(L, 9, 7, 100) + NuPaths(L, 9, 8, 100) + NuPaths(L, 9, 9, 100)) #C := 6*(NuPaths(L, 2, 1, 100) + NuPaths(L, 2, 2, 100) + NuPaths(L, 2, 3, 100) + NuPaths(L, 2, 4, 100) + NuPaths(L, 2, 5, 100) + NuPaths(L, 2, 6, 100) + NuPaths(L, 2, 7, 100) + NuPaths(L, 2, 8, 100) + NuPaths(L, 2, 9, 100)) #B+C= #202754070861600536180436660918725228517598077673149561660158560432399425152362436796384018432 #{1,2,3,4,5,6,7,8,9} #A:={r,v,l,b,m,n,a,i,o} # The list A above shows the letters in my full name with a number assigned to it. For example r=1 v=2 and so on. #L:=[{7,8,9},{7,8,9},{7,8,9},{7,8,9},{7,8,9},{7,8,9},{1,2,3,4,5,6},{1,2,3,4,5,6},{1,2,3,4,5,6}] #The graph L represented above represents all the neighbors of each letter in A where no two vowels can be neighbors and no two. #B := 3*(NuPaths(L, 9, 1, 100) + NuPaths(L, 9, 2, 100) + NuPaths(L, 9, 3, 100) + NuPaths(L, 9, 4, 100) + NuPaths(L, 9, 5, 100) + NuPaths(L, 9, 6, 100) + NuPaths(L, 9, 7, 100) + NuPaths(L, 9, 8, 100) + NuPaths(L, 9, 9, 100)) #C := 6*(NuPaths(L, 2, 1, 100) + NuPaths(L, 2, 2, 100) + NuPaths(L, 2, 3, 100) + NuPaths(L, 2, 4, 100) + NuPaths(L, 2, 5, 100) + NuPaths(L, 2, 6, 100) + NuPaths(L, 2, 7, 100) + NuPaths(L, 2, 8, 100) + NuPaths(L, 2, 9, 100)) #B+C; #5222371523228586691507591059411304343770770758809435324721135616 #Question 2 #The farmer can take the sheep to point B first because the wolf and the cabbage can be left alone together. The farmer then returns to point A. #Then the farmer can either take the wolf or the cabbage over to point B returning with the sheep to point A. #The sheep is left at point A and the farmer takes whatever is left at point A over to point B (could be either the cabbage or the wolf). #Then the farmer returns from point B to point A to carry the sheep over to point B. #Question 4 #C=Canibal, M=Missionary #CCCMMM -- # MC-> #CCMM MC # <-M #CCMMM C # CC-> #MMM CCC # <-C #MMMC CC # MM-> #MC MMCC # <-MC #MMCC MC # MM-> #CC MMMC # <-C #CCC MMM # CC-> #C MMMCC # <-C #CC MMMC # CC-> # MMMCCC