#Please do not post homework #Ravali Bommanaboina, 12/6/20, Assignment 23 #Question 1 #{{1, 5}, {2, 6}, {2, 11}, {3, 10}, {4, 9}, {4, 13}, {5, 11}, {6, 7}, {6, 10}, {7, 13}, {8, 12}, {8, 14}, {11, 12}} #[5, 10, 11, 4, 13, 6, 7, 6, 2, 11, 12, 8] #Question 2 #[5, 10, 11, 2, 2, 4, 8, 11, 3, 9, 10, 13, 12, 13, 14] #{{1, 5}, {2, 4}, {2, 5}, {2, 10}, {3, 9}, {3, 11}, {4, 6}, {7, 8}, {8, 11}, {9, 10}, {10, 13}, {12, 13}, {13, 14}, {14, 15}}, [11, 12] #Question 3 #InvPruffer(Pruffer(T))=T #Question 4 RandTree1:=proc(n) local f: f:=RandF(n-2): InvPruffer(f): end: #time(RandTree(2000)); is faster than time(RandTree1(2000)); this is because Joyal(f) uses a direct mapping #add(seq(time(RandTree(2000)), i = 0 .. 20))/20; # 0.2964500000 #add(seq(time(RandTree1(2000)), i = 0 .. 20))/20; # 2.055050000 #Question 5 EstAveLeaves:=proc(n,K) local i: (add(seq(nops(Leaves(RandTree(n))),i=1..K)))/K; end: #3733/100 is close to 99/exp(1) #Question 6 R:=proc(e,b): b*(b+e)^(e-1); end: