1
$\begingroup$

Given that I have a sparse array as follows:

rules = {{1,1}->0.0001354,{1,2}->0.0113734,{1,3}->0.169139,{1,4}->0.474155,{1,5}->0.305935,{1,6}->0.038848,{1,7}->0.000414877,{2,1}->8.85706*10^-20,{2,2}->0.0000118265,{2,3}->0.00841274,{2,4}->0.159866,{2,5}->0.510518,{2,6}->0.288303,{2,7}->0.0326524,{2,8}->0.00023595,{3,3}->6.45788*10^-6,{3,4}->0.00754574,{3,5}->0.209808,{3,6}->0.478754,{3,7}->0.275556,{3,8}->0.0280589,{3,9}->0.00027075,{3,10}->1.22581*10^-7,{4,4}->5.99963*10^-6,{4,5}->0.0244445,{4,6}->0.208601,{4,7}->0.490681,{4,8}->0.248338,{4,9}->0.0272519,{4,10}->0.000677595,{4,11}->1.1492*10^-7,{5,5}->0.000635032,{5,6}->0.0222747,{5,7}->0.249298,{5,8}->0.481274,{5,9}->0.218373,{5,10}->0.0276628,{5,11}->0.000482838,{5,12}->6.9735*10^-8,{6,5}->6.94142*10^-8,{6,6}->0.000112641,{6,7}->0.0322871,{6,8}->0.290054,{6,9}->0.457369,{6,10}->0.199635,{6,11}->0.0202488,{6,12}->0.000293428,{7,7}->0.000538337,{7,8}->0.0508159,{7,9}->0.314926,{7,10}->0.451462,{7,11}->0.167853,{7,12}->0.0143938,{7,13}->0.0000113267,{7,14}->1.10057*10^-9,{8,7}->6.63081*10^-10,{8,8}->0.00176126,{8,9}->0.066139,{8,10}->0.344957,{8,11}->0.4268,{8,12}->0.153069,{8,13}->0.00715188,{8,14}->0.000121944,{9,8}->6.85947*10^-7,{9,9}->0.00262605,{9,10}->0.0782487,{9,11}->0.339711,{9,12}->0.451727,{9,13}->0.118128,{9,14}->0.00954219,{9,15}->0.000016974,{10,9}->1.24836*10^-6,{10,10}->0.00288168,{10,11}->0.0630752,{10,12}->0.392133,{10,13}->0.41256,{10,14}->0.124154,{10,15}->0.00519271,{10,16}->1.93928*10^-6,{11,10}->6.85525*10^-7,{11,11}->0.000689314,{11,12}->0.0779518,{11,13}->0.377602,{11,14}->0.430606,{11,15}->0.109437,{11,16}->0.00371092,{11,17}->2.17255*10^-6,{12,12}->0.00242551,{12,13}->0.0783233,{12,14}->0.372043,{12,15}->0.431912,{12,16}->0.110449,{12,17}->0.00484067,{12,18}->6.76561*10^-6,{12,19}->1.92575*10^-12,{13,12}->6.87183*10^-7,{13,13}->0.00234024,{13,14}->0.0668804,{13,15}->0.364946,{13,16}->0.431735,{13,17}->0.126748,{13,18}->0.00725419,{13,19}->0.0000955191,{14,13}->2.05264*10^-7,{14,14}->0.000889242,{14,15}->0.056723,{14,16}->0.342142,{14,17}->0.453631,{14,18}->0.135629,{14,19}->0.010981,{14,20}->4.48576*10^-6,{15,14}->6.23291*10^-16,{15,15}->0.000646623,{15,16}->0.0462819,{15,17}->0.346121,{15,18}->0.439241,{15,19}->0.16117,{15,20}->0.00652533,{15,21}->0.0000138382,{16,15}->4.50658*10^-14,{16,16}->0.000449214,{16,17}->0.0552244,{16,18}->0.305214,{16,19}->0.482426,{16,20}->0.147081,{16,21}->0.00951212,{16,22}->0.0000924036,{17,17}->0.0014072,{17,18}->0.0420951,{17,19}->0.33289,{17,20}->0.454709,{17,21}->0.15487,{17,22}->0.0139432,{17,23}->0.0000861594,{17,24}->4.05305*10^-20,{18,17}->1.56867*10^-7,{18,18}->0.000361428,{18,19}->0.0508995,{18,20}->0.329434,{18,21}->0.433367,{18,22}->0.172239,{18,23}->0.0136039,{18,24}->0.0000939626,{19,19}->0.00109336,{19,20}->0.0577525,{19,21}->0.299147,{19,22}->0.455354,{19,23}->0.173279,{19,24}->0.0133586,{19,25}->0.0000159857,{19,26}->6.47792*10^-12,{20,19}->4.07463*10^-8,{20,20}->0.00163113,{20,21}->0.0444958,{20,22}->0.299655,{20,23}->0.46112,{20,24}->0.181835,{20,25}->0.0111073,{20,26}->0.000156037,{21,20}->2.40804*10^-7,{21,21}->0.000418509,{21,22}->0.0366001,{21,23}->0.281782,{21,24}->0.48929,{21,25}->0.175665,{21,26}->0.016222,{21,27}->0.0000216431,{22,22}->0.00024884,{22,23}->0.0263061,{22,24}->0.281879,{22,25}->0.474257,{22,26}->0.205562,{22,27}->0.0117268,{22,28}->0.0000200008,{22,29}->2.75213*10^-12,{23,23}->0.0000867653,{23,24}->0.0278823,{23,25}->0.25452,{23,26}->0.500202,{23,27}->0.201568,{23,28}->0.0155019,{23,29}->0.000238676,{23,30}->5.13622*10^-12,{24,24}->0.000239394,{24,25}->0.0246228,{24,26}->0.257902,{24,27}->0.482805,{24,28}->0.210417,{24,29}->0.0237502,{24,30}->0.000263818,{24,31}->3.54186*10^-9,{25,25}->0.000147309,{25,26}->0.0262075,{25,27}->0.25868,{25,28}->0.470213,{25,29}->0.220116,{25,30}->0.0242786,{25,31}->0.000357521,{25,32}->2.12852*10^-19,{26,26}->0.000222883,{26,27}->0.030908,{26,28}->0.269939,{26,29}->0.454641,{26,30}->0.22058,{26,31}->0.023548,{26,32}->0.000160986,{26,33}->2.3828*10^-11,{27,27}->0.000448276,{27,28}->0.0405234,{27,29}->0.254876,{27,30}->0.47016,{27,31}->0.213666,{27,32}->0.02011,{27,33}->0.00021564,{27,34}->2.17904*10^-17,{28,27}->3.3338*10^-10,{28,28}->0.00103849,{28,29}->0.0319394,{28,30}->0.273935,{28,31}->0.461697,{28,32}->0.211198,{28,33}->0.020056,{28,34}->0.000136593,{29,28}->1.26627*10^-7,{29,29}->0.00021172,{29,30}->0.0343771,{29,31}->0.249774,{29,32}->0.486505,{29,33}->0.211164,{29,34}->0.0179052,{29,35}->0.0000624299,{30,30}->0.000431145,{30,31}->0.0213435,{30,32}->0.259173,{30,33}->0.481937,{30,34}->0.221172,{30,35}->0.0159151,{30,36}->0.0000285244,{30,37}->4.09543*10^-10,{31,30}->2.87589*10^-11,{31,31}->0.0000283186,{31,32}->0.0244371,{31,33}->0.227977,{31,34}->0.503626,{31,35}->0.225129,{31,36}->0.0184217,{31,37}->0.000381493,{32,32}->0.000212299,{32,33}->0.0163039,{32,34}->0.232559,{32,35}->0.487516,{32,36}->0.23227,{32,37}->0.0309308,{32,38}->0.000207267,{32,39}->1.40917*10^-7,{33,33}->0.0000196554,{33,34}->0.0193536,{33,35}->0.222078,{33,36}->0.458535,{33,37}->0.270041,{33,38}->0.0291452,{33,39}->0.000826832,{33,40}->3.21056*10^-22,{34,34}->0.000129559,{34,35}->0.019728,{34,36}->0.199971,{34,37}->0.488263,{34,38}->0.254537,{34,39}->0.0370918,{34,40}->0.000280021,{34,41}->1.23951*10^-7,{35,35}->0.000115816,{35,36}->0.0154852,{35,37}->0.219191,{35,38}->0.462772,{35,39}->0.272703,{35,40}->0.028984,{35,41}->0.000748581,{35,42}->1.7132*10^-12,{36,36}->0.0000415495,{36,37}->0.0208831,{36,38}->0.211523,{36,39}->0.488709,{36,40}->0.24471,{36,41}->0.0338839,{36,42}->0.000249293,{36,43}->4.0634*10^-11,{37,37}->0.00020727,{37,38}->0.0201854,{37,39}->0.232709,{37,40}->0.459156,{37,41}->0.262077,{37,42}->0.0253479,{37,43}->0.000316325,{37,44}->8.40108*10^-9,{38,37}->3.33722*10^-15,{38,38}->0.000120817,{38,39}->0.0245421,{38,40}->0.218301,{38,41}->0.496957,{38,42}->0.232781,{38,43}->0.0269078,{38,44}->0.000390256,{39,39}->0.000246755,{39,40}->0.0195994,{39,41}->0.249391,{39,42}->0.465362,{39,43}->0.240895,{39,44}->0.0243795,{39,45}->0.000126269,{39,46}->3.35178*10^-11,{40,39}->1.24403*10^-15,{40,40}->0.0000659806,{40,41}->0.0277284,{40,42}->0.229367,{40,43}->0.500724,{40,44}->0.223575,{40,45}->0.0183474,{40,46}->0.000192927,{41,41}->0.000386257,{41,42}->0.0214566,{41,43}->0.277088,{41,44}->0.48341,{41,45}->0.199365,{41,46}->0.0181781,{41,47}->0.00011596,{41,48}->2.70443*10^-9,{42,41}->1.3415*10^-10,{42,42}->0.0000700976,{42,43}->0.0400931,{42,44}->0.291101,{42,45}->0.467298,{42,46}->0.185508,{42,47}->0.0157011,{42,48}->0.000229051,{43,43}->0.00125449,{43,44}->0.0483693,{43,45}->0.318356,{43,46}->0.447259,{43,47}->0.168912,{43,48}->0.0157974,{43,49}->0.0000526636,{43,50}->2.97359*10^-9,{44,43}->5.27703*10^-7,{44,44}->0.00121077,{44,45}->0.0630348,{44,46}->0.325384,{44,47}->0.43619,{44,48}->0.163406,{44,49}->0.0106087,{44,50}->0.000165471,{45,44}->3.21929*10^-8,{45,45}->0.00228536,{45,46}->0.0630826,{45,47}->0.336302,{45,48}->0.450288,{45,49}->0.136867,{45,50}->0.0111722,{45,51}->2.7332*10^-6,{46,45}->1.19932*10^-6,{46,46}->0.00148347,{46,47}->0.062066,{46,48}->0.362395,{46,49}->0.42697,{46,50}->0.141629,{46,51}->0.00543462,{46,52}->0.0000213618,{47,46}->9.36806*10^-9,{47,47}->0.00119661,{47,48}->0.066509,{47,49}->0.340353,{47,50}->0.444431,{47,51}->0.13658,{47,52}->0.0109207,{47,53}->8.89858*10^-6,{48,47}->3.94711*10^-9,{48,48}->0.00151711,{48,49}->0.0517892,{48,50}->0.28364,{48,51}->0.42492,{48,52}->0.217086,{48,53}->0.0207835,{48,54}->0.000263883,{49,48}->3.86886*10^-8,{49,49}->0.000461597,{49,50}->0.0165712,{49,51}->0.134303,{49,52}->0.402599,{49,53}->0.35393,{49,54}->0.0902543,{49,55}->0.00188057,{50,50}->5.95068*10^-9,{50,51}->0.0000125862,{50,52}->0.00331702,{50,53}->0.071222,{50,54}->0.390177,{50,55}->0.477056,{50,56}->0.0582147,{50,57}->1.14336*10^-6,{51,51}->2.24788*10^-8,{51,52}->0.000288804,{51,53}->0.0174417,{51,54}->0.215289,{51,55}->0.567321,{51,56}->0.198188,{51,57}->0.00147114,{51,58}->1.23843*10^-10,{52,52}->5.48961*10^-6,{52,53}->0.00166649,{52,54}->0.0628125,{52,55}->0.429338,{52,56}->0.461262,{52,57}->0.0445038,{52,58}->0.000411328,{52,59}->2.32175*10^-8,{53,52}->2.38586*10^-10,{53,53}->0.0000225962,{53,54}->0.00597929,{53,55}->0.14521,{53,56}->0.539043,{53,57}->0.27989,{53,58}->0.0294039,{53,59}->0.000450336,{54,53}->1.02005*10^-11,{54,54}->0.0000541286,{54,55}->0.0115583,{54,56}->0.218994,{54,57}->0.500682,{54,58}->0.245638,{54,59}->0.0230595,{54,60}->0.0000135475,{55,54}->5.54428*10^-18,{55,55}->0.0000363557,{55,56}->0.018121,{55,57}->0.237386,{55,58}->0.516525,{55,59}->0.221014,{55,60}->0.00689377,{55,61}->0.0000230097,{56,56}->0.000111181,{56,57}->0.0245959,{56,58}->0.301097,{56,59}->0.563015,{56,60}->0.106383,{56,61}->0.0047794,{56,62}->0.0000186999,{56,63}->9.94068*10^-11,{57,57}->0.000317399,{57,58}->0.0579027,{57,59}->0.540469,{57,60}->0.338837,{57,61}->0.0602366,{57,62}->0.00222716,{57,63}->0.0000101323,{57,64}->4.10615*10^-15,{58,57}->1.9811*10^-10,{58,58}->0.00391624,{58,59}->0.297961,{58,60}->0.459477,{58,61}->0.212393,{58,62}->0.0256288,{58,63}->0.00062366,{58,64}->7.35539*10^-7,{59,59}->0.00662101,{59,60}->0.0764368,{59,61}->0.337938,{59,62}->0.426143,{59,63}->0.139118,{59,64}->0.0134087,{59,65}->0.000334664,{59,66}->1.72174*10^-7,{60,59}->9.797*10^-7,{60,60}->0.000215064,{60,61}->0.0263349,{60,62}->0.284353,{60,63}->0.446772,{60,64}->0.207347,{60,65}->0.0339971,{60,66}->0.000979665,{61,61}->0.0000307457,{61,62}->0.031984,{61,63}->0.244242,{61,64}->0.417491,{61,65}->0.266954,{61,66}->0.0392376,{61,67}->0.0000612339,{61,68}->1.19111*10^-7,{62,62}->0.000744567,{62,63}->0.0340258,{62,64}->0.193099,{62,65}->0.459109,{62,66}->0.286479,{62,67}->0.0255045,{62,68}->0.00103763,{62,69}->8.53107*10^-8,{63,62}->1.68329*10^-7,{63,63}->0.000821858,{63,64}->0.017633,{63,65}->0.204358,{63,66}->0.499702,{63,67}->0.237325,{63,68}->0.039497,{63,69}->0.000663016,{64,63}->9.37549*10^-8,{64,64}->0.0000237011,{64,65}->0.0161379,{64,66}->0.232223,{64,67}->0.459246,{64,68}->0.264286,{64,69}->0.0280696,{64,70}->0.0000132161,{65,65}->0.0000794578,{65,66}->0.0239632,{65,67}->0.226148,{65,68}->0.492175,{65,69}->0.242471,{65,70}->0.0150811,{65,71}->0.0000819443,{65,72}->5.42547*10^-7,{66,66}->0.000376557,{66,67}->0.027608,{66,68}->0.253149,{66,69}->0.477067,{66,70}->0.217315,{66,71}->0.0233429,{66,72}->0.00114119,{66,73}->1.99529*10^-11,{67,66}->4.79949*10^-9,{67,67}->0.000476108,{67,68}->0.0342084,{67,69}->0.23955,{67,70}->0.472272,{67,71}->0.216377,{67,72}->0.0368645,{67,73}->0.00025156,{68,67}->6.48126*10^-9,{68,68}->0.000660836,{68,69}->0.0230824,{68,70}->0.261233,{68,71}->0.438652,{68,72}->0.255221,{68,73}->0.0211066,{68,74}->0.0000433955,{69,68}->2.11147*10^-8,{69,69}->0.0000520657,{69,70}->0.0334837,{69,71}->0.228376,{69,72}->0.50339,{69,73}->0.219495,{69,74}->0.0151492,{69,75}->0.0000534077,{70,70}->0.000869712,{70,71}->0.0250372,{70,72}->0.260476,{70,73}->0.482153,{70,74}->0.212582,{70,75}->0.0187943,{70,76}->0.0000882619,{70,77}->7.36514*10^-8,{71,70}->3.44979*10^-7,{71,71}->0.00016921,{71,72}->0.0296402,{71,73}->0.243151,{71,74}->0.467297,{71,75}->0.23378,{71,76}->0.025153,{71,77}->0.000809524,{72,72}->0.000375963,{72,73}->0.0217798,{72,74}->0.212865,{72,75}->0.474738,{72,76}->0.25409,{72,77}->0.0361325,{72,78}->0.000018157,{72,79}->5.06059*10^-10,{73,72}->3.86967*10^-10,{73,73}->0.0000711538,{73,74}->0.0131552,{73,75}->0.187983,{73,76}->0.475838,{73,77}->0.299504,{73,78}->0.0228263,{73,79}->0.000621522,{74,74}->0.0000141925,{74,75}->0.00975481,{74,76}->0.171858,{74,77}->0.499246,{74,78}->0.274513,{74,79}->0.0443411,{74,80}->0.000273152,{74,81}->1.48929*10^-8,{75,75}->0.0000137827,{75,76}->0.0103025,{75,77}->0.167349,{75,78}->0.443399,{75,79}->0.331159,{75,80}->0.0463849,{75,81}->0.00139192,{75,82}->2.66009*10^-7,{76,76}->0.0000361946,{76,77}->0.00970463,{76,78}->0.143468,{76,79}->0.448263,{76,80}->0.331474,{76,81}->0.0653018,{76,82}->0.00175223,{76,83}->1.06315*10^-7,{77,77}->0.0000208411,{77,78}->0.00748855,{77,79}->0.130953,{77,80}->0.435879,{77,81}->0.361942,{77,82}->0.0624105,{77,83}->0.0013058,{77,84}->1.89859*10^-9,{78,78}->0.0000108611,{78,79}->0.00541102,{78,80}->0.127989,{78,81}->0.470624,{78,82}->0.341161,{78,83}->0.0539546,{78,84}->0.000849417,{78,85}->3.14894*10^-8,{79,79}->2.82637*10^-6,{79,80}->0.00676104,{79,81}->0.166869,{79,82}->0.461191,{79,83}->0.31548,{79,84}->0.0485415,{79,85}->0.00115508,{79,86}->1.01654*10^-7,{80,80}->0.0000200673,{80,81}->0.017839,{80,82}->0.18731,{80,83}->0.447691,{80,84}->0.295014,{80,85}->0.050836,{80,86}->0.00128947,{80,87}->4.45208*10^-7,{81,81}->0.000459817,{81,82}->0.0232139,{81,83}->0.194406,{81,84}->0.439408,{81,85}->0.293124,{81,86}->0.0482887,{81,87}->0.00110055,{81,88}->1.7499*10^-9,{82,81}->1.71746*10^-7,{82,82}->0.000425655,{82,83}->0.0210634,{82,84}->0.192802,{82,85}->0.457962,{82,86}->0.291228,{82,87}->0.0362278,{82,88}->0.000290899,{83,82}->3.66805*10^-9,{83,83}->0.000138785,{83,84}->0.0155907,{83,85}->0.19624,{83,86}->0.518067,{83,87}->0.251738,{83,88}->0.0182206,{83,89}->4.09839*10^-6,{84,84}->0.0000396235,{84,85}->0.0137057,{84,86}->0.265302,{84,87}->0.523119,{84,88}->0.190792,{84,89}->0.00701742,{84,90}->0.0000252815,{84,91}->1.90064*10^-12,{85,85}->0.0000452045,{85,86}->0.0420862,{85,87}->0.340396,{85,88}->0.483974,{85,89}->0.12624,{85,90}->0.00720096,{85,91}->0.0000575913,{85,92}->6.18678*10^-10,{86,86}->0.00246045,{86,87}->0.0902559,{86,88}->0.4267,{86,89}->0.389355,{86,90}->0.0865786,{86,91}->0.00461589,{86,92}->0.0000341599,{86,93}->1.91138*10^-11,{87,86}->0.0000210077,{87,87}->0.0101486,{87,88}->0.18033,{87,89}->0.47863,{87,90}->0.283556,{87,91}->0.0454642,{87,92}->0.00184595,{87,93}->4.91954*10^-6,{88,87}->4.22729*10^-13,{88,88}->0.00091784,{88,89}->0.0759511,{88,90}->0.37424,{88,91}->0.395445,{88,92}->0.142325,{88,93}->0.0110977,{88,94}->0.0000234435,{89,89}->0.000904501,{89,90}->0.0536729,{89,91}->0.259599,{89,92}->0.459574,{89,93}->0.207615,{89,94}->0.0183655,{89,95}->0.000269016,{89,96}->1.70409*10^-10,{90,89}->1.41513*10^-9,{90,90}->0.00114275,{90,91}->0.0256265,{90,92}->0.248892,{90,93}->0.4712,{90,94}->0.223398,{90,95}->0.0293038,{90,96}->0.000437434,{91,90}->1.59854*10^-7,{91,91}->0.0000744415,{91,92}->0.0264928,{91,93}->0.241517,{91,94}->0.450713,{91,95}->0.250842,{91,96}->0.0302626,{91,97}->0.0000981231,{92,92}->0.000393473,{92,93}->0.0282819,{92,94}->0.216179,{92,95}->0.466725,{92,96}->0.266629,{92,97}->0.0217439,{92,98}->0.0000485931,{92,99}->5.52704*10^-8,{93,92}->6.63264*10^-9,{93,93}->0.000451026,{93,94}->0.0209169,{93,95}->0.204014,{93,96}->0.502811,{93,97}->0.24832,{93,98}->0.0226393,{93,99}->0.000848163,{94,93}->5.25933*10^-9,{94,94}->0.0000969301,{94,95}->0.0137649,{94,96}->0.218891,{94,97}->0.496004,{94,98}->0.234245,{94,99}->0.0369363,{94,100}->0.0000620843,{95,95}->0.0000203953,{95,96}->0.0176808,{95,97}->0.226982,{95,98}->0.443289,{95,99}->0.290006,{95,100}->0.021916,{95,101}->0.00010612,{95,102}->8.99443*10^-10,{96,96}->0.000165343,{96,97}->0.0250641,{96,98}->0.186011,{96,99}->0.504891,{96,100}->0.255456,{96,101}->0.027711,{96,102}->0.000701287,{96,103}->6.6471*10^-8,{97,96}->3.68284*10^-12,{97,97}->0.000466688,{97,98}->0.0147329,{97,99}->0.217911,{97,100}->0.480719,{97,101}->0.245108,{97,102}->0.0401872,{97,103}->0.000875807,{98,97}->2.51131*10^-8,{98,98}->0.0000226626,{98,99}->0.0200697,{98,100}->0.232834,{98,101}->0.432265,{98,102}->0.276677,{98,103}->0.0379752,{98,104}->0.000156501,{99,99}->0.000233394,{99,100}->0.0297221,{99,101}->0.19171,{99,102}->0.467338,{99,103}->0.286103,{99,104}->0.0248001,{99,105}->0.0000927145,{99,106}->2.26718*10^-7,{100,99}->1.59917*10^-10,{100,100}->0.000750888,{100,101}->0.0166592,{100,102}->0.194734,{100,103}->0.507594,{100,104}->0.253569,{100,105}->0.0257148,{100,106}->0.00097764,{101,100}->2.17823*10^-7,{101,101}->0.0000284204,{101,102}->0.0126255,{101,103}->0.220397,{101,104}->0.485739,{101,105}->0.244511,{101,106}->0.0365973,{101,107}->0.000101263,{102,102}->0.0000235359,{102,103}->0.0198096,{102,104}->0.218487,{102,105}->0.465904,{102,106}->0.274011,{102,107}->0.0217002,{102,108}->0.0000642598,{102,109}->6.42837*10^-7,{103,103}->0.000256104,{103,104}->0.0227801,{103,105}->0.221332,{103,106}->0.491768,{103,107}->0.238265,{103,108}->0.0242354,{103,109}->0.00136326,{103,110}->2.11458*10^-8,{104,103}->4.88425*10^-10,{104,104}->0.000267797,{104,105}->0.0260515,{104,106}->0.241418,{104,107}->0.468647,{104,108}->0.220793,{104,109}->0.0422863,{104,110}->0.000536224,{105,104}->3.10193*10^-11,{105,105}->0.000396308,{105,106}->0.0283405,{105,107}->0.24898,{105,108}->0.426436,{105,109}->0.268957,{105,110}->0.0268223,{105,111}->0.0000669357,{106,105}->2.02361*10^-9,{106,106}->0.000335022,{106,107}->0.031376,{106,108}->0.215805,{106,109}->0.504407,{106,110}->0.231821,{106,111}->0.0161617,{106,112}->0.0000947594,{107,106}->1.95908*10^-11,{107,107}->0.000496902,{107,108}->0.0204409,{107,109}->0.263055,{107,110}->0.494712,{107,111}->0.203814,{107,112}->0.0174184,{107,113}->0.0000633418,{108,107}->3.65069*10^-9,{108,108}->0.0000614481,{108,109}->0.0314759,{108,110}->0.265889,{108,111}->0.473092,{108,112}->0.211557,{108,113}->0.0178049,{108,114}->0.000118863,{109,109}->0.000664837,{109,110}->0.032354,{109,111}->0.25527,{109,112}->0.468853,{109,113}->0.222086,{109,114}->0.0206844,{109,115}->0.0000880377,{109,116}->1.20995*10^-8,{110,109}->7.68667*10^-8,{110,110}->0.000401825,{110,111}->0.028726,{110,112}->0.236089,{110,113}->0.484626,{110,114}->0.228754,{110,115}->0.020881,{110,116}->0.00052094,{111,110}->9.87166*10^-12,{111,111}->0.000239868,{111,112}->0.0198028,{111,113}->0.244746,{111,114}->0.4901,{111,115}->0.216948,{111,116}->0.0281391,{111,117}->0.0000242024,{112,111}->5.71342*10^-22,{112,112}->0.0000521303,{112,113}->0.0245508,{112,114}->0.253464,{112,115}->0.448251,{112,116}->0.25619,{112,117}->0.01731,{112,118}->0.00018221,{113,113}->0.000334994,{113,114}->0.0318895,{113,115}->0.209718,{113,116}->0.499629,{113,117}->0.230048,{113,118}->0.0280435,{113,119}->0.00033773,{113,120}->1.28297*10^-8,{114,113}->1.22841*10^-9,{114,114}->0.000658857,{114,115}->0.0179341,{114,116}->0.228574,{114,117}->0.458931,{114,118}->0.25923,{114,119}->0.0339664,{114,120}->0.000705973,{115,114}->4.83859*10^-8,{115,115}->0.0000248997,{115,116}->0.0190227,{115,117}->0.199472,{115,118}->0.463639,{115,119}->0.279514,{115,120}->0.0382248,{115,121}->0.00010194,{116,116}->0.000130959,{116,117}->0.0144881,{116,118}->0.174221,{116,119}->0.468621,{116,120}->0.315377,{116,121}->0.0270288,{116,122}->0.000132025,{116,123}->5.61323*10^-7,{117,117}->0.0000446307,{117,118}->0.00914981,{117,119}->0.153827,{117,120}->0.516206,{117,121}->0.284499,{117,122}->0.0346483,{117,123}->0.0016251,{117,124}->2.27895*10^-17,{118,118}->7.65668*10^-6,{118,119}->0.00650197,{118,120}->0.188365,{118,121}->0.467683,{118,122}->0.282791,{118,123}->0.0541579,{118,124}->0.000493159,{118,125}->7.03573*10^-9,{119,119}->4.68805*10^-6,{119,120}->0.017885,{119,121}->0.186717,{119,122}->0.436332,{119,123}->0.313388,{119,124}->0.0446314,{119,125}->0.00104142,{119,126}->3.27042*10^-7,{120,120}->0.000401239,{120,121}->0.0209281,{120,122}->0.188463,{120,123}->0.442697,{120,124}->0.29737,{120,125}->0.0487004,{120,126}->0.00144008,{120,127}->2.61563*10^-7,{121,120}->9.81993*10^-8,{121,121}->0.000327396,{121,122}->0.0220617,{121,123}->0.180494,{121,124}->0.465646,{121,125}->0.284419,{121,126}->0.0460717,{121,127}->0.000980368,{122,121}->1.25151*10^-9,{122,122}->0.000307297,{122,123}->0.0135339,{122,124}->0.211355,{122,125}->0.463606,{122,126}->0.276438,{122,127}->0.0347471,{122,128}->0.000013207,{123,122}->8.59638*10^-10,{123,123}->0.0000126942,{123,124}->0.0226372,{123,125}->0.211927,{123,126}->0.475252,{123,127}->0.274743,{123,128}->0.015323,{123,129}->0.000105233,{124,124}->0.000512176,{124,125}->0.0232912,{124,126}->0.205153,{124,127}->0.517089,{124,128}->0.227996,{124,129}->0.025728,{124,130}->0.000229946,{124,131}->4.76573*10^-7,{125,124}->1.5774*10^-7,{125,125}->0.000278466,{125,126}->0.0165437,{125,127}->0.235037,{125,128}->0.459902,{125,129}->0.253343,{125,130}->0.0335073,{125,131}->0.00138854,{126,125}->9.52458*10^-12,{126,126}->0.0000319417,{126,127}->0.022121,{126,128}->0.208312,{126,129}->0.455104,{126,130}->0.269056,{126,131}->0.045356,{126,132}->0.0000197011,{127,127}->0.000303524,{127,128}->0.0191684,{127,129}->0.182807,{127,130}->0.450297,{127,131}->0.321965,{127,132}->0.0250515,{127,133}->0.000406768,{127,134}->7.62797*10^-8,{128,127}->3.85514*10^-9,{128,128}->0.000143493,{128,129}->0.0121133,{128,130}->0.15862,{128,131}->0.493096,{128,132}->0.287907,{128,133}->0.0467532,{128,134}->0.00136706,{129,129}->0.0000175096,{129,130}->0.00710939,{129,131}->0.147638,{129,132}->0.44992,{129,133}->0.337754,{129,134}->0.0573912,{129,135}->0.0001703,{129,136}->1.27116*10^-23,{130,1}->2.20128*10^-7,{130,130}->4.84648*10^-6,{130,131}->0.00536602,{130,132}->0.124892,{130,133}->0.450227,{130,134}->0.37226,{130,135}->0.0463264,{130,136}->0.000924177,{131,1}->0.00253884,{131,2}->7.16384*10^-7,{131,131}->3.09954*10^-6,{131,132}->0.00544319,{131,133}->0.124716,{131,134}->0.449881,{131,135}->0.348126,{131,136}->0.0692913,{132,1}->0.0809861,{132,2}->0.00259667,{132,3}->6.80117*10^-7,{132,132}->0.0000108335,{132,133}->0.00717306,{132,134}->0.124462,{132,135}->0.419792,{132,136}->0.364978,{133,1}->0.367603,{133,2}->0.0723702,{133,3}->0.00204253,{133,4}->2.11626*10^-8,{133,133}->0.000033611,{133,134}->0.00656417,{133,135}->0.12417,{133,136}->0.427216,{134,1}->0.448693,{134,2}->0.342727,{134,3}->0.0611316,{134,4}->0.000993948,{134,5}->1.77474*10^-11,{134,134}->0.0000112362,{134,135}->0.00744006,{134,136}->0.139003,{135,1}->0.163278,{135,2}->0.448182,{135,3}->0.329535,{135,4}->0.0476089,{135,5}->0.000572427,{135,6}->3.80246*10^-8,{135,135}->0.0000289873,{135,136}->0.0107943,{136,1}->0.0150005,{136,2}->0.165915,{136,3}->0.46693,{136,4}->0.309578,{136,5}->0.0416884,{136,6}->0.000801721,{136,7}->3.71961*10^-10,{136,136}->0.0000865703,{_,_}->0}

