#HW 11 Eshaan Gandhi. Ok to post # Question 1 In how many ways can you assemble 11 Russian dolls of different sizes into 5 different "towers"? In how many ways can you do it with any number of towers. #Answer 1: What we are looking for is the Sterling numbers of the second time. I find that using the maple procedure Snk and then to answer the second question, we've been asked the bell number and I use Bell3 procedure Snk(11, 5) 246730 Bell3(11) 678570 #246730 ways to assemble 11 Russian dolls in 5 different towers and 678570 ways to do it in any number of towers #Question 2 - First Write a one-line procedure xn(x,n) that inputs a variable x and a non-negative integer n and outputs #x*(x-1)*(x-2)*...*(x-(n-1)) #using this, write another one-line procedure, call it Axn(x,n) that inputs a variable x and a non-negative integer n and outputs #Sum(Snk(n,k)*xn(x,k),k=0..n) xn:=proc(x, n) local ans, i, l1: l1:=[seq(i, i=0..n-1)]: ans := 1: for i in l1 do: ans:=ans*(x-i): od: ans end proc: Axn:=proc(x, n) local i,k, l1, l2: option remember: l2:=0: l1:=seq(Snk(n, k)*xn(x, k), k=0..n): #l2:=seq(, k=0..n): for i in l1 do: l2:=l2+i: od: l2 #Snk(n,k)*xn(x,k),k=0. end proc: expand(Axn(x, 7)) 7 x #Axn(x, n) = x^n cnk:=proc(n,k) option remember: if n=1 then if k=1 then RETURN(1): else RETURN(0): fi: fi: cnk(n-1,k-1)+(n-1)*cnk(n-1,k): end: cnk(5,1)*x^1 24 x