> #ok to post; > #Yifan Zhang, 11/18/2020 > > #Q1. > #How many set partitions are there of a 100-element set such that > #(i) There are exactly 7 components, and each component has odd size > > #(ii) There are exactly an odd number of components, but the sizes of the components can be any strictly positive integer > > #(iii) There are exactly an odd number of components, but the sizes of the components can be any strictly positive integer except that we do not allow componets of size 2 and 5 > > #1. > #Ans: 0 > #The sum of 7 odd numbers are odd, and 100 is even. Hence the number of this case is 0. > coeff( taylor(((sum(x^(2*k+1)/(2*k+1)!, k=0..infinity))^7/7!),x=0, 101),x,100)*100!; 0 > > #2. > f1:=sum((exp(x)-1)^(2*k+1)/(2*k+1)!, k=0..50): > coeff(taylor(f1,x=0,101),x,100)*100!; 23792695638183628316167125166708722722054741318989995555688894753342022292474103758734144789060946967960716668504295 > > #3. > g1:=sum((exp(x)-1)^k/k!, k=6..100)+(exp(x)-1)^3/3!+(exp(x)-1)^4/4!: > coeff(taylor(g1,x=0,101),x,100)*100!; 47585391276764833658790768841387207826363669686759873057914872738952218764139731189769390723552853950606968871180563 > > #Q2. > #How many permutations are there of {1,2,..., 100} such that > #(i) There are exactly 7 cycles, and each cycle has odd size > > #(ii) There are exactly an odd number of cycles, but the length of the cycles can be any strictly positive integer > > #(iii) There are exactly an odd number of cycles, but the lengths of the cycles can be any strictly positive integer except that we do not allow cycles of length 2 and 5 > > #1. > #Ans: 0 > coeff( taylor((exp(-log(1-x)-sum(x^(2*k+1)/(2*k+1)!, k=0..infinity))^7/7!),x=0, 101),x,100)*100!; 10805021922129493449194884975419891136258957903076779113864648844004123208432552949743894541226225248044683191695555586537755199670594667580080573456525610315783187/720 > > #2. > f2:=sum((-log(1-x))^(2*k+1)/(2*k+1)!, k=1..50): > coeff(taylor(f2,x=0,101),x,100)*100!; 45729845567532634814032627039570683240450824449546994519610552308656623996682658648381317348316693960264311981205339641543080753349263360000000000000000000000 > > #3. > g2:=sum((-log(1-x)-x^2/2!-x^5/5!)^(2*k+1)/(2*k+1)!, k=1..50): > coeff(taylor(g2,x=0,101),x,100)*100!; 27134468315718085101735642558070322336244114142558516654682589325469389058435792137583531726578531310491888263066077147292033554177418825888430488317733667350 > > #Q3. > #How many labeled connected graphs are there with 100 vertices? How many are there with exactly 2 components? With exactly 100 components? > f:= log(add(2^(n*(n-1)/2)*x^n/n!, n=0..101)): > coeff(taylor(f,x=0, 101),x,100)*100!; 125452273648412141401139200773089339811437122262323352216462286700734387627331522885709312904647210371328794107858418293356140610389233010890575674923332327423429917033308833625087865757067009121643735335562957720919464360279849562024268481514680519466433342816295305461792608710076067024418040646132922593872156786882042514851134725907407734998659047116141535192232282791034794601497425933135733739224548153792567839779141913680549722028773475603674523853169051845195421079685934332310882053907313995168923535704556709136009686053259752740308577712484995569783650846269720521608249582420017860918845622644663874987575160515268766971368721963159046529551370104575096202684311358624098672672476994761800126366704378281769378475834662925454186722285874859694872242026068795039642380038691501013387521486053366727435218916045301026547623117868196574350026663672938544838421549439678291079144887169351257353939537143880911795509769485297854345823362270660712007071953958048732807833151699233932553517365602355625760928908188344900652899469143373311896574182769657272933821876553379518700197938172155010185719146936187180903250543579433005278984692348282568379624191843385007057047580846112172322370992146748764340302424100769640802926078370838482052406435490036434092467614465282934547622486501083341846045800849550829377015688082924233744178977266360888077466658752803757886543953371541948150838050857811138739570190403175194723845806878286855221273591078542964296886759202533689916185534005248 > >