sparseMat = SparseArray[rules]

then I discovered that

lf1 = LinearSolve[sparseMat]
(* 
  LinearSolve::luc: Result for LinearSolve of badly conditioned matrix
  SparseArray[Automatic,<<3>>] may contain significant numerical errors.
*)
lf2 = LinearSolve[sparseMat, Method -> "Banded"]

lf1["ConditionNumber"]
lf2["ConditionNumber"]
(*
  1.26933*10^11
  Missing["NotAvailable"]
*)

the results of lf1 and lf2 are totally different in Mathematica 12.

In additon, I also notice that the function LinearAlgebra`MatrixConditionalNumber[] has been removed since Mathematica 11.

Lastly, as a workaround, I use LUDecomposition[] to calculate the corresponding condtion number of matrix, it gives 456.672, which means this matrix is not ill-condioned. So I would like to why? Could someone give me an explanation?

LUDecomposition[sparseMat] // Last
(* 456.672 *)
$\endgroup$
  • 1
    $\begingroup$ Banded methods are specialized on a smaller set of possible matrices and thus can have a higher chance to be stable for such matrices. Indeed, from what I tried, lf2 should be prefered over lf1 in this case. The multifrontal method (the default solver for sparse arrays) is just not suited for your matrix. Also the property "ConditionNumber" is quite misleading. It is at best an estimator for the condition number and is meant to predict when lf1 does not work. And this prediction was correct (which one obeserves when one tries to solve actual equations with lf1). $\endgroup$ – Henrik Schumacher Jan 8 at 15:08
  • $\begingroup$ @HenrikSchumacher Thanks. I notice that lf2 gives the correct result if I use it like lf2[array]. In additon, I need to the condition number in my application, so I would like to know is there a replacement of LinearAlgebra`MatrixConditionalNumber[]. $\endgroup$ – Lavender Jan 8 at 15:17
  • 2
    $\begingroup$ Maybe find the largest and smallest singular values? The l_2 condition number is the ratio of those two. $\endgroup$ – Daniel Lichtblau Jan 8 at 15:36
  • 2
    $\begingroup$ You can try using LinearAlgebra`Private`MatrixConditionNumber instead. $\endgroup$ – Carl Woll Jan 8 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.