fork(3) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <cassert>
  4. #include <cmath>
  5. #include <numeric>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8.  
  9. using namespace std;
  10. #define SZ(a) ((int)((a).size()))
  11.  
  12. // 注:データの次元D=2のときしか対応していません!
  13. typedef vector <double> Vec;
  14. typedef vector <Vec> Mtx;
  15.  
  16. class EMGaussianMixtures
  17. {
  18. private:
  19. int N; // データ個数
  20. int D; // データの次元
  21. int K; // クラスの種類数
  22. Mtx m_xx; // x:正規化したデータ m_xx[N][D]
  23. Mtx m_mu; // μ:平均 m_mu[K][D]
  24. Vec m_mix; // π:混合率 m_mix[K]
  25. vector < Mtx > m_sig; // Σ:共分散 m_sig[K][D][D]
  26. Mtx m_gamma_nk; // γ:負担率 m_gamma_nk[N][K]
  27.  
  28. public:
  29.  
  30. // 初期化
  31. // データセット dataFrame[N][D]
  32. // クラスの種類数 numClasses -> K
  33. void initialize(const Mtx& dataFrame, int numClasses)
  34. {
  35. N = SZ(dataFrame);
  36. D = SZ(dataFrame[0]);
  37. K = numClasses;
  38. assert(N>=1);
  39. assert(D==2);
  40. assert(K>=1);
  41.  
  42. // データの正規化
  43. m_xx = dataFrame;
  44. normalize(m_xx);
  45.  
  46. // 平均、共分散、混合率の初期値(正規乱数)
  47. m_mu = Mtx(K, Vec(D));
  48.  
  49. for(int row=0;row<K;++row)
  50. {
  51. for(int col=0;col<D;++col)
  52. {
  53. m_mu[row][col]= getNormRand(); // たぶん、必須ではないけど、元のコードに合わせました。
  54. }
  55. }
  56.  
  57. m_mix = Vec(K, 1.0/K);
  58.  
  59. m_sig = vector < Mtx >(K, Mtx(D, Vec(D)));
  60. for (int k = 0; k < K; ++k)
  61. {
  62. for (int rc=0; rc<D; ++rc)
  63. {
  64. m_sig[k][rc][rc]=1.0;
  65. }
  66. }
  67. }
  68.  
  69. // E stepとM stepを1回ずつ実行
  70. void run()
  71. {
  72. m_gamma_nk = calcEstep(m_xx, m_mu, m_mix, m_sig);
  73.  
  74. Mtx new_mu;
  75. Vec new_mix;
  76. vector < Mtx > new_sig;
  77.  
  78. calcMstep(new_mu, new_mix, new_sig, m_xx, m_gamma_nk);
  79.  
  80. m_mu = new_mu;
  81. m_mix = new_mix;
  82. m_sig = new_sig;
  83. }
  84.  
  85. void printGammaNK() const
  86. {
  87. for(int n=0;n<N;n++)
  88. {
  89. for(int k=0;k<K;k++)
  90. {
  91. printf("%.10f",m_gamma_nk[n][k]);
  92. if(k<K-1)
  93. {
  94. printf(", ");
  95. }
  96. }
  97. printf("\n");
  98. }
  99. }
  100.  
  101. private:
  102. // 正規化。平均0、不偏標準偏差1にする。
  103. void normalize( Mtx& xx ) const
  104. {
  105. for (int col=0;col<D;++col)
  106. {
  107. double mean = 0.0; // 平均
  108. for (int row=0;row<N;++row)
  109. {
  110. mean += xx[row][col];
  111. }
  112. mean /= N;
  113.  
  114. double sd = 0.0; // 不偏標準偏差
  115. for (int row=0;row<N;++row)
  116. {
  117. const double diff = xx[row][col]-mean;
  118. sd += diff * diff;
  119. }
  120. sd /= (N-1); // 標準偏差じゃなくて不偏標準偏差なので、NじゃなくてN-1で割るのに注意。
  121. sd = sqrt(sd);
  122.  
  123. // 平均を引いた後に、不偏標準偏差で割る。
  124. for (int row=0;row<N;++row)
  125. {
  126. xx[row][col] = (xx[row][col]-mean)/sd;
  127. }
  128. }
  129. }
  130.  
  131. // 行列と行列の積
  132. inline Mtx mul(const Mtx& a, const Mtx& b) const
  133. {
  134. vector <vector <double> > c(SZ(a), vector<double>(SZ(b[0])));
  135. for (int i = 0; i < SZ(a); i++)
  136. {
  137. for (int k = 0; k < SZ(b); k++)
  138. {
  139. for (int j = 0; j < SZ(b[0]); j++)
  140. {
  141. c[i][j] += a[i][k]*b[k][j];
  142. }
  143. }
  144. }
  145. return c;
  146. }
  147.  
  148. // スカラーと行列の積
  149. inline Mtx mulScalar(const Mtx& a, const double scalar) const
  150. {
  151. Mtx ret(a);
  152. for (int i = 0; i < SZ(ret); i++)
  153. {
  154. for (int k = 0; k < SZ(ret[0]); k++)
  155. {
  156. ret[i][k] *= scalar;
  157. }
  158. }
  159. return ret;
  160. }
  161.  
  162. // スカラーとベクトルの積
  163. inline Vec mulScalar(const Vec& a, const double scalar) const
  164. {
  165. Vec ret(a);
  166. for (int i = 0; i < SZ(ret); i++)
  167. {
  168. ret[i] *= scalar;
  169. }
  170. return ret;
  171. }
  172.  
  173. // 行列の転置
  174. inline Mtx transpose( const Mtx& vs ) const
  175. {
  176. const int H = SZ(vs);
  177. const int W = SZ(vs[0]);
  178.  
  179. Mtx ret(W, Vec(H) );
  180. for (int y = 0; y < W; y++)
  181. {
  182. for (int x = 0; x < H; x++)
  183. {
  184. ret[y][x] = vs[x][y];
  185. }
  186. }
  187.  
  188. return ret;
  189. }
  190.  
  191. // 2*2の行列式を求める
  192. inline double det(const Mtx& m) const
  193. {
  194. return m[0][0]*m[1][1]-m[0][1]*m[1][0];
  195. }
  196.  
  197. // 2*2の逆行列を求める
  198. inline Mtx solve(const Mtx& m ) const
  199. {
  200. vector < vector <double> > ret(m);
  201. swap(ret[0][0],ret[1][1]);
  202. ret[0][1] = -ret[0][1];
  203. ret[1][0] = -ret[1][0];
  204. ret = mulScalar(ret,1.0/abs(det(m)));
  205. return ret;
  206. }
  207.  
  208. // 多次元正規分布密度関数を求める
  209. double getDMNorm(const Vec& x, const Vec& mu, const Mtx& sig) const
  210. {
  211. Vec x_mu(x); // x - mu
  212. for (int i = 0; i < SZ(x_mu); i++)
  213. {
  214. x_mu[i] -= mu[i];
  215. }
  216.  
  217. const Mtx inv = solve(sig);
  218.  
  219. // D=2決め打ちなので、mul(mul(transpose(x_mu),solve(sig)),x_mu)の部分を展開し、Cとした。
  220. const double C = x_mu[0]*(x_mu[0]*inv[0][0]+x_mu[1]*inv[1][0]) + x_mu[1]*(x_mu[0]*inv[0][1]+x_mu[1]*inv[1][1]);
  221.  
  222. double ret = 1/(sqrt(pow(2.0*M_PI,D) * det(sig))) * exp( -0.5 * C );
  223.  
  224. return ret;
  225. }
  226.  
  227. // Eステップ。返り値は gamma_nk[N][K]
  228. Mtx calcEstep( const Mtx& xx, const Mtx& mu, const Vec& mix, const vector < Mtx >& sig) const
  229. {
  230. Mtx ret;
  231.  
  232. for(int row=0;row<N;++row)
  233. {
  234. Vec numer(K);
  235. for(int k=0;k<K;k++)
  236. {
  237. numer[k]=mix[k]*getDMNorm(xx[row], mu[k], sig[k]);
  238. }
  239. const double sum_numer = accumulate(numer.begin(),numer.end(),0.0);
  240.  
  241. for (int k=0; k < K; k++)
  242. {
  243. numer[k]/=sum_numer;
  244. }
  245.  
  246. ret.push_back(numer);
  247. }
  248.  
  249. return ret;
  250. }
  251.  
  252. // Mステップ。次のステップのmu,mix,sigを求める。
  253. void calcMstep( Mtx& new_mu, Vec& new_mix, vector < Mtx >& new_sig, const Mtx& xx, const Mtx& gamma_nk) const
  254. {
  255. new_mu.clear();
  256. new_mix.clear();
  257. new_sig.clear();
  258.  
  259. Vec N_k(K);
  260. for(int n=0;n<N;n++)
  261. {
  262. for (int k = 0; k < K; k++)
  263. {
  264. N_k[k] += gamma_nk[n][k];
  265. }
  266. }
  267.  
  268. new_mix = N_k;
  269. for (int k = 0; k < K; k++)
  270. {
  271. new_mix[k] /= N;
  272. }
  273.  
  274. new_mu = mul(transpose(gamma_nk),xx);
  275. for (int k = 0; k < K; k++)
  276. {
  277. new_mu[k] = mulScalar(new_mu[k], 1.0/N_k[k]);
  278. }
  279.  
  280. new_sig = vector < Mtx >(K, Mtx(D, Vec(D)));
  281. for(int k=0;k<K;++k)
  282. {
  283. for(int n=0;n<N;++n)
  284. {
  285. Vec x_newmu(xx[n]); // x - new_mu
  286. for (int i = 0; i < SZ(x_newmu); i++)
  287. {
  288. x_newmu[i] -= new_mu[k][i];
  289. }
  290.  
  291. // D=2きめうち
  292. new_sig[k][0][0] += gamma_nk[n][k] * x_newmu[0] * x_newmu[0];
  293. new_sig[k][0][1] += gamma_nk[n][k] * x_newmu[0] * x_newmu[1];
  294. new_sig[k][1][0] += gamma_nk[n][k] * x_newmu[1] * x_newmu[0];
  295. new_sig[k][1][1] += gamma_nk[n][k] * x_newmu[1] * x_newmu[1];
  296. }
  297.  
  298. new_sig[k] = mulScalar(new_sig[k], 1.0/ N_k[k]);
  299. }
  300. }
  301.  
  302. // おおよその標準正規乱数(平均0、分散1)
  303. double getNormRand() const
  304. {
  305. double ret = 0.0;
  306. for( int i = 0; i < 12;i++ ){
  307. ret += (double)rand()/RAND_MAX;
  308. }
  309. return ret-6.0;
  310. }
  311. };
  312.  
  313. int main()
  314. {
  315. EMGaussianMixtures *em = new EMGaussianMixtures();
  316.  
  317. // 入力
  318. Mtx dataFrame;
  319. Vec pos(2);
  320. while (scanf("%lf %lf",&pos[0],&pos[1])!=EOF)
  321. {
  322. dataFrame.push_back(pos);
  323. }
  324.  
  325. // 初期化
  326. const int numLoops = 20;
  327. const int numClasses = 3;
  328. em->initialize(dataFrame, numClasses);
  329.  
  330. // 実行
  331. for (int i = 0; i < numLoops; i++)
  332. {
  333. em->run();
  334. }
  335.  
  336. // 出力
  337. em->printGammaNK();
  338.  
  339. delete em;
  340.  
  341. return 0;
  342. }
  343.  
