#OK to post homework #Nick Belov, March 30th 2025, Assignment 19 read "C19.txt": EstimateAverageMinCost:= proc(n,p,K,N) local sm,i,res,cc: sm:=0: cc:=0: for i from 1 to N do res:=MST(RWG(n,p,K)): if res <> FAIL then cc:=cc+1: sm:=sm+res[2]: fi: od: if cc = 0 then sm := 0: cc := 1: fi: return [evalf(cc/N),evalf(sm/cc)]: end: EstimateTable := proc(n,N,a,b) local L, i, K, res, tmp: L := []: for i from 1 to a do tmp := []: for K from 1 to b do res := EstimateAverageMinCost(n, i/a, K, N): tmp := [op(tmp), op(2, res)]: end do: L := [op(L), tmp]: end do: return L: end: #output when big N=100, again it wouldnt finish in time #[[9., 12.30000000, 17.33333333, 19., 23.12500000, 27.47619048, 30.88235294, 37.30434783, 36.38888889, 37.96000000], [9., 10.75555556, 13.01086957, 16.03296703, 17.88297872, 20.84615385, 23.22222222, 26.82795699, 28.16666667, 31.90217391], [9., 9.420000000, 10.97000000, 12.16000000, 14.27272727, 16.92000000, 18.09090909, 19.62000000, 21.26000000, 23.21000000], [9., 9.080000000, 9.750000000, 10.77000000, 11.85000000, 13.64000000, 15.01000000, 15.35000000, 17.53000000, 19.43000000], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]]