It is ok to post! # Name:Treasa Bency Biju Jose # Date: 09-24-2020 # Assignment #6 ------------------------------------------------------------------------------------------- I. PIE is used as an evaluation of two ways to find the cardinality of the intersection. This method best helps in proof and not in calculations. evalb([seq(Pnx(n, x), n = 1 .. 7)] = [seq(PnxF(n, x), n = 1 .. 7)]); true evalb(time([seq(PnxF(n, x), n = 1 .. 8)]) < time([seq(Pnx(n, x), n = 1 .. 8)])); true ------------------------------------------------------------------------------------------- II. PnxF(n,x) is used to find the polynomial in x of degree n whose coefficients of x^i is the number of permutations with exactly i fixed points. D(n) helps finding the number of derrangements of n objects. By excluding D(n) we can find the coeeficients for PnxF(n,x) Hence by the inclusion-exclusion principle, D(n) is used as a constant term in PnxF(n,x) ------------------------------------------------------------------------------------------- III. when i= 0 1 2 3 4 5 6 7 8 9 10 11 12 OEIS A number: A000166, 0, A000387, 0, 0, 0, 0, 0, 0, 0, 0, A010054, A010815 The largest value of i for which there is an OEIS sequence is i= 12 ------------------------------------------------------------------------------------------- IV. d(n) = n * d(n-1) + (-1)^(n-1) for n=1,2,.. d(n-1) = (n-1) * d(n-2) + (-1)^(n-2) for n=2,3,.. d(n-2) = (n-2) * d(n-3) + (-1)^(n-3) for n=3,4,.. These recurrence functions are interlinked because, in d(n) it recurrsively calls d(n-1) and similarly d(n-1) recurrsively calls d(n-2). d1 := proc(n) option remember; n*d(n - 1) + (-1)^(n - 1); end proc; d2 := proc(n) option remember; (n - 1)*d(n - 2) + (-1)^(n - 2); end proc; d3 := proc(n) option remember; (n - 2)*d(n - 3) + (-1)^(n - 3); end proc; seq(d1(i), i = 1 .. 10); 2, -1, 4, 7, 46, 263, 1856, 14831, 133498, 1334959 seq(d2(i), i = 2 .. 10); 2, -1, 4, 7, 46, 263, 1856, 14831, 133498 seq(d3(i), i = 3 .. 10); 2, -1, 4, 7, 46, 263, 1856, 14831 -------------------------------------------------------------------------------------------