#Ariana Yousafzai, 9/30/2020, Assignment 6 #OK to post #Question 1 PIE is typically only of theoretical interest because it makes sense to use it when illustrating an example that involves small sets of numbers. For larger numbers, it is unmanageable to utilize and for that reason it is usually not used for reasons besides theoretical purposes. [seq(Pnx(n,x),n=1..7)] and [seq(PnxF(n,x),n=1..7)] do give the same output. time([seq(Pnx(n,x),n=1..8)]); takes longer to run in comparison to running time([seq(PnxF(n,x),n=1..8)]); time([seq(PnxF(n,x),n=1..30)]) is approximately 0. time([seq(Pnx(n,x),n=1..30)]) is a much larger number due to the number of permutations that must be calculated. #Question 2 The formula Pnx(n,x) takes into account that for x^0, the coefficient is the number of permutations that has 0 fixed points. This is the definition of derangement, which is a constant. #Question 3 i=0: [1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496, 1334961, 14684570, 176214841] A000166 i=1 [0, 1, 0, 3, 8, 45, 264, 1855, 14832, 133497, 1334960, 14684571, 176214840] n/a i=2 [0, 0, 1, 0, 6, 20, 135, 924, 7420, 66744, 667485, 7342280, 88107426] A000387 This is the largest i for which there is a sequence in the OEIS #Question 4 d(n) = (n-1)*(d(n-1) + d(n-2))