It is ok to post! # Name:Treasa Bency Biju Jose # Date: 09-22-2020 # Assignment #5 ----------------------------------------------------------------------------------------------------------------------------------------------- I. # To Prove: p(n) = n* p(n-1) # p(n) = |P(n)| with(combinat): P := n -> permute(n); P := n -> permute(n) P(2); [[1, 2], [2, 1]] p := n -> nops(P(n)); p := n -> nops(P(n)) p(3); 6 p(2); 2 # p(3) = 3 * p(2) # p(3) = 3 * 2 = 6 # Hence proved ----------------------------------------------------------------------------------------------------------------------------------------------- IV. If some one is clever and good-lookingbit neither strong nor kind, make sure that he or she are counted exactly once, by finding out How many time he is INCLUDED in line 1: 4 How many time he is EXCLUDED in line 2: 0 How many time he is INCLUDED (again) in line 3: 4 How many time he is EXCLUDED (again) in line 4: 0 PIE4 := proc(U, C, S, L, K) local m; if not type(U, set) then RETURN(FAIL); end if; if not type(C, set) then RETURN(FAIL); end if; if not type(S, set) then RETURN(FAIL); end if; if not type(L, set) then RETURN(FAIL); end if; if not type(K, set) then RETURN(FAIL); end if; if (C intersect S intersect L intersect K) = {} then RETURN(FAIL); end if; m := ((nops(C) + nops(S) + nops(L) + nops(K)) + -(nops(C intersect S) + nops(C intersect L) + nops(C intersect K) + nops(S intersect L) + nops(S intersect K) + nops(L intersect K)) +(nops(C intersect S intersect L) + nops(S intersect L intersect K) + nops(C intersect L intersect K) + nops(C intersect S intersect K)) - nops(C union S union L union K): end proc: -----------------------------------------------------------------------------------------------------------------------------------------------