Success #stdin #stdout 0.02s 3452KB
stdin
3.600      79
1.800      54
3.333      74
2.283      62
4.533      85
2.883      55
4.700      88
3.600      85
1.950      51
4.350      85
1.833      54
3.917      84
4.200      78
1.750      47
4.700      83
2.167      52
1.750      62
4.800      84
1.600      52
4.250      79
1.800      51
1.750      47
3.450      78
3.067      69
4.533      74
3.600      83
1.967      55
4.083      76
3.850      78
4.433      79
4.300      73
4.467      77
3.367      66
4.033      80
3.833      74
2.017      52
1.867      48
4.833      80
1.833      59
4.783      90
4.350      80
1.883      58
4.567      84
1.750      58
4.533      73
3.317      83
3.833      64
2.100      53
4.633      82
2.000      59
4.800      75
4.716      90
1.833      54
4.833      80
1.733      54
4.883      83
3.717      71
1.667      64
4.567      77
4.317      81
2.233      59
4.500      84
1.750      48
4.800      82
1.817      60
4.400      92
4.167      78
4.700      78
2.067      65
4.700      73
4.033      82
1.967      56
4.500      79
4.000      71
1.983      62
5.067      76
2.017      60
4.567      78
3.883      76
3.600      83
4.133      75
4.333      82
4.100      70
2.633      65
4.067      73
4.933      88
3.950      76
4.517      80
2.167      48
4.000      86
2.200      60
4.333      90
1.867      50
4.817      78
1.833      63
4.300      72
4.667      84
3.750      75
1.867      51
4.900      82
2.483      62
4.367      88
2.100      49
4.500      83
4.050      81
1.867      47
4.700      84
1.783      52
4.850      86
3.683      81
4.733      75
2.300      59
4.900      89
4.417      79
1.700      59
4.633      81
2.317      50
4.600      85
1.817      59
4.417      87
2.617      53
4.067      69
4.250      77
1.967      56
4.600      88
3.767      81
1.917      45
4.500      82
2.267      55
4.650      90
1.867      45
4.167      83
2.800      56
4.333      89
1.833      46
4.383      82
1.883      51
4.933      86
2.033      53
3.733      79
4.233      81
2.233      60
4.533      82
4.817      77
4.333      76
1.983      59
4.633      80
2.017      49
5.100      96
1.800      53
5.033      77
4.000      77
2.400      65
4.600      81
3.567      71
4.000      70
4.500      81
4.083      93
1.800      53
3.967      89
2.200      45
4.150      86
2.000      58
3.833      78
3.500      66
4.583      76
2.367      63
5.000      88
1.933      52
4.617      93
1.917      49
2.083      57
4.583      77
3.333      68
4.167      81
4.333      81
4.500      73
2.417      50
4.000      85
4.167      74
1.883      55
4.583      77
4.250      83
3.767      83
2.033      51
4.433      78
4.083      84
1.833      46
4.417      83
2.183      55
4.800      81
1.833      57
4.800      76
4.100      84
3.966      77
4.233      81
3.500      87
4.366      77
2.250      51
4.667      78
2.100      60
4.350      82
4.133      91
1.867      53
4.600      78
1.783      46
4.367      77
3.850      84
1.933      49
4.500      83
2.383      71
4.700      80
1.867      49
3.833      75
3.417      64
4.233      76
2.400      53
4.800      94
2.000      55
4.150      76
1.867      50
4.267      82
1.750      54
4.483      75
4.000      78
4.117      79
4.083      78
4.267      78
3.917      70
4.550      79
4.083      70
2.417      54
4.183      86
2.217      50
4.450      90
1.883      54
1.850      54
4.283      77
3.950      79
2.333      64
4.150      75
2.350      47
4.933      86
2.900      63
4.583      85
3.833      82
2.083      57
4.367      82
2.133      67
4.350      74
2.200      54
4.450      83
3.567      73
4.500      73
4.150      88
3.817      80
3.917      71
4.450      83
2.000      56
4.283      79
4.767      78
4.533      84
1.850      58
4.250      83
1.983      43
2.250      60
4.750      75
4.117      81
2.150      46
4.417      90
1.817      46
4.467      74
stdout
0.2314509254, 0.7685490746, 0.0000000000
0.0000000000, 0.0002825262, 0.9997174738
0.0265120697, 0.9734879220, 0.0000000084
0.0000000000, 0.0100978288, 0.9899021711
0.8892713970, 0.1107286030, 0.0000000000
0.0000001496, 0.9874887523, 0.0125110981
0.8244999097, 0.1755000903, 0.0000000000
0.2130022993, 0.7869977007, 0.0000000000
0.0000000000, 0.0006062378, 0.9993937622
0.8375569552, 0.1624430448, 0.0000000000
0.0000000000, 0.0003151885, 0.9996848115
0.5689794774, 0.4310205226, 0.0000000000
0.8733496606, 0.1266503394, 0.0000000000
0.0000000000, 0.0004295358, 0.9995704642
0.9458816924, 0.0541183076, 0.0000000000
0.0000000000, 0.0025769976, 0.9974230024
0.0000000000, 0.0002228495, 0.9997771505
0.9424231699, 0.0575768301, 0.0000000000
0.0000000000, 0.0002413254, 0.9997586746
0.8897576996, 0.1102423004, 0.0000000000
0.0000000000, 0.0003349702, 0.9996650298
0.0000000000, 0.0004295358, 0.9995704642
0.0973673045, 0.9026326954, 0.0000000001
0.0007918899, 0.9991752501, 0.0000328600
0.9678485219, 0.0321514781, 0.0000000000
0.2325097363, 0.7674902637, 0.0000000000
0.0000000000, 0.0005714970, 0.9994285030
0.8022797015, 0.1977202985, 0.0000000000
0.5540095521, 0.4459904479, 0.0000000000
0.9409066439, 0.0590933561, 0.0000000000
0.9148904878, 0.0851095122, 0.0000000000
0.9544849519, 0.0455150481, 0.0000000000
0.0047247020, 0.9952752764, 0.0000000217
0.7507933694, 0.2492066306, 0.0000000000
0.4706105531, 0.5293894469, 0.0000000000
0.0000000000, 0.0008455907, 0.9991544093
0.0000000000, 0.0005266581, 0.9994733419
0.9760485840, 0.0239514160, 0.0000000000
0.0000000000, 0.0002872057, 0.9997127943
0.7191379481, 0.2808620519, 0.0000000000
0.9154735540, 0.0845264460, 0.0000000000
0.0000000000, 0.0003569738, 0.9996430262
0.9149595130, 0.0850404870, 0.0000000000
0.0000000000, 0.0002188015, 0.9997811985
0.9679857101, 0.0320142899, 0.0000000000
0.0536570965, 0.9463429027, 0.0000000008
0.1119839342, 0.8880160658, 0.0000000000
0.0000000000, 0.0014570144, 0.9985429856
0.9488216057, 0.0511783943, 0.0000000000
0.0000000000, 0.0006998928, 0.9993001072
0.9861304273, 0.0138695727, 0.0000000000
0.7106798145, 0.2893201855, 0.0000000000
0.0000000000, 0.0003151885, 0.9996848115
0.9760485840, 0.0239514160, 0.0000000000
0.0000000000, 0.0002384139, 0.9997615861
0.9591496513, 0.0408503487, 0.0000000000
0.2151906626, 0.7848093374, 0.0000000000
0.0000000000, 0.0001920063, 0.9998079937
0.9673892707, 0.0326107293, 0.0000000000
0.8965782880, 0.1034217120, 0.0000000000
0.0000000000, 0.0050063732, 0.9949936268
0.9022621847, 0.0977378153, 0.0000000000
0.0000000000, 0.0003866257, 0.9996133743
0.9629134111, 0.0370865889, 0.0000000000
0.0000000000, 0.0002715189, 0.9997284811
0.4666794512, 0.5333205488, 0.0000000000
0.8564612631, 0.1435387369, 0.0000000000
0.9756997602, 0.0243002398, 0.0000000000
0.0000000000, 0.0015359026, 0.9984640974
0.9827460334, 0.0172539666, 0.0000000000
0.7243415701, 0.2756584299, 0.0000000000
0.0000000000, 0.0005629084, 0.9994370916
0.9520938073, 0.0479061927, 0.0000000000
0.6373550555, 0.3626449445, 0.0000000000
0.0000000000, 0.0006861351, 0.9993138649
0.9917373090, 0.0082626910, 0.0000000000
0.0000000000, 0.0008047762, 0.9991952238
0.9645289479, 0.0354710521, 0.0000000000
0.5816321988, 0.4183678012, 0.0000000000
0.2325097363, 0.7674902637, 0.0000000000
0.8357079481, 0.1642920519, 0.0000000000
0.8897755303, 0.1102244697, 0.0000000000
0.7379204022, 0.2620795978, 0.0000000000
0.0000011674, 0.6657998403, 0.3341989923
0.7622806541, 0.2377193459, 0.0000000000
0.8476374049, 0.1523625951, 0.0000000000
0.6687873960, 0.3312126040, 0.0000000000
0.9491083970, 0.0508916030, 0.0000000000
0.0000000000, 0.0030864694, 0.9969135306
0.5845024324, 0.4154975676, 0.0000000000
0.0000000000, 0.0037523963, 0.9962476037
0.5945757726, 0.4054242274, 0.0000000000
0.0000000000, 0.0004475515, 0.9995524485
0.9818051996, 0.0181948004, 0.0000000000
0.0000000000, 0.0003123091, 0.9996876909
0.9107159498, 0.0892840502, 0.0000000000
0.9293878830, 0.0706121170, 0.0000000000
0.3687133866, 0.6312866134, 0.0000000000
0.0000000000, 0.0004180439, 0.9995819561
0.9681773774, 0.0318226226, 0.0000000000
0.0000000075, 0.1187181153, 0.8812818772
0.7312418954, 0.2687581046, 0.0000000000
0.0000000000, 0.0017269402, 0.9982730598
0.9179296348, 0.0820703652, 0.0000000000
0.7536609161, 0.2463390839, 0.0000000000
0.0000000000, 0.0005788850, 0.9994211150
0.9331896332, 0.0668103668, 0.0000000000
0.0000000000, 0.0002994324, 0.9997005676
0.9095262683, 0.0904737317, 0.0000000000
0.3341617526, 0.6658382474, 0.0000000000
0.9831121057, 0.0168878943, 0.0000000000
0.0000000000, 0.0102731945, 0.9897268055
0.7941351462, 0.2058648538, 0.0000000000
0.9377682515, 0.0622317485, 0.0000000000
0.0000000000, 0.0001929582, 0.9998070418
0.9566744976, 0.0433255024, 0.0000000000
0.0000000000, 0.0115982254, 0.9884017746
0.9018985594, 0.0981014406, 0.0000000000
0.0000000000, 0.0002698119, 0.9997301881
0.7960005372, 0.2039994628, 0.0000000000
0.0000000005, 0.3817995444, 0.6182004551
0.6658172233, 0.3341827767, 0.0000000000
0.8983785387, 0.1016214613, 0.0000000000
0.0000000000, 0.0005629084, 0.9994370916
0.8054586209, 0.1945413791, 0.0000000000
0.4409610487, 0.5590389513, 0.0000000000
0.0000000000, 0.0008627462, 0.9991372538
0.9300324250, 0.0699675750, 0.0000000000
0.0000000000, 0.0064637216, 0.9935362784
0.6992270440, 0.3007729560, 0.0000000000
0.0000000000, 0.0007180533, 0.9992819467
0.7997042588, 0.2002957412, 0.0000000000
0.0000000949, 0.9435676553, 0.0564322498
0.6600681460, 0.3399318540, 0.0000000000
0.0000000000, 0.0005775463, 0.9994224537
0.9044110703, 0.0955889297, 0.0000000000
0.0000000000, 0.0004453525, 0.9995546475
0.9148812146, 0.0851187854, 0.0000000000
0.0000000000, 0.0009039496, 0.9990960504
0.3974373992, 0.6025626008, 0.0000000000
0.8649397265, 0.1350602735, 0.0000000000
0.0000000000, 0.0052319799, 0.9947680201
0.9355397080, 0.0644602920, 0.0000000000
0.9839462425, 0.0160537575, 0.0000000000
0.9280892189, 0.0719107811, 0.0000000000
0.0000000000, 0.0006266277, 0.9993733723
0.9626823412, 0.0373176588, 0.0000000000
0.0000000000, 0.0009957410, 0.9990042590
0.1310498727, 0.8689501273, 0.0000000000
0.0000000000, 0.0002964094, 0.9997035906
0.9898485627, 0.0101514373, 0.0000000000
0.7301740336, 0.2698259664, 0.0000000000
0.0000000059, 0.0537911363, 0.9462088578
0.9531212287, 0.0468787713, 0.0000000000
0.0844325285, 0.9155674715, 0.0000000000
0.6045540761, 0.3954459239, 0.0000000000
0.9393773096, 0.0606226904, 0.0000000000
0.2599464062, 0.7400535938, 0.0000000000
0.0000000000, 0.0002964094, 0.9997035906
0.4179101414, 0.5820898586, 0.0000000000
0.0000000000, 0.0050766635, 0.9949233365
0.7022462844, 0.2977537156, 0.0000000000
0.0000000000, 0.0006900084, 0.9993099916
0.5308480491, 0.4691519509, 0.0000000000
0.0149627406, 0.9850372590, 0.0000000004
0.9710494397, 0.0289505603, 0.0000000000
0.0000000008, 0.0294645011, 0.9705354982
0.8497086679, 0.1502913321, 0.0000000000
0.0000000000, 0.0005279475, 0.9994720525
0.4293740123, 0.5706259877, 0.0000000000
0.0000000000, 0.0005914997, 0.9994085003
0.0000000000, 0.0012372580, 0.9987627420
0.9690052761, 0.0309947239, 0.0000000000
0.0065114223, 0.9934885404, 0.0000000373
0.8324372467, 0.1675627533, 0.0000000000
0.9015766717, 0.0984233283, 0.0000000000
0.9634989662, 0.0365010338, 0.0000000000
0.0000000000, 0.0359322783, 0.9640677217
0.6203676183, 0.3796323817, 0.0000000000
0.8532734668, 0.1467265332, 0.0000000000
0.0000000000, 0.0003723173, 0.9996276827
0.9690052761, 0.0309947239, 0.0000000000
0.8422056696, 0.1577943304, 0.0000000000
0.4190328567, 0.5809671433, 0.0000000000
0.0000000000, 0.0009789433, 0.9990210567
0.9454439578, 0.0545560422, 0.0000000000
0.7197748797, 0.2802251203, 0.0000000000
0.0000000000, 0.0005775463, 0.9994224537
0.8994679493, 0.1005320507, 0.0000000000
0.0000000000, 0.0028495343, 0.9971504657
0.9694827327, 0.0305172673, 0.0000000000
0.0000000000, 0.0002903321, 0.9997096679
0.9849027363, 0.0150972637, 0.0000000000
0.7323321256, 0.2676678744, 0.0000000000
0.6940027294, 0.3059972706, 0.0000000000
0.8649397265, 0.1350602735, 0.0000000000
0.1197468893, 0.8802531107, 0.0000000000
0.9346259823, 0.0653740177, 0.0000000000
0.0000000000, 0.0056786112, 0.9943213888
0.9734365896, 0.0265634104, 0.0000000000
0.0000000000, 0.0015171567, 0.9984828433
0.8950448763, 0.1049551237, 0.0000000000
0.4151889005, 0.5848110995, 0.0000000000
0.0000000000, 0.0003744772, 0.9996255228
0.9678591842, 0.0321408158, 0.0000000000
0.0000000000, 0.0005109278, 0.9994890722
0.9348672037, 0.0651327963, 0.0000000000
0.4959478950, 0.5040521050, 0.0000000000
0.0000000000, 0.0006361965, 0.9993638035
0.9179296348, 0.0820703652, 0.0000000000
0.0000001206, 0.0913463231, 0.9086535563
0.9682571211, 0.0317428789, 0.0000000000
0.0000000000, 0.0004833690, 0.9995166310
0.4928860335, 0.5071139665, 0.0000000000
0.0037384398, 0.9962615526, 0.0000000076
0.8927461631, 0.1072538369, 0.0000000000
0.0000000000, 0.0284896305, 0.9715103695
0.3388246434, 0.6611753566, 0.0000000000
0.0000000000, 0.0006969663, 0.9993030337
0.8494790523, 0.1505209477, 0.0000000000
0.0000000000, 0.0004475515, 0.9995524485
0.8660518840, 0.1339481160, 0.0000000000
0.0000000000, 0.0002472600, 0.9997527400
0.9604528909, 0.0395471091, 0.0000000000
0.7310483243, 0.2689516757, 0.0000000000
0.8214986896, 0.1785013104, 0.0000000000
0.8024993762, 0.1975006238, 0.0000000000
0.9014878457, 0.0985121543, 0.0000000000
0.4732855688, 0.5267144312, 0.0000000000
0.9587273806, 0.0412726194, 0.0000000000
0.7178146366, 0.2821853634, 0.0000000000
0.0000000000, 0.0352711339, 0.9647288661
0.7235099033, 0.2764900967, 0.0000000000
0.0000000000, 0.0043009378, 0.9956990622
0.6435418844, 0.3564581156, 0.0000000000
0.0000000000, 0.0003842709, 0.9996157291
0.0000000000, 0.0003356835, 0.9996643165
0.9105614650, 0.0894385350, 0.0000000000
0.6770467706, 0.3229532294, 0.0000000000
0.0000000006, 0.0212412536, 0.9787587458
0.8470583291, 0.1529416709, 0.0000000000
0.0000000000, 0.0187793569, 0.9812206431
0.9148812146, 0.0851187854, 0.0000000000
0.0000138280, 0.9959917278, 0.0039944443
0.8989465823, 0.1010534177, 0.0000000000
0.5140608108, 0.4859391892, 0.0000000000
0.0000000000, 0.0012372580, 0.9987627420
0.9000065706, 0.0999934294, 0.0000000000
0.0000000000, 0.0032860056, 0.9967139944
0.9331855508, 0.0668144492, 0.0000000000
0.0000000000, 0.0033431427, 0.9966568573
0.9074376409, 0.0925623591, 0.0000000000
0.1168224231, 0.8831775769, 0.0000000000
0.9634989662, 0.0365010338, 0.0000000000
0.6111423506, 0.3888576494, 0.0000000000
0.5112318245, 0.4887681755, 0.0000000000
0.5114622597, 0.4885377403, 0.0000000000
0.9074376409, 0.0925623591, 0.0000000000
0.0000000000, 0.0006885643, 0.9993114357
0.9019244964, 0.0980755036, 0.0000000000
0.9795147294, 0.0204852706, 0.0000000000
0.9088650240, 0.0911349760, 0.0000000000
0.0000000000, 0.0003081008, 0.9996918992
0.8422056696, 0.1577943304, 0.0000000000
0.0000000000, 0.0014676563, 0.9985323437
0.0000000000, 0.0062489333, 0.9937510667
0.9839558574, 0.0160441426, 0.0000000000
0.8023819672, 0.1976180328, 0.0000000000
0.0000000000, 0.0031122700, 0.9968877300
0.6310267416, 0.3689732584, 0.0000000000
0.0000000000, 0.0005529791, 0.9994470209
0.9585183435, 0.0414816565, 0.0000000000