#OK to post homework #Karnaa Mistry, 11/15/20, Assignment HW #19 with(combinat): # 1. # Let A and B be two distinct families of labeled objects, where there are a(n) labeled objects of size n in A and b(n) labeled objects of size n in B. # We want to make a new set of labeled objects, call it C, such that A x B = C. These labels must also be unique and disjoint, and, effectively, # each of these labeled objects in C are unique pairs constructed from some components from A and some from B. # Let the size of a pair in C be the size of its components added together (pieces from A and B) # To construct a formula for the size of a pair in C, we choose the size of the first component k, which means the size of the second component is n-k. # We assign binomial(n,k) labels to the first component, then we choose actual objects (from A and B) to go into each component of C. This is equal # to a(k)*b(n-k) ways. Sum this from k=0..n to get c(n) = sum(binom(n,k)*a(k)*b(n-k), k=0..n). # This is c(n), and for an EGF we multiply by x^n/n! and sum from n=0..infinity. We have: # Sum( c(n)*x^n/n!, n=0..infinity) = Sum( Sum( a(k)/k!*x^k*b(n-k)/(n-k)!*x^(n-k), k=0..n), n=0..infinity). We see that we can separate the innermost product: # = Sum( a(k)/k!*x^k, k=0..infinity) * Sum( b(n-k)/(n-k)!*x^(n-k), n-k=0..infinity) ((treating n-k as its own index of summation)). # Therefore, EGF(C) = EGF(A x B) = EGF(A)*EGF(B) # 2. # sum(x^n*n*(n-1)*(n-2)/n!,n=0..infinity) = x^3*exp(x) # 3. # (i) note: egf(C) = egf(A) * egf(B) when C is A x B (i.e. ordered pairs consisting of items of A and B) (p. 8) # Using coeff(taylor(egf*egf,x=0,n+1),x,n)*n!, we have: # coeff(taylor(exp(exp(x)-1)*exp(exp(x)-1),x=0,101),x,100)*100! = # 86635961604145793709294621186421021577187015751602637085427283871117865337554218116225569701173834817160231371909161518471870 ordered pairs # (ii) note: when order does not matter, "efg of k-sets of A-objects is [egf(A)^k]/k!" (p. 8); our k=2 # Using coeff(taylor(egf*egf/n!,x=0,n+1),x,n)*n!, we have: # coeff(taylor(exp(exp(x)-1)^2/2!,x=0,101),x,100)*100! = # 43317980802072896854647310593210510788593507875801318542713641935558932668777109058112784850586917408580115685954580759235935 sets