- #106
zzephod
- 124
- 0
Which agrees with the double checked MC estimate of \(\displaystyle 0.4900 \pm 0.0003 (2 SE)\)chisigma said:What I said in the point b) is 'half correct' and 'half wrong', in the sense that all the favourable cases are represented by both the $\displaystyle S_{3}-S_{2}- S_{1}$ and $\displaystyle S_{3}-S_{1}-S_{2}$ sequences. To understand that let suppose that the sectors have angles $\displaystyle \theta_{3} = \theta_{2}= \theta_{1}=0$, so that the no overlapping probability is of course P=1. If we consider only the sequence $\displaystyle S_{3}-S_{2}- S_{1}$ and proceed we obtain... $\displaystyle P = \frac{1}{4 \pi^{2}}\ \int_{0}^{2 \pi} d x \int_{x}^{2 \pi} d y = \frac{1}{2}$
... and that demonstrates that also the sequence $\displaystyle S_{3}-S_{1}-S_{2}$ must be taken into account. Proceeding along this way we obtain...
$\displaystyle P = \frac{1}{4 \pi^{2}}\ \int_{\frac{3}{10} \pi}^{\frac{17}{10} \pi} d x \int_{x + \frac{2}{10} \pi}^{\frac{19}{10} \pi} d y + \frac{1}{4 \pi^{2}}\ \int_{\frac{3}{10} \pi}^{\frac{17}{10} \pi} d x \int_{x + \frac{1}{10} \pi}^{\frac{18}{10} \pi} d y = 2\ \frac{49}{200} = \frac{49}{100}$
Kind regards
$\chi$ $\sigma$
Python Script:
Code:
import numpy as np
a=np.pi/10;b=2.0*np.pi/10;c=3.0*np.pi/10
N=10000000
theb=np.random.rand(1,N)*2.0*np.pi
thec=np.random.rand(1,N)*2.0*np.pi
thed=thec-theb;thee=theb-thec
test1=np.logical_and((theb>a),(theb+b<2*np.pi))
test2=np.logical_and((thec>a),(thec+c<2*np.pi))
test3=np.logical_and(np.logical_and((thed>0),(thed>b)),(thed+c<2*np.pi))
test4=np.logical_and(np.logical_and((thee>0),(thee>c)),(thee+b<2*np.pi))
test5=np.logical_or(test3,test4)
TEST0=np.logical_and(test1,test2)
TEST=np.logical_and(TEST0,test5)
PP=1.0*np.sum(TEST)/N
SE=np.sqrt(PP*(1-PP)*N)/N
print PP,SE
(errors in previous MC estimate due to still learning Python and so misusing element wise logical operators on numpy arrays - probably).
Last edited: