Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)]

Type "copyright", "credits" or "license" for more information.


IPython 7.18.1 -- An enhanced Interactive Python.


Restarting kernel...




In [1]: runfile('G:/UBCO/2020-2021/Python/20201002/hypersphere.py', wdir='G:/UBCO/2020-2021/Python/20201002')

0.14899466488003676

The volume of a 1 D sphere from the Monte Carlo simulation is 2.0

The exact volume is 2 and the ratio of the two is 1.0

The volume of a 2 D sphere from the Monte Carlo simulation is 3.14164

The exact volume is 3.141592653589793 and the ratio of the two is 1.0000150708304443

The volume of a 3 D sphere from the Monte Carlo simulation is 4.1856

The exact volume is 4.1887902047863905 and the ratio of the two is 0.9992383947081558

The volume of a 4 D sphere from the Monte Carlo simulation is 4.9128

The exact volume is 4.934802200544679 and the ratio of the two is 0.995541421996154

The volume of a 5 D sphere from the Monte Carlo simulation is 5.26304

The exact volume is 5.263789013914324 and the ratio of the two is 0.9998577044193178

The volume of a 9 D sphere from the Monte Carlo simulation is 3.309568

The exact volume is 3.2985089027387064 and the ratio of the two is 1.0033527565295068

The volume of a 12 D sphere from the Monte Carlo simulation is 1.437696

2020-10-02 21:41:21.892462

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

2020-10-03 00:02:23.040924

12-D sphere volume prefactor: 1.33052416

The standard deviation: 0.06696188696549216

The standard error: 0.0033480943482746077

The prefactor for the volume of a 12-D sphere is 1.33052416 ± 0.0033480943482746077




In [2]: