#OK to post homework #Ariana Yousafzai, 9/20/2020, Assignment 1 #Question 1 diff(x*y^9,x); distance((3, 7, 42),(9,9,9); int(17*y^3, y); #Question 2 F(6) = {[1,1,1,1,1,1],[2,1,1,1,1],[1,2,1,1,1],[1,1,2,1,1],[1,1,1,2,1],[1,1,1,1,2],[2,2,1,1],[2,1,2,1],[2,1,1,2],[1,1,2,2],[1,2,1,2],[1,2,2,1]} #Question 3 L1 := [Mercury, Venus, Earth]; L2 := [op(L1), Mars]; We initialize WALKS(m,n) ) with either m or n or both negative to be the Empty set {} because if either value in negative, they exist outside the Manhattan “lattice,” and it is thereby impossible to create a path from one point to the other. We initialize WALKS(0,0) to be the singleton set {[]} because there is no path that exists that connects one point to the other since the function indicates that the start and end point is the same. #Question 4 F:=proc(n) local X1,X2,x1,x2: option remember: if n<0 then RETURN({}): fi: if n=0 then RETURN({[]}): fi: X1:=F(n-1): X2:=F(n-2): {seq([op(x1),1],x1 in X1), seq([op(x2),2],x2 in X2) }: end: F(6) = {[2, 2, 2], [1, 1, 2, 2], [1, 2, 1, 2], [1, 2, 2, 1], [2, 1, 1, 2], [2, 1, 2, 1], [2, 2, 1, 1], [1, 1, 1, 1, 2], [1, 1, 1, 2, 1], [1, 1, 2, 1, 1], [1, 2, 1, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]} #This matches the F(6) determined by hand. #Question 5 #NuF(n): inputs a non-negative integer n and outputs the numbers of lists in {1,2} that add up to n NuF:=proc(n) local X1,X2,x1,x2: option remember: if n<0 then RETURN(0): fi: if n=0 then RETURN(1): fi: F1:=NuF(n-1): F2:=NuF(n-2): X1+X2: end: NuF(1000) = 70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501 # nops(F(1000)) commands Maple to compute the number of elements of F(1000), which comes out to an extremely large number which is overwhelming for the program to handle.