It is ok to post! # Name:Treasa Bency Biju Jose # Date: 09-13-2020 # Assignment #1 I. diff(x^3, x); 2 3 x 5!; 120 567^(1/3); (1/3) 567 Matrix(2, 2, [[2, 3], [6, 5]]); [2 3] [6 5] II. # F(6): {[6], [1, 5], [2, 4], [3, 3], [4, 2], [5, 1], # [1, 1, 4], [1, 2, 3], [1, 3, 2], [1, 4, 1], [2, 1, 3], [2, 2, 2], [2, 3, 1], [3, 1, 2], [3, 2, 1], [4, 1, 1], # [1, 1, 1, 3], [1, 1, 2, 2], [1, 1, 3, 1], [1, 2, 1, 2], [1, 2, 2, 1], [1, 3, 1, 1], [2, 1, 1, 2], [2, 1, 2, 1], [2, 2, 1, 1], [3, 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, 1, 1, 1, 1]} III. L1 := [Mercury, Venus, Earth]; L1 := [Mercury, Venus, Earth] L2 := [op(L1), Mars]; L2 := [Mercury, Venus, Earth, Mars] # The reason we use an empty set {} when m or n are negative is because, when they are negative there's # no place to walk and hence the set is negative. # We declare set {[]} when m and n are 0 because its an empty walk which is also considered a walk. IV. F:=proc(n) local S,S1,i,s: option remember: if n<0 then RETURN({}): fi: if n=0 then RETURN({[]}): fi: S:={}: for i from 1 to n do S1:=F(n-i): S:=S union {seq( [op(s),i], s in S1)}: od: S: end: F(6); {[6], [1, 5], [2, 4], [3, 3], [4, 2], [5, 1], [1, 1, 4], [1, 2, 3], [1, 3, 2], [1, 4, 1], [2, 1, 3], [2, 2, 2], [2, 3, 1], [3, 1, 2], [3, 2, 1], [4, 1, 1], [1, 1, 1, 3], [1, 1, 2, 2], [1, 1, 3, 1], [1, 2, 1, 2], [1, 2, 2, 1], [1, 3, 1, 1], [2, 1, 1, 2], [2, 1, 2, 1], [2, 2, 1, 1], [3, 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, 1, 1, 1, 1]} V. NuF := n -> nops(F(n)); NuF := proc (n) options operator, arrow; nops(F(n)) end proc NuF(6); 32 nops(F(6)); 32 NuF(1000) and nops(F(1000)) are really long codes and take long time to evaluate