diff --git a/Lectures_my/MC_2016/Lecture7/mchrzasz.log b/Lectures_my/MC_2016/Lecture7/mchrzasz.log index 57f0f6c..0bf0f07 100644 --- a/Lectures_my/MC_2016/Lecture7/mchrzasz.log +++ b/Lectures_my/MC_2016/Lecture7/mchrzasz.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 15 APR 2016 22:48 +This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 21 APR 2016 15:56 entering extended mode restricted \write18 enabled. %&-line parsing enabled. diff --git a/Lectures_my/MC_2016/Lecture7/mchrzasz.pdf b/Lectures_my/MC_2016/Lecture7/mchrzasz.pdf index 6b83833..c93a094 100644 --- a/Lectures_my/MC_2016/Lecture7/mchrzasz.pdf +++ b/Lectures_my/MC_2016/Lecture7/mchrzasz.pdf Binary files differ diff --git a/Lectures_my/MC_2016/Lecture7/mchrzasz.synctex.gz b/Lectures_my/MC_2016/Lecture7/mchrzasz.synctex.gz index 187b545..8d84cb6 100644 --- a/Lectures_my/MC_2016/Lecture7/mchrzasz.synctex.gz +++ b/Lectures_my/MC_2016/Lecture7/mchrzasz.synctex.gz Binary files differ diff --git a/Lectures_my/MC_2016/Lecture7/mchrzasz.tex b/Lectures_my/MC_2016/Lecture7/mchrzasz.tex index 9af0bce..d5fa317 100644 --- a/Lectures_my/MC_2016/Lecture7/mchrzasz.tex +++ b/Lectures_my/MC_2016/Lecture7/mchrzasz.tex @@ -355,8 +355,8 @@ \end{itemize} \ARROW If $U_1,U_2 \in \mathcal{U}(0,1)$: \begin{align*} -x=\sqrt{2 \ln U_1}\cos (2\pi U_2)\\ -x=\sqrt{2 \ln U_1}\sin (2\pi U_2) +x=\sqrt{-2 \ln U_1}\cos (2\pi U_2)\\ +y=\sqrt{-2 \ln U_1}\sin (2\pi U_2) \end{align*} \ARROW Accurate and simple to use.\\ \ARROW Time consuming calculations of trigonometrical and logarithm function. @@ -377,7 +377,7 @@ \begin{itemize} \item Generate $R_1,R_2 \in \mathcal{U}(0,1)$ and calculate the $U_1=2R_1-1,~U_2=2R_2-1$ \item Calculate $W=U_1^2+U_2^2$. -\item If $W>0$ start over. +\item If $W<1$ start over. \item Calculate the $X=U_1 Z$ and $Y=U_2 Z$, where $Z=\sqrt{\frac{-2 \ln W}{W}}$ \end{itemize} \ARROW E7.2 Generate $N(0,1)$ using \cdf~reverting and Marsaglia \& Bray method. @@ -426,7 +426,7 @@ \begin{exampleblock}{Theorem:} If a random variable $X$ has a cuf-off Cauchy distribution $C_u(0,1)$, then the new random variable $Y$, which is with $50~\%$ equal $X$ and with $50\%$ equal $1/X$ has a ''normal'' Cauchy distribution. \end{exampleblock} -\ARROW Prove $(y \leq 1)$: +\ARROW Prove $(y \leq -1)$: \begin{align*} \mathcal{P}\lbrace Y\leq y\rbrace = \frac{1}{2} \mathcal{P}\lbrace X \leq y \rbrace + \frac{1}{2} \mathcal{P}\lbrace \frac{1}{X} \leq \rbrace = 0+\frac{1}{2}\lbrace \frac{1}{y} \leq X <0 \rbrace \\ = \frac{1}{2} \frac{2}{\pi} \int_{1/y}^0 \frac{dr }{1+t^2}=\frac{1}{\pi} \arctan y +\frac{1}{2}~~~{\rm c.d.f~of~}C(0,1) \end{align*} diff --git a/Lectures_my/MC_2016/Lecture8/mchrzasz.log b/Lectures_my/MC_2016/Lecture8/mchrzasz.log index 8f70701..9d802c2 100644 --- a/Lectures_my/MC_2016/Lecture8/mchrzasz.log +++ b/Lectures_my/MC_2016/Lecture8/mchrzasz.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 20 APR 2016 19:02 +This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 21 APR 2016 09:30 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -3269,12 +3269,12 @@ Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 835. ) Here is how much of TeX's memory you used: - 50451 strings out of 493918 - 990012 string characters out of 6150564 + 50453 strings out of 493918 + 990028 string characters out of 6150564 1344164 words of memory out of 5000000 - 52714 multiletter control sequences out of 15000+600000 + 52716 multiletter control sequences out of 15000+600000 37200 words of font info for 150 fonts, out of 8000000 for 9000 1144 hyphenation exceptions out of 8191 - 55i,21n,77p,10405b,1483s stack positions out of 5000i,500n,10000p,200000b,80000s + 55i,21n,77p,10405b,1486s stack positions out of 5000i,500n,10000p,200000b,80000s Output written on mchrzasz.pdf (23 pages). diff --git a/Lectures_my/MC_2016/Lecture8/mchrzasz.tex b/Lectures_my/MC_2016/Lecture8/mchrzasz.tex index c466131..af537a3 100644 --- a/Lectures_my/MC_2016/Lecture8/mchrzasz.tex +++ b/Lectures_my/MC_2016/Lecture8/mchrzasz.tex @@ -272,13 +272,13 @@ \begin{minipage}{\textwidth} \ARROW Lets start with a TRIVIAL example: we want to calculate $S=A+B$. We can rewrite it in: \begin{align*} -A=p \frac{A}{p}+(1-p) \frac{B}{1-p} +S=p \frac{A}{p}+(1-p) \frac{B}{1-p} \end{align*} and one can interpret the sum as expected value of: \begin{align*} W=\begin{cases} \frac{A}{p}~~{ \rm with~propability~} p \\ -\frac{A}{1p}~~{ \rm with~propability~} 1-p +\frac{A}{1-p}~~{ \rm with~propability~} 1-p \end{cases} \end{align*} \ARROW The algorithm: