It is ok to post! # Name:Treasa Bency Biju Jose # Date: 10-06-2020 # Assignment #11 ------------------------------------------------------------------------------------------------------------- 1. Snk(11, 5); 246730 Bell1(11); 678570 ------------------------------------------------------------------------------------------------------------- 2. xn := proc(x, n) local t, i; t := seq(product(x - i, i = 0 .. n - 1)); end proc; Axn := proc(x, i) local k, t, r, j; t := seq(Snk(i, k)*xn(x, k), k = 1 .. i); r := sum(t[j], j = 1 .. i); end proc; g := [seq(Axn(x, i), i = 0 .. 20)]; g := [0, x[1], 2 x, 7 x - 3, 21 x - 7, 81 x - 40, 333 x - 301, 1380 x - 966, 6555 x - 4726, 32896 x - 32640, 165433 x - 233131, 917280 x - 961026, 5468477 x - 5310031, 33448689 x - 38509653, 204250413 x - 305175781, 1230416470 x - 2368946586, 8924565505 x - 12014156731, 66117111757 x - 78263729158, 488241037955 x - 638628998578, 3555892367056 x - 5702521065920, 25459096260937 x - 50825984897871] t := [seq(Axn(5, i), i = 0 .. 20)]; t := [0, 5[1], 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125, 6103515625, 30517578125, 152587890625, 762939453125, 3814697265625, 19073486328125, 95367431640625] with(gfun); guessgf(t, x); [-((-5*5[1] + 25)*x^2 + 5[1]*x)/(5*x - 1), ogf] l := [seq(Axn(6, i), i = 0 .. 20)]; l := [0, 6[1], 36, 216, 1296, 7776, 46656, 279936, 1679616, 10077696, 60466176, 362797056, 2176782336, 13060694016, 78364164096, 470184984576, 2821109907456, 16926659444736, 101559956668416, 609359740010496, 3656158440062976] guessgf(l, x); [-((-6*6[1] + 36)*x^2 + 6[1]*x)/(6*x - 1), ogf] # Hence the generalised formula for Axn(x,n) for any positive n in terms of y is: # Axn(x, n) = [-((x^2 - 11*x)*y^2 + xy)/(xy - 1), ogf] ----------------------------------------------------------------------------------------------------------------------- 3. Proving the recurrence c(n,k) = c(n-1,k-1) + (n-1) * c(n-1,k) # binomial(n,k) := binomial(n-1,k-1) + biomial(n-1,k) # Cases: n does or does not belong to the set # S(n,k):= Set partions {1..n} with exactly k cycles # Case 1: n not part of the set gives => {1..n-1} and k-1 cycles # Case 2: Since n is not alone, removing it will => {1..n-1} with k cycles # Hence k has n-1 options existing and so (n-1) * c(n-1,k) # c(n,k) = c(n-1,k-1) + (n-1) * c(n-1,k) ----------------------------------------------------------------------------------------------------------------------- 4. cnk := proc(n, k) option remember; if n = 1 then if k = 1 then RETURN(1); else RETURN(0); end if; end if; cnk(n - 1, k - 1) + (n - 1)*cnk(n - 1, k); end proc: cnk(5, 3); 35 ----------------------------------------------------------------------------------------------------------------------- 5. factor(Sum(c(5, 3)*x^k, k = 1 .. 5)); 5 ----- \ ) k / 35 x ----- k = 1 c(5, 3); 35 # from above we know that the generalised formula is n ----- \ ) k / c(n,k) x ----- k = 1 factor(sum(c(5, 3)*x^k, k = 1 .. 5)); 35*x*(x^4 + x^3 + x^2 + x + 1) -----------------------------------------------------------------------------------------------------------------------