#OK to post homework #TaerimKim,9/10/2020,Assignment 1 #1. > diff(x^5, x); 4 5 x ; > Int(x^2/sqrt(-x^3 + 1), x); / | 2 | x | -------------- dx | (1/2) / / 3 \ \-x + 1/ ; > ; > evalf(tan(Pi/5)); 0.7265425281 #2. F(6) = {[2, 2, 2], [1, 1, 2, 2], [1, 2, 1, 2], [2, 1, 1, 2], [2, 1, 2, 1], [2, 2, 1, 1], [1, 2, 2, 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]} #3-1. L1 := [Mercury, Venus, Earth]; L1 := [Mercury, Venus, Earth] L2 := [op(L1), Mars]; L2 := [Mercury, Venus, Earth, Mars] #3-2: Intuitively, negative steps is not possible since we want only positive step .Or otherwise, we will get infinite regression. So we put empty set to prevent infinite regression. #3-3: (0,0) to (0,0) is still considered a move but normal move. So we still assign singleton step to count as # of steps. #4. >Count := proc(m, n) local W1, W2, w1, w2; option remember; if m < 0 or n < 0 then RETURN({}); end if; if m = 0 and n = 0 then RETURN({[]}); end if; W1 := Count(m - 1, n - 1); W2 := Count(m - 2, n - 1); {seq([op(w1), 1], w1 in W1), seq([op(w2), 2], w2 in W2)}; end proc; >F := proc(n) local a; option remember; a := n; do print(Count(n, a))*a--; until a = 0; end proc; >F(6); {[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]} {} {} ##I got what I have calculated with hand but also included empty set as well.. But this is the best I can do! #5. >ICount := proc(m, n) local W1, W2, w1, w2; option remember; if m < 0 or n < 0 then RETURN(0); end if; if m = 0 and n = 0 then RETURN(1); end if; W1 := ICount(m - 1, n - 1); W2 := ICount(m - 2, n - 1); W1 + W2; end proc >NuF := proc(n) local a, result; a := n; result := 0; do result := result + ICount(n, a); a--; until a = 0; print(result); end proc ##Caculating NuF(1000) >NuF(1000); 70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501