#OK to post homework #Karnaa Mistry, 11/22/20, Assignment HW #21 with(combinat): # 1. # coeff(WtEdConGclever(50,a)[50],a,70) = 557570125262936299552095051452832858951958306952392379552719516748979534894703561052813706583449695070191616000000 # 2. # I tried doing seq(coeff(taylor((log(add((1+a)^binomial(i,2)*x^i/i!,i=0..50+1)))^k/k!,x=0,50+1),x,70)*70!,k=2..5) # I used this because I wanted to combine the weight enumerator expression for edges a^m with the taylor expansion in # the procedure NuKcomp, which involved having the ^k/k! to find the number of components. However, when I evaluated # this, I got 0 all four times, so I am unsure as to what might have went wrong in my combination of the two # procedures' functions. # Alternatively, using my proc WtEdConGClever2 in part 6), which uses the given weight-enumerator in Question 6, I was able to nonzero answers like # coeff(WtEdConGclever2(50,k,a)[50],a,70), such as k=2 ==> 2267762282072205271778791270680596849921516338574571823883456519281730035101965414722739023408444177334403072000000 # So I would need to find this weight enumerator using taylor methods if I was to derive it manually without the given in #6 # 3. # FindCutOff(30,1.05) gives 84. And my EsimateCutOff(30,j) for 'large' j (1000 was taking very long) also ends up in the 80s, ex. EstimateCutOff(30,100) gave # values within +4/-4 of 84 (like 80,83) on more than one run # 4. # seq(evalf(FindCutOff(10*i,1.05)/(10*i)),i=2..6) = 2.450000000, 2.800000000, 3., 3.160000000, 3.300000000 # I couldn't find a specific pattern from this sequence, I first thought that maybe it has to do with the change from +0.35, to +0.2, +0.16, +0.15, # but this doesn't resemble a specific pattern, either. # 5. EstProbKcomps:=proc(n,m,k,N) local i,co, G: co:=0: for i from 1 to N do G:=RandGr(n,m): if nops(CCs(G))=k then co:=co+1: fi: od: evalf(co/N): end: # 6. ProbKcomponents:=proc(n,m,k) local a: evalf(coeff(WtEdConGclever2(n,k,a)[n],a,m)/binomial(n*(n-1)/2,m)): end: WtEdConGclever2:=proc(N,k,a) local f,i,x: option remember: f:=(log(Sum((1+a)^(n*(n-1)/2)*x^n/n!,n=0..infinity)))^k/k!: f:=taylor(f,x=0,N+1): [seq(expand(coeff(f,x,i)*i!),i=1..N)]: end: # ProbKcomponents(40,50,2) gave me 0.9801230118e-1 or 0.098123... # EstProbKcomps(40,50,2,300) gave me .1066666667; this is quite close, only off by less than 1 hundredth