Commit c5ba8877 authored by Maximilian Vitz's avatar Maximilian Vitz
Browse files

Added Solution2!

parent dfd9db9d
%% 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
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment