Wed Oct 8 08:56:31 2025 square_monte_carlo_test(): python version: 3.10.12 numpy version: 1.26.4 Test square_monte_carlo(). square01_area_test(): square01_area() returns the area of the unit square. square01_area() = 1 square01_monomial_integral_test(): square01_monomial_integral() returns the integral of a monomial over the interior of the unit square in 2D. Compare with a Monte Carlo estimate. Number of sample points used is 4192 Ex Ey MC-Estimate Exact Error 4 0 0.2026 0.2 0.0026 3 3 0.062779 0.0625 0.00028 7 1 0.062387 0.0625 0.00011 6 0 0.144143 0.142857 0.0013 5 6 0.0238845 0.0238095 7.5e-05 1 1 0.252486 0.25 0.0025 3 7 0.0315073 0.03125 0.00026 4 4 0.0400736 0.04 7.4e-05 1 6 0.0715419 0.0714286 0.00011 3 4 0.0502446 0.05 0.00024 4 3 0.0500453 0.05 4.5e-05 0 7 0.124784 0.125 0.00022 4 3 0.0500453 0.05 4.5e-05 2 5 0.0558953 0.0555556 0.00034 1 5 0.0835824 0.0833333 0.00025 1 7 0.0624968 0.0625 3.2e-06 2 6 0.0479103 0.047619 0.00029 3 1 0.126268 0.125 0.0013 7 7 0.0156484 0.015625 2.3e-05 5 0 0.168486 0.166667 0.0018 square01_monte_carlo_test(): Use square01_sample to estimate integrals along the interior of the unit square in 2D. N 1 X^2 Y^2 X^4 X^2Y^2 Y^4 X^6 1 1 0.139429 0.0189289 0.0194405 0.00263924 0.000358304 0.00271057 2 1 0.672688 0.664337 0.456307 0.448126 0.441745 0.312062 4 1 0.113677 0.387762 0.0189003 0.0261627 0.250187 0.00341758 8 1 0.251903 0.354331 0.151059 0.0948887 0.195204 0.106208 16 1 0.508193 0.359714 0.368552 0.242778 0.209007 0.293873 32 1 0.37609 0.341646 0.22699 0.122516 0.230767 0.162987 64 1 0.285078 0.372683 0.165637 0.117355 0.219777 0.11895 128 1 0.332903 0.345133 0.194022 0.128027 0.220907 0.137424 256 1 0.322135 0.282748 0.189755 0.087634 0.16115 0.134652 512 1 0.337032 0.368907 0.203548 0.119004 0.233752 0.146601 1024 1 0.339246 0.343089 0.205545 0.115569 0.210974 0.147905 2048 1 0.326342 0.328214 0.194814 0.106536 0.195073 0.139327 4096 1 0.338294 0.338802 0.202806 0.114865 0.205617 0.144589 8192 1 0.331913 0.332232 0.199505 0.109236 0.199662 0.142978 16384 1 0.331111 0.3348 0.198238 0.11082 0.201467 0.141485 32768 1 0.333825 0.335362 0.200529 0.112458 0.20259 0.143435 65536 1 0.332469 0.332338 0.198603 0.110526 0.199521 0.141381 Exact %14.6g 1.0 %14.6g 0.3333333333333333 %14.6g 0.3333333333333333 %14.6g 0.2 %14.6g 0.1111111111111111 %14.6g 0.2 %14.6g 0.14285714285714285 square01_sample_test square01_sample samples the unit square. Sample points in the unit square. Row: 0 1 Col 0 : 0.621102 0.441834 1 : 0.653749 0.383647 2 : 0.120534 0.809312 3 : 0.270734 0.450602 4 : 0.491161 0.276018 5 : 0.328772 0.314159 6 : 0.191289 0.0178803 7 : 0.329918 0.143447 8 : 0.0190533 0.21087 9 : 0.0998435 0.985436 square_monte_carlo_test(): Normal end of execution. Wed Oct 8 08:56:31 2025