Important note on Matlab: I used Matlab 2016a to write all the software. In particular, the function histcounts() was used for binning as recommended by Matlab help pages. This function do not exist in Matlab 2014a and was added in Matlab 2014b.
\[ f\left ( x\right ) =A\frac{1}{1+x}\] To normalize it, we first solve for \(A\) from\[ \int _{-\infty }^{\infty }f\left ( x\right ) dx=1 \] Hence\begin{align*} 1 & =\int _{-\infty }^{\infty }A\frac{1}{1+x}dx\\ & =A\left [ \arctan \left ( x\right ) \right ] _{-\infty }^{\infty }\\ & =A\left ( \frac{\pi }{2}+\frac{\pi }{2}\right ) \end{align*}
Therefore \[ \fbox{$A=\frac{1}{\pi }$}\] Now we need to find cumulative probability distribution \(F\left ( x\right ) \) and invert then it. \begin{align*} F\left ( x\right ) & =\int _{-\infty }^{x}f\left ( x\right ) dx\\ & =\int _{-\infty }^{x}\frac{1}{\pi }\frac{1}{1+x}dx\\ & =\frac{1}{\pi }\left ( \arctan \left ( x\right ) \right ) _{-\infty }^{x}\\ & =\frac{1}{\pi }\left ( \arctan \left ( x\right ) +\frac{\pi }{2}\right ) \end{align*}
Hence\[ F\left ( x\right ) =\frac{1}{\pi }\arctan \left ( x\right ) +\frac{1}{2}\] To invert, \[ \pi \left ( F\left ( x\right ) -\frac{1}{2}\right ) =\arctan \left ( x\right ) \] Hence \[ \fbox{$x=F^-1\left ( x\right ) =\tan \left ( \pi \left ( F\left ( x\right ) -\frac{1}{2}\right ) \right ) $}\]
Matlab rand was used to generate number of samples. To see the effect, the sampling was increased from \(10^{2}\) to \(10^{6}\). The area under the pdf generated using sampling was normalized so that its area is one. The following plots show the result. The source code is included.
The algorithm used is the following
The rejection method was used to first generate \(f_{H}(D)\) and then was used again to generate \(F_{L}(D)\). So the result shows each of these separately below.
For each case, number of trials was increased to see the effect. The following trials were used \(\{10^{4},10^{5},10^{6},10^{7}\}\). The last amount is the one asked for in this problem. For each case, both the similogy plot is shown and the normal scale plot is also shown. These results shows the rejection method improves as more trials are used. The analytic pdf is also plotted against the generated one to compare.
Matlab source code is included. Implemented on Matlab 2016a.
The algorithm used is the following
The above was repeated for the low LET radiation. The result is given below
The following trials were used \(\{10^{4},10^{5},10^{6},10^{7}\}\). The last amount is the one asked for in this problem. For each case, analytic pdf is plotted against the generated one to compare. As more trials used, the approximation to the true pdf is improved.
The following plots adds \(10^{8}\) number of trials in order to see how close the generated pdf will be to the theoretical pdf in the plateau region (the region between 15 and 45 years). Generated pdf becomes closer to the theoretical pdf, but there always be a small gap at the top. With more trials, the generated pdf will converge to the theoretical pdf.