Commit a4f26df8 by Maximilian Vitz

### Upload Solution 4

parent e6255e67
 %% Cell type:markdown id: tags: ### 1 Exspectation Value and Variance of a Sample %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: See lecture slide 46. %% Cell type:markdown id: tags: 2) %% Cell type:markdown id: tags: \$\left< V(x) \right> = \left< \frac{1}{N} \sum_{i} (x_{i}-\mu_{x})^{2} \right> = \frac{1}{N} \left< \sum_{i} x_{i}^{2} - 2 x_{i} \mu_{x} + \mu_{x}^{2} \right> = \frac{1}{N} \left( \sum_{i} \left< x_{i}^{2} \right> - 2 \left< x_{i} \right> \mu_{x} \right) + \mu_{x}^{2} = \left< x^{2} \right> - 2 \mu_{x}^{2} + \mu_{x}^{2} = \left< x^{2} \right> - \left< x \right>^{2} = \sigma_{x}^{2}\$ %% Cell type:markdown id: tags: By fixing a parameter for the measured mean like it was done in 1) one has to apply a correction factor. If the true mean is known this is not neccessary any more. %% Cell type:markdown id: tags: ### 2 Poisson Distribution %% Cell type:markdown id: tags: \$P_{k} (T) = \frac{1}{k!} e^{- \lambda T} (\lambda T)^{k}\$ %% Cell type:markdown id: tags: (lhs) \$\dot{P}_{k}(T) = \frac{1}{k!} e^{- \lambda T} (- \lambda (\lambda T)^{k} + k \lambda^{k} T^{k-1} )\$ %% Cell type:markdown id: tags: (rhs) \$\lambda [P_{k-1}(T) - P_{k}(T)] = \lambda \left[ \frac{e^{-\lambda T}}{(k-1)!} (\lambda T)^{k-1} - \frac{e^{-\lambda T}}{k!} (\lambda T)^{k} \right] = \frac{1}{k!} e^{- \lambda T} (- \lambda (\lambda T)^{k} + k \lambda^{k} T^{k-1} )\$ %% Cell type:markdown id: tags: \$\Rightarrow \dot{P}_{k}(T) = \lambda [P_{k-1}(T) - P_{k}(T)]\$ %% Cell type:markdown id: tags: Differential Equation was derived by comparing small time intervall with a Taylor expansion, see lecture slide 62. %% Cell type:markdown id: tags: ### 3 Bionomial- and Poisson Distribution %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: Bionomial Distribtion for probobility for success with N trials! %% Cell type:markdown id: tags: \$B(k; N, p) = \left(\begin{array}{c} N \\ k \end{array}\right) \cdot p^{k} \cdot (1-p)^{N-k}\$ %% Cell type:markdown id: tags: N = 60 %% Cell type:markdown id: tags: p = 0.01 %% Cell type:markdown id: tags: k = 0 %% Cell type:markdown id: tags: \$\Rightarrow B(0; 60, 0.01) = \left(\begin{array}{c} 60 \\ 0 \end{array}\right) \cdot 0.01^{0} \cdot (1-0.01)^{60-0} = 1 \cdot 1 \cdot (0.99)^{60} = 54.7 \%\$ %% Cell type:markdown id: tags: 2) %% Cell type:markdown id: tags: Poisson Distribution for event which occur with an average event rate \$\lambda\$. %% Cell type:markdown id: tags: \$P(k, \lambda) = \frac{\lambda^{k}}{k!} e^{- \lambda}\$ %% Cell type:markdown id: tags: \$\lambda\$ = \$0.01 \cdot 60 = 0.6\$ %% Cell type:markdown id: tags: k = 0 %% Cell type:markdown id: tags: \$P(0,0.6) = \frac{0.6^{0}}{0!} e^{- 0.6} = 1 \cdot e^{-0.6} = 54.9 \%\$ %% Cell type:markdown id: tags: ### 4 Poisson Distribution, Search for free Quarks %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$\sum_{i=1}^{110} P(i;229) = \sum_{i=1}^{110} \frac{229^{i}}{i!} e^{-229}= 1.6 \cdot 10^{-18} = p_{se}\$ %% Cell type:markdown id: tags: Very low propability, very unlikely to happen! %% Cell type:markdown id: tags: 2) %% Cell type:markdown id: tags: N = 55000 %% Cell type:markdown id: tags: \$p_{me} = N \cdot p_{se} = 8.9 \cdot 10^{-14}\$ %% Cell type:markdown id: tags: 3) %% Cell type:markdown id: tags: \$\sum_{i=1}^{28} P(i;57) = \sum_{i=1}^{28} \frac{57^{i}}{i!} e^{-57}= 6.7 \cdot 10^{-6}\$ %% Cell type:markdown id: tags: Much more likely to happend! %% Cell type:markdown id: tags: 4) %% Cell type:markdown id: tags: Combine both Poisson Distributions to achieve the new probability: %% Cell type:markdown id: tags: \$\mu = 4\$ %% Cell type:markdown id: tags: \$\mu \lambda = 229\$ %% Cell type:markdown id: tags: \$\sum_{i=1}^{110} \sum_{N=0}^{\infty} P(i;N\mu) \cdot P(N;\lambda) = \sum_{i=1}^{110} \sum_{N=0}^{\infty} \frac{N \mu^{i}}{i!} e^{-N \mu} \cdot \frac{\lambda^{N}}{N!} e^{-\lambda} = 4.2 \cdot 10^{-5}\$ %% Cell type:markdown id: tags: Even more likely to happen. %% Cell type:markdown id: tags: ### 5 Why are soccer results more random than handball results? %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$\lambda_{1} = 1\$ %% Cell type:markdown id: tags: \$\lambda_{2} = 2\$ %% Cell type:markdown id: tags: \$\sum_{i=1}^{\infty} \sum_{l=0}^{k-1} P(k;\lambda_{1}) \cdot P(l;\lambda_{2})= \sum_{i=1}^{\infty} \sum_{l=0}^{k-1} \frac{\lambda_{2}^{k}}{k!} e^{-\lambda_{1}} \cdot \frac{\lambda_{2}^{l}}{l!} e^{-\lambda_{2}} = 18.3 \%\$ %% Cell type:markdown id: tags: 2) %% Cell type:markdown id: tags: \$\lambda_{1} = 10\$ %% Cell type:markdown id: tags: \$\lambda_{2} = 20\$ %% Cell type:markdown id: tags: \$\sum_{i=1}^{\infty} \sum_{l=0}^{k-1} P(k;\lambda_{1}) \cdot P(l;\lambda_{2})= 2.6 \%\$ %% Cell type:markdown id: tags: Summing up over all possible combinations, i=1 as at least one goal is needed to win a game. %% Cell type:markdown id: tags: ### 5 Python Script (thanks to Joep Geuskens) %% Cell type:code id: tags: ``` python from scipy.stats import poisson import numpy as np ``` %% Cell type:code id: tags: ``` python def func(l=1): arr = np.array([poisson.cdf(k-1, 2*l)*poisson.pmf(k,l) for k in range(1,l*10)]) p = np.sum(arr) diff = arr[-1]/p # relative size of the last term compared to the total probability print(f"P(B>A)={p:.4f}") print(f"Diff={diff:.2g}") # should be sufficiently small ``` %% Cell type:code id: tags: ``` python print("1)") func(1) print("\n2)") func(10) ``` %%%% Output: stream 1) P(B>A)=0.1826 Diff=5.6e-06 2) P(B>A)=0.0258 Diff=1.9e-60 %% Cell type:markdown id: tags: ### 6 Multidimensional Gaussian %% Cell type:markdown id: tags: \$B = \frac{1}{\sigma_{1}^{2}\sigma_{2}^{2}- \rho^{2}\sigma_{1}^{2}\sigma_{2}^{2}} \left(\begin{array}{cc} \sigma_{2}^{2} & -c\\ -c & \sigma_{1}^{2} \end{array}\right) = \frac{1}{\sigma_{1}^{2}\sigma_{2}^{2} \cdot (1- \rho^{2})} \left(\begin{array}{cc} \sigma_{2}^{2} & -c\\ -c & \sigma_{1}^{2} \end{array}\right)\$ %% Cell type:markdown id: tags: \$c = \rho x_{1} x_{2}\$ %% Cell type:markdown id: tags: \$det B = \frac{1}{\sigma_{1}^{2}\sigma_{2}^{2} \cdot (1- \rho^{2})}\$ %% Cell type:markdown id: tags: \$k =\sqrt{\frac{det B}{(2\pi)^{n}}} = \frac{1}{2 \pi \cdot \sigma_{1}\sigma_{2} \cdot \sqrt{(1- \rho^{2})}}\$ %% Cell type:markdown id: tags: \$\$ \left(\begin{array}{c} x_{1} \\ x_{2} \end{array}\right) \left(\begin{array}{cc} \sigma_{2}^{2} & -c\\ -c & \sigma_{1}^{2} \end{array}\right) \left(\begin{array}{cc} x_{1} & x_{2}\\ \end{array}\right) = x_{1}^{2}\sigma_{2}^{2} - 2 x_{1} x_{2} c + x_{2}^{2}\sigma_{1}^{2} = \sigma_{1}^{2} \sigma_{2}^{2} \left( \frac{x_{1}^2}{\sigma_{1}^{2}} + \frac{x_{2}^2}{\sigma_{2}^{2}} - 2 \rho \frac{x_{1}x_{2}}{\sigma_{1}\sigma_{2}} \right) \$\$ %% Cell type:markdown id: tags: \$\Phi (x_{1}, x_{2}) = \frac{1}{2 \pi \cdot \sigma_{1}\sigma_{2} \cdot \sqrt{(1- \rho^{2})}} \exp \left( -\frac{1}{2 \cdot (1- \rho^{2})} \left( \frac{x_{1}^2}{\sigma_{1}^{2}} + \frac{x_{2}^2}{\sigma_{2}^{2}} - 2 \rho \frac{x_{1}x_{2}}{\sigma_{1}\sigma_{2}} \right) \right)\$ %% Cell type:markdown id: tags: Substitue \$x_{i}\$ with \$x_{i}- a_{i}\$ to achieve the exspected form. %% Cell type:code id: tags: ``` python ```
 %% Cell type:markdown id: tags: ### Combination of Measurements I %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$x_{1} = 12 \pm 3 \text{ (sta.)} \pm 2 \text{ (sys.)}\$ %% Cell type:markdown id: tags: \$x_{2} = 8 \pm 4 \text{ (sta.)} \pm 2 \text{ (sys.)}\$ %% Cell type:markdown id: tags: For derivation please watch lecture slide 127. %% Cell type:markdown id: tags: \$x_{m} = \frac{x_{1}/\sigma_{1}^{2} + x_{2}/\sigma_{2}^{2}}{1/\sigma_{1}^{2} + 1/\sigma_{2}^{2}}\$ %% Cell type:markdown id: tags: \$\sigma_{m}^{2} = \frac{1}{1/\sigma_{1}^{2} + 1/\sigma_{2}^{2}} + \sigma_{s}^{2}\$ %% Cell type:markdown id: tags: \$\Rightarrow x_{m} = 4.21 \pm 3.12\$ %% Cell type:markdown id: tags: ### Combination of Measurements II %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$x_{1} = 318\$ %% Cell type:markdown id: tags: \$x_{2} = 335\$ %% Cell type:markdown id: tags: For counting experiments assume Poisson Distribution: %% Cell type:markdown id: tags: \$x_{m} = \frac{x_{1}+ x_{2}}{2}\$ %% Cell type:markdown id: tags: \$\sigma_{m}^{2} = x_{m}\$ %% Cell type:markdown id: tags: \$\Rightarrow x_{m} = 326.5 \pm 12.8\$ %% Cell type:markdown id: tags: ### Comparison of Measurements %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$A = \frac{N_{1}-N_{2}}{N_{1}+N_{2}}\$ %% Cell type:markdown id: tags: \$\frac{\delta A}{\delta N_{1}} = \frac{1}{N_{1}+N_{2}}-\frac{N_{1}-N_{2}}{(N_{1}+N_{2})^{2}} = \frac{N_{1}+N_{2}-(N_{1}-N_{2})}{(N_{1}+N_{2})^{2}} = \frac{N_{1}+N_{2}}{(N_{1}+N_{2})^{2}} = \frac{1}{N}\$ %% Cell type:markdown id: tags: \$\frac{\delta A}{\delta N_{2}} = -\frac{1}{N}\$ %% Cell type:markdown id: tags: For counting experiments assume Poisson Distribution: %% Cell type:markdown id: tags: \$\sigma_{N_{1}}^{2} = \sigma_{N_{2}}^{2} = \frac{N}{2}\$ %% Cell type:markdown id: tags: \$\sigma_{A}^{2} = \left( \frac{\delta A}{\delta N_{1}} \right)^{2} \sigma_{N_{1}}^{2} + \left( \frac{\delta A}{\delta N_{2}} \right)^{2} \sigma_{N_{2}}^{2} = \frac{1}{N}\$ %% Cell type:markdown id: tags: \$\Rightarrow \sigma_{A} = \frac{1}{\sqrt{N}}\$ %% Cell type:markdown id: tags: 2) %% Cell type:markdown id: tags: \$\text{cov}(N,N') = \langle N N' \rangle - \langle N \rangle\langle N'\rangle = \langle ( N' + \delta N ) N' \rangle + \langle N' - \delta N \rangle \langle N'\rangle = \langle N'^{2} \rangle + \langle \delta N \rangle \langle N' \rangle - \langle N' \rangle^{2} - \langle \delta N \rangle \langle N' \rangle = \langle N'^{2} \rangle - \langle N' \rangle^{2} \approx N'\$ %% Cell type:markdown id: tags: \$\rho_{N,N'} = \frac{\text{cov}(N,N')}{\sqrt{N}\sqrt{N'}} = \frac{N'}{\sqrt{N N'}} = \sqrt{\frac{N'}{N}}\$ %% Cell type:markdown id: tags: 3) %% Cell type:markdown id: tags: \$\left( \frac{\delta \vec{A}}{\delta \vec{N}} \right) = \left(\begin{array}{cccc} \frac{\delta A}{\delta N_{1}} & \frac{\delta A}{\delta N_{2}} & \frac{\delta A}{\delta N'_{1}} & \frac{\delta A}{\delta N'_{2}} \\ \frac{\delta A'}{\delta N_{1}} & \frac{\delta A'}{\delta N_{2}} & \frac{\delta A'}{\delta N'_{1}} & \frac{\delta A'}{\delta N'_{2}} \end{array}\right) = \left(\begin{array}{cccc} \frac{1}{N} & -\frac{1}{N} & 0 & 0 \\ 0 & 0 & \frac{1}{N'} & -\frac{1}{N'} \end{array}\right)\$ %% Cell type:markdown id: tags: \$\text{cov}(A,A') = \left(\begin{array}{cccc} \frac{1}{N} & -\frac{1}{N} & 0 & 0 \\ 0 & 0 & \frac{1}{N'} & -\frac{1}{N'} \end{array}\right) \left(\begin{array}{cccc} N_{1} & 0 & N'_{1} & 0 \\ 0 & N_{2} & 0 & N'_{2} \\ N'_{1} & 0 & N'_{1} & 0 \\ 0 & N'_{2} & 0 & N'_{2} \end{array}\right) \left(\begin{array}{cc} \frac{1}{N} & 0 \\ -\frac{1}{N} & 0 \\ 0 & \frac{1}{N'} \\ 0 & -\frac{1}{N'} \end{array}\right) = \left(\begin{array}{cc} \frac{1}{N} & \frac{1}{N} \\ \frac{1}{N} & \frac{1}{N'} \end{array}\right)\$ %% Cell type:markdown id: tags: \$\Rightarrow \rho_{A,A'} = \frac{\text{cov}(A,A')}{\sigma_{A}\sigma_{A'}} = \frac{1/N}{\sqrt{1/N}\sqrt{1/N'}} = \sqrt{\frac{N'}{N}}\$ %% Cell type:markdown id: tags: 4) %% Cell type:markdown id: tags: \$\sigma_{A-A'}^{2}= \sigma_{A}^{2} + \sigma_{A'}^{2} - 2 \text{cov}(A,A') = \frac{1}{N} + \frac{1}{N'} - \frac{2}{N} = \frac{1}{N'} - \frac{1}{N} = \sigma_{A'}^{2} - \sigma_{A}^{2}\$ %% Cell type:markdown id: tags:
 %% Cell type:markdown id: tags: ### Combination of Measurements I %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$x_{1} = 12 \pm 3 \text{ (sta.)} \pm 2 \text{ (sys.)}\$ %% Cell type:markdown id: tags: \$x_{2} = 8 \pm 4 \text{ (sta.)} \pm 2 \text{ (sys.)}\$ %% Cell type:markdown id: tags: For derivation please watch lecture slide 127. %% Cell type:markdown id: tags: \$x_{m} = \frac{x_{1}/\sigma_{1}^{2} + x_{2}/\sigma_{2}^{2}}{1/\sigma_{1}^{2} + 1/\sigma_{2}^{2}}\$ %% Cell type:markdown id: tags: \$\sigma_{m}^{2} = \frac{1}{1/\sigma_{1}^{2} + 1/\sigma_{2}^{2}} + \sigma_{s}^{2}\$ %% Cell type:markdown id: tags: \$\Rightarrow x_{m} = 10.56 \pm 3.12\$ %% Cell type:markdown id: tags: ### Combination of Measurements II %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$x_{1} = 318\$ %% Cell type:markdown id: tags: \$x_{2} = 335\$ %% Cell type:markdown id: tags: For counting experiments assume Poisson Distribution: %% Cell type:markdown id: tags: \$x_{m} = \frac{x_{1}+ x_{2}}{2}\$ %% Cell type:markdown id: tags: \$\sigma_{m}^{2} = x_{m}\$ %% Cell type:markdown id: tags: \$\Rightarrow x_{m} = 326.5 \pm 12.8\$ %% Cell type:markdown id: tags: ### Comparison of Measurements %% Cell type:markdown id: tags: 1) %% Cell type:markdown id: tags: \$A = \frac{N_{1}-N_{2}}{N_{1}+N_{2}}\$ %% Cell type:markdown id: tags: \$\frac{\delta A}{\delta N_{1}} = \frac{1}{N_{1}+N_{2}}-\frac{N_{1}-N_{2}}{(N_{1}+N_{2})^{2}} = \frac{N_{1}+N_{2}-(N_{1}-N_{2})}{(N_{1}+N_{2})^{2}} = \frac{N_{1}+N_{2}}{(N_{1}+N_{2})^{2}} = \frac{1}{N}\$ %% Cell type:markdown id: tags: \$\frac{\delta A}{\delta N_{2}} = -\frac{1}{N}\$ %% Cell type:markdown id: tags: For counting experiments assume Poisson Distribution: %% Cell type:markdown id: tags: \$\sigma_{N_{1}}^{2} = \sigma_{N_{2}}^{2} = \frac{N}{2}\$ %% Cell type:markdown id: tags: \$\sigma_{A}^{2} = \left( \frac{\delta A}{\delta N_{1}} \right)^{2} \sigma_{N_{1}}^{2} + \left( \frac{\delta A}{\delta N_{2}} \right)^{2} \sigma_{N_{2}}^{2} = \frac{1}{N}\$ %% Cell type:markdown id: tags: \$\Rightarrow \sigma_{A} = \frac{1}{\sqrt{N}}\$ %% Cell type:markdown id: tags: 2) %% Cell type:markdown id: tags: \$\text{cov}(N,N') = \langle N N' \rangle - \langle N \rangle\langle N'\rangle = \langle ( N' + \delta N ) N' \rangle + \langle N' - \delta N \rangle \langle N'\rangle = \langle N'^{2} \rangle + \langle \delta N \rangle \langle N' \rangle - \langle N' \rangle^{2} - \langle \delta N \rangle \langle N' \rangle = \langle N'^{2} \rangle - \langle N' \rangle^{2} \approx N'\$ %% Cell type:markdown id: tags: \$\rho_{N,N'} = \frac{\text{cov}(N,N')}{\sqrt{N}\sqrt{N'}} = \frac{N'}{\sqrt{N N'}} = \sqrt{\frac{N'}{N}}\$ %% Cell type:markdown id: tags: 3) %% Cell type:markdown id: tags: \$\left( \frac{\delta \vec{A}}{\delta \vec{N}} \right) = \left(\begin{array}{cccc} \frac{\delta A}{\delta N_{1}} & \frac{\delta A}{\delta N_{2}} & \frac{\delta A}{\delta N'_{1}} & \frac{\delta A}{\delta N'_{2}} \\ \frac{\delta A'}{\delta N_{1}} & \frac{\delta A'}{\delta N_{2}} & \frac{\delta A'}{\delta N'_{1}} & \frac{\delta A'}{\delta N'_{2}} \end{array}\right) = \left(\begin{array}{cccc} \frac{1}{N} & -\frac{1}{N} & 0 & 0 \\ 0 & 0 & \frac{1}{N'} & -\frac{1}{N'} \end{array}\right)\$ %% Cell type:markdown id: tags: \$\text{cov}(A,A') = \left(\begin{array}{cccc} \frac{1}{N} & -\frac{1}{N} & 0 & 0 \\ 0 & 0 & \frac{1}{N'} & -\frac{1}{N'} \end{array}\right) \left(\begin{array}{cccc} N_{1} & 0 & N'_{1} & 0 \\ 0 & N_{2} & 0 & N'_{2} \\ N'_{1} & 0 & N'_{1} & 0 \\ 0 & N'_{2} & 0 & N'_{2} \end{array}\right) \left(\begin{array}{cc} \frac{1}{N} & 0 \\ -\frac{1}{N} & 0 \\ 0 & \frac{1}{N'} \\ 0 & -\frac{1}{N'} \end{array}\right) = \left(\begin{array}{cc} \frac{1}{N} & \frac{1}{N} \\