> #Weiji Zheng, Homework 22, 12/10/2020 ; > #OK TO POST HOMEWORK ; > ; > #Q1 ; > #(i)How many labeled ROOTED trees are there with 67 vertices and 12 leaves? (recall that a leaf is a vertex with no children) ; > #(ii)How many labeled connected graphs are there with 40 vertices and 43 edges? ; > ; > #coeff(TreeSeqL(67, t)[67],t,12) = 762668035595791008261768918050546247626868131307789154916300139847357281766830345010754357481701376000000000000000 ; > ; > #ATreeSeq(40,4)[40] = 90324445150366623501655158316607196285055246080819484164096000000000 ; > ; > #Q2 ; > #Write a procedure SeqRTchild(S,N), that inputs a finite set of positive integers, S, and a positive integer N, and outputs the first N entries in the lhe list enumerating rooted labeled trees where every vertex is either a leaf (i.e. 0 children) or has a mumber of children that must be in the set S. > #Output SeqRTchild(S,30) for the following sets S if it is in the OEIS, state the A-number. If it is not, say so. > > #(i) S={1,2} > # > #(ii) S={1,2,3} > # > #(iii) S={1,2,3,4} > # > #(iv) S={1,3,4} > # > #(v) S={2,3,4} ; > ; > SeqRTchild:=proc(S,N) local r, z, L, s, i: > > r = 1 + add(z^s/s!, s in S): > > L := FunEqToSeq(r,z,N): > [seq(L[i]*i!, i=1..N)]: > end: > #SeqRTchild({1,2}, 20) = [1, 2, 9, 60, 540, 6120, 83790, 1345680, 24811920, 516650400, 11992503600, 307069963200, 8598348158400,261387760233600, 8573572885878000, 301809119163552000, 11349727401396384000, 454104511068656448000, 19261139319649202976000, 863322072620761353600000] ; > #A036774 ; > ; > #SeqRTchild({1,2,3}, 20) = [1, 2, 9, 64, 620, 7620, 113610, 1992480, 40194000, 916927200, 23341071600, 655922836800, 20169411662400,673645440468000, 24285190867938000, 939899116892736000, 38870133445791648000, 1710655202853140544000, 79826043011286892320000,3936948118406837614080000] > #A036775 ; > ; > #SeqRTchild({1,2,3,4}, 20) = [1, 2, 9, 64, 625, 7770, 117390, 2088520, 42771960, 991090800, 25635767850, 732235165200, 22890759391500, 777398836414200, 28501053507927000, 1121908690738836000, 47194400446765572000, 2112854517933207048000, 100302903229033765260000,5032863920347902999360000] ; > #A036776 ; > ; > #SeqRTchild({1,3,4}, 20) = [1, 2, 6, 28, 205, 2070, 25410, 359800, 5798520, 105663600, 2155645800, 48657886200, 1202586485100, 32282071621800, 935338118715000, 29098128631572000, 967482670702548000, 34237946556613800000, 1284878182355343576000, 50967054449973501840000] ; > > #SeqRTchild({2,3,4}, 20) = [1, 0, 3, 4, 65, 300, 4200, 37240, 567000, 7459200, 130873050, 2248785000, 45820074300, 960718558800, 22551581052000, 554522292324000, 14815285064580000, 416528503687296000, 12512460971526516000, 395230114168409520000] ; > ; > #Q3 ; > #Write a procedure SeqRTchildNone(S,N), that inputs a finite set of positive integers, S, and a positive integer N, and outputs the first N entries in lhe list enumerating rooted labeled trees where every vertex is either a leaf (i.e. 0 children) or has a mumber of children that must NOT be in the set S (otherwise it can have any number of children) > #Output SeqRTchildNone(S,30) for the following sets S if it is in the OEIS, state the A-number. If it is not, say so. ; > #(i) S={1,2} > # > #(ii) S={1,2,3} > # > #(iii) S={1,2,3,4} > # > #(iv) S={1,3,4} > # > #(v) S={2,3,4} ; > ; > SeqRTchildNone := proc(S,N) local i,r,s,L: > r := add(z^s/s!, s in S): > > L := FunEqToSeq(exp(z) - r, z, N): > seq(L[i]*i!, i = 1 .. N): > end: > ; > #SeqRTchildNone({1, 2}, 30) = [1, 0, 0, 4, 5, 6, 427, 1968, 6561, 220510, 2129171, 13847736, 337904437, 5156062926, 54298310445, 1192150218496, 24147409593089, 364887230459454, 8145781717395223, 197451127561855320, 3926192043196053981, 94990207383298607710, 2610336306304411857305, 64078852103083131579744, 1726495205831435720085025, 52484675948201890653360126, 1518445334604977900122070187, 45861761590549321813006087288, 1526865236101367578721315510501, 50384530075662682488952867803630] ; > ; > #SeqRTchildNone({1, 2, 3}, 30) = [1, 0, 0, 0, 5, 6, 7, 8, 2529, 11350, 36971, 104556, 10182757, 99054970, 632882265, 3303250096, 165364954369, 2689602118254, 28186612549255, 233809699635780, 7892319785766381, 179814939414630850, 2756870670036244125, 33096414795555263400, 912900463740631221025, 25500259308250835585126, 525446228008825720959987, 8542226394636207936384988, 221053236679631262456996629, 6917456518383991775275958250] ; > ; > #SeqRTchildNone({1, 2, 3, 4}, 30) = [ 1, 0, 0, 0, 0, 6, 7, 8, 9, 10, 13871, 60996, 195637, 546560, 1411425, 427249696, 4124980929, 26013422934, 134201794555, 614270986500, 72817031988981, 1211924018940580, 12610860108434875, 103535416865167920, 734250836621295625, 45715497965321732626, 1118451164263614198837, 17224976603614475727388, 205357624826971857095129, 2077663816106417272277280] ; > ; > #SeqRTchildNone({1, 3, 4}, 30) = [1, 0, 3, 0, 60, 6, 3157, 1184, 319545, 275410, 53033321, 83703456, 13098092449, 33167158220, 4510571784825, 16803854861296, 2066927734933569, 10656494045569638, 1216790715487035979, 8295602009107807560, 895347027336888089481, 7792315471001122039000, 805563125856063419979883, 8701845909614991922610520, 870378180227805997956836425, 11404602278067389636121827626,1112438746363268367847514778237, 17345790119923612625856930761584, 1660574626556038794681719869586525, 30316620075363168814557434112312780] ; > ; > #SeqRTchildNone({2, 3, 4}, 30) = [1, 2, 6, 24, 120, 726, 5299, 47776, 546921, 7889140, 136394401, 2665805088, 56527983109, 1272143206894, 30092542593975, 746083879217776, 19400233368172481, 530317219796563464, 15282749263331425861, 465396262003998042440, 14992883794257587989701, 510699344284110989954122, 18354927165740287915555401, 693811746109567482139376664, 27479365035663372539331241225, 1136209816394200462905288576876, 48889737108198130555987699902039, 2183691389126980386553090058226016, 101058267340716742644796216036535641, 4839369087144324614043894777799206870] ; > ; > #ALL NOT IN OEIS ; > ; > #Q4 ; > #By using procedure TreeSeqL(N,x) and procedure AveAndMoms(f,x,K) with K=6, added after class, try to > #(i) Estimate the limit of the average number of leaves in a labelled tree with vertex n divided by n > # > #(ii) Estimate the limit of the standard-deviation of the number of the random variable ` number of leaves in a labelled tree with vertex n', divided by n > > #The third, fourth, fifth, and sixth scaled moments > ; > LET TreeSeqL(50,x) = L ; > [seq(AveAndMoms(L[i], x, 2)[1]/i, i = 1 .. 50)] > [1., .5000000000, .4444444443, .4218750000, .4096000000, .4018775720, .3965694566, .3926959038, .3897443431, .3874204890, .3855432895, .3839952306, .3826967067, .3815918726, .3806403927, .3798124058, .3790853319, .3784417801, .3778681390, .3773536026, .3768894829, .3764687155, .3760854967, .3757350149, .3754132467, .3751168023, .3748428052, .3745887982, .3743526714, .3741326000, .3739270013, .3737344922, .3735538615, .3733840426, .3732240931, .3730731769, .3729305497, .3727955466, .3726675726, .3725460922, .3724306237, .3723207314, .3722160212, .3721161345, .3720207460, .3719295583, .3718422998, .3717587219, .3716785965, .3716017144] Error, invalid subscript selector ; > #the limit of the average number seems to be 0.371 ; > ; > [seq(AveAndMoms(L[i], x, 2)[2]/i, i = 1 .. 50)] > [0., 0., .1571348402, .1457402977, .1335209347, .1233425370, .1149906649, .1080523762, .1021956270, 0.9717699729e-1, 0.9281933018e-1, 0.8899205425e-1, 0.8559723085e-1, 0.8256006771e-1, 0.7982247273e-1, 0.7733861994e-1, 0.7507184788e-1, 0.7299245333e-1, 0.7107609347e-1, 0.6930261150e-1, 0.6765515952e-1, 0.6611953482e-1, 0.6468367113e-1, 0.6333724367e-1, 0.6207136020e-1, 0.6087831585e-1, 0.5975139715e-1, 0.5868472446e-1, 0.5767312338e-1, 0.5671202010e-1, 0.5579735455e-1, 0.5492550884e-1, 0.5409324727e-1, 0.5329766579e-1, 0.5253614997e-1, 0.5180633864e-1, 0.5110609335e-1, 0.5043347208e-1, 0.4978670664e-1, 0.4916418330e-1, 0.4856442563e-1, 0.4798608012e-1, 0.4742790314e-1, 0.4688874991e-1, 0.4636756444e-1, 0.4586337100e-1, 0.4537526651e-1, 0.4490241352e-1, 0.4444403439e-1, 0.4399940582e-1] > > #the limit of the standard-deviation seems to be 0.4399940582e-1 = 0.043 ;