#OK to post homework #Tianyi Liu,Sept 20, Assignment 1 1. diff(x^3,x); x+y; 2. {[1,1,1,1,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, 2, 2], [1, 2, 1, 2], [1, 2, 2, 1], [2, 1, 1, 2], [2, 1, 2, 1], [2, 2, 1, 1], [2, 2, 2]} 3. L2:=[op(L1), Mars] Because we define that only positive steps are allowed, so m or n cannot be negative. Therefore, we define it as empty set. Because in the case of m and n are 0, from (0,0) to (m,n) would be an empty walk. The function outputs possible ways to get to (m.n) and we do not need to take any step, so it is the empty singleton. 4. F:=proc(n) local a,b,A,B: option remember: if n<0 then RETURN({}): fi: if n=0 then RETURN({[]}): fi: A:=F(n-1): B:=F(n-2): {seq([op(a),1],a in B),seq([op(b),2],b in B)}: end: 5. NuF:=proc(n) local a,b: option remember: if n<0 then RETURN(0): fi: if n=0 then RETURN(1): fi: a:=NuF(n-1): b:=NuF(n-2): a+b: end: NuF(1000) = 70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501 Even though i did not get any complaints but it may be because the recursive function would generate way too many calls and it exceeds computer's capability.