> #Attendence Q1: > Write the prove of lemma 1 in your own words with more details. > #Since the tree has no cycles, there is at least one vertex that has only one neighbor. Such a vertex is called a leaf. > #If you remove it, you get a smaller tree with one less vertex and one less edge, > #By the induction, for the smaller tree, the number of vertices - number of edges = 1 > #Base case, the tree with one vertex has 0 edges, 1-0=1 > #Hence proved the lemma: A tree with n vertices must have n-1 edges > > > #Attendence Q2: > #What is the OEIS A number of this sequence? > read `M22.txt`; > L:=TreeSeq(10); L := [1, 1, 3, 16, 125, 1296, 16807, 262144, 4782969, 100000000] > #A000272: number of trees of n labeled nodes. > > #Attendence Q3: > #Is this sequence in the OEIS? A number? (number of labeled connected graphs with as many edges as vertices) > ATreeSeq(10,1); [0, 0, 1, 15, 222, 3660, 68295, 1436568, 33779340, 880107840] > #A057500: number of connected labeled graphs with n edges and n graphs > > #Attendence Q4: > #What is the smallest r such that ATreeSeq(30,r) is not in the OEIS? > ATreeSeq(10,4); [0, 0, 0, 0, 45, 4945, 331506, 18602136, 974679363, 50088981600] > #Optional: submit it. > ATreeSeq(10,5); [0, 0, 0, 0, 10, 2997, 343140, 28044072, 1969994376, 128916045720] > ATreeSeq(10,6); [0, 0, 0, 0, 1, 1365, 290745, 35804384, 3431889000, 288982989000] > ATreeSeq(10,7); [0, 0, 0, 0, 0, 455, 202755, 39183840, 5228627544, 573177986865] > ATreeSeq(10,8); [0, 0, 0, 0, 0, 105, 116175, 37007656, 7032842901, 1016662746825] > ATreeSeq(10,9); [0, 0, 0, 0, 0, 15, 54257, 30258935, 8403710364, 1624745199910] > ATreeSeq(10,10); [0, 0, 0, 0, 0, 1, 20349, 21426300, 8956859646, 2352103292070] > ATreeSeq(10,11); [0, 0, 0, 0, 0, 0, 5985, 13112470, 8535294180, 3096620034795] > ATreeSeq(10,12); [0, 0, 0, 0, 0, 0, 1330, 6905220, 7279892361, 3717889913655] > ATreeSeq(10,13); [0, 0, 0, 0, 0, 0, 210, 3107937, 5557245480, 4078716030900] > #n vertices with n+12 vertices is not in the OEIS. submitted. > > #Attendence Q5: > #What is the ratio of the time(TreeSeq(75)) and time(TreeSeq1(75)) > time(TreeSeq(75)); 49.890 > time(TreeSeq1(75)); .703 > 49.890/0.703; 70.96728307 > > #Attendence Q6: > #Let r_e(n) be the number of roots trees where every vertex has an even number of children. Set up an generating function for r_e(n). > > f:= sum(r_e(n)*x^n/n!, n=0..infinity); f := sum(r_e(n)*x^n/factorial(n), n = 0 .. infinity) > F:=LIF(exp(z),z,10); F := [1, 1, 3/2, 8/3, 125/24, 54/5, 16807/720, 16384/315, 531441/4480, 156250/567] > seq(F[i]*i!, i=1..10); 1, 2, 9, 64, 625, 7776, 117649, 2097152, 43046721, 1000000000 > > > #Attendence Q7: > #How many labeled trees are there with 27 vertices and 6 leaves? > > L:=TreeSeqL(27,t)[27]; L := t^26+872415206*t^25+275346987688500*t^24+2920731168361734000*t^23+4388194382312972322000*t^22+1772864567898955712781600*t^21+270505223936259661308960000*t^20+19061791647342486356714400000*t^19+705593937039936089475330000000*t^18+14966140358214161238778175520000*t^17+193312731215363516295842983680000*t^16+1588126521127294558253647964160000*t^15+8560829696851107798143961139200000*t^14+30950985756049703203067092684800000*t^13+76152817742685615910771752960000000*t^12+128573373297423908381148433612800000*t^11+149337400551313221224370647654400000*t^10+118944248416147713732633427968000000*t^9+64352984586434875296725760000000000*t^8+23255103121345343784210554880000000*t^7+5466338131409680923049107456000000*t^6+802984907071337618164432896000000*t^5+69335884454191673897779200000000*t^4+3189363305076239568076800000000*t^3+65534862433073415782400000000*t^2+403291461126605635584000000*t > #5466338131409680923049107456000000 > > #Attendence Q8: > #Conjecture an explicit formula for the average number of leaves of a labeled trees with n vertices. > average27:=sum(coeff(L,t,i), i=1..27)/27; average27 := 22528399544939174411840147874772641 > #What is the limit if you divide by n > #Prove the conjecture. > > evalb(average27=27^24); true > Conjecture: Average number of leaves of a labeled trees with n vertices is n^(n-3) > > >