#OK to post homework #Ariana Yousafzai, 11/22/2020, Assignment 21 1. 16530019558728142168379389104054542948954902506442870676877264555437768356978273337017649902196267779582098490170060 5. #EstProbKcomps(n,m,k,N): estimates the probability that a random graph with n vertices and m edges has exactly k components, by sampling N such random graphs. #by simulating N times. EstProbConn:=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))=1 then co:=co+1: fi: od: evalf(co/N): end: 6. #ProbKcomponents(n,m,k): uses the method of exponential generating functions to find the EXACT probability that a random graph with n vertices and m edges has k components. Note that ProbKcomponents(n,m,1) is EXACTLY the same as ProbConn(m,m,1) ProbConn:=proc(n,m,k) local a: evalf(coeff(WtEdConGclever(n,a)[n],a,m)/binomial(n*(n-1)/2,m)): end