\dots \infty~times

X:

\mathbb{R}_X = \{1,2,3,4,5, \dots\}

p_X(x) =?

\dots \infty~times

P(success) = p

\dots \infty~times

p_X(5)

F F F F S

P(success) = p

(1-p)

(1-p)

(1-p)

(1-p)

p

\underbrace{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}_{(5-1)}

\underbrace{}_{1}

=(1-p)^{(5-1)}p

p_X(k)=(1-p)^{(k-1)}p

\dots \infty~times

p=0.2

P(success) = p

```
import seaborn as sb
import numpy as np
from scipy.stats import geom
x = np.arange(0, 25)
p = 0.2
dist = geom(p)
ax = sb.barplot(x=x, y=dist.pmf(x))
```

\dots \infty~times

p=0.9

P(success) = p

```
import seaborn as sb
import numpy as np
from scipy.stats import geom
x = np.arange(0, 25)
p = 0.9
dist = geom(p)
ax = sb.barplot(x=x, y=dist.pmf(x))
```

\dots \infty~times

P(success) = p

p=0.5

```
import seaborn as sb
import numpy as np
from scipy.stats import geom
x = np.arange(0, 25)
p = 0.5
dist = geom(p)
ax = sb.barplot(x=x, y=dist.pmf(x))
```

p_X(k)=(1-p)^{(k-1)}p

p_X(k)=(0.5)^{(k-1)}0.5

p_X(k)=(0.5)^{k}

p_X(x) \geq 0

\sum_{k=1}^\infty p_X(i) = 1 ?

p_X(k) = (1 - p)^{(k-1)}p

P(success) = p

= (1 - p)^{0}p + (1 - p)^{1}p + (1 - p)^{2}p + \dots

= \sum_{k=0}^\infty (1 - p)^{k}p

= \frac{p}{1 - (1 - p)} = 1

a, ar, ar^2, ar^3, ar^4, \dots

a=p~and~r=1-p < 1

\dots \infty~times

P(success) = p

\dots \infty~times

p = 0.09

P(X <=10)

p_X(7) = ?

= 1 - P(X > 10)

= 1 - (1-p)^{10}

\dots \infty~times

X:

\mathbb{R}_X = \{k,k+1,k+2,k+3,k+4, \dots\}

p_X(x) =?

\dots

P(success) = p

\dots

P(success) = p

X

\mathbb{R}_X = \{1,2,3,4,5, \dots, n\}

X

\mathbb{R}_X = \{r,r+1,r+2,r+3,r+4, \dots\}

n

r

\dots

P(success) = p

\mathbb{R}_X = \{r,r+1,r+2,r+3,r+4, \dots\}

p_X(x) =?

\# successes = r

p_X(i)

\dots

P(success) = p

\# successes = r

\underbrace{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}_{2~succeses~in~7~trials}

\underbrace{}_{success}

{n\choose k} p^k(1-p)^{n-k}

* p

\dots

\dots

P(success) = p

\# successes = r

{x-1\choose r-1} p^{r-1}(1-p)^{((x-1)-(r-1))}

* p

\underbrace{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}_{r-1~succeses~in~x-1~trials}

\underbrace{}_{success}

P(success) = p

\# successes = r

p=0.5

p_X(x) = {x-1\choose r-1} p^{r}(1-p)^{(x-r)}

\dots

r=10

\rightarrow \infty

\dots

P(success) = p

\# successes = r

p=0.1

p_X(x) = {x-1\choose r-1} p^{r}(1-p)^{(x-r)}

r=10

\rightarrow \infty

\dots \infty~times

P(success) = p

\# successes = r

p=0.9

p_X(x) = {x-1\choose r-1} p^{r}(1-p)^{(x-r)}

r=10

\rightarrow \infty

\dots

P(success) = 0.4

\# successes = 5

\overbrace{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}^{more~than~30~customers}

\dots

P(success) = 0.4

\# successes = 5

```
import seaborn as sb
import numpy as np
from scipy.stats import nbinom
from scipy.special import comb
r = 5
x = np.arange(r, 50)
p = 0.4
y = [comb(i - 1,r - 1)*np.power(p, r)
*np.power(1-p, i - r) for i in x]
ax = sb.barplot(x=x, y=y)
```

X:

p_X(x) =?

n = 5

a = 600

N-a = 400

x = 4

p_X(4) = \frac{\#~of~committees~which~match~our~criteria}{\#~of~possible~committees}

p_X(4) = \frac{{600 \choose 4} {400 \choose 1}}{{1000 \choose 5}}

= \frac{{a \choose x} {N-a \choose n-x}}{{N \choose n}}

X:

\mathbb{R}_X = max(0, n - (N-a)), \dots, min(a, n)

p_X(x)= \frac{{a \choose x} {N-a \choose n-x}}{{N \choose n}}

p = P(success) = \frac{600}{1000} = 0.6

n = 5

k = 4

p_X(k) = {n\choose k} p^{k}(1-p)^{(n-k)}

p = P(success) = \frac{600}{1000} = 0.6

p = \frac{599}{999}

p = \frac{600}{999}

p_X^\mathcal{B}(x) = {n\choose x} p^{x}(1-p)^{(n-x)}

p_X^\mathcal{H}(x)= \frac{{a \choose x} {N-a \choose n-x}}{{N \choose n}}

= 0.2591

p = P(success) = \frac{600}{1000} = 0.6

p = \frac{599}{999}

p = \frac{600}{1000}

= 0.2591

p = P(success) = \frac{600}{1000} = 0.6

p = \frac{599}{999}

p = \frac{600}{1000}

```
import seaborn as sb
import numpy as np
from scipy.stats import binom
n=50
p=0.6
x = np.arange(0,n)
rv = binom(n, p)
ax = sb.barplot(x=x, y=rv.pmf(x))
```

```
import seaborn as sb
import numpy as np
from scipy.stats import hypergeom
[N, a, n] = [1000, 600, 50] #p = 0.6
x = np.arange(0,n)
rv = hypergeom(N, a, n)
ax = sb.barplot(x=x, y=rv.pmf(x))
```

30/day \implies 2.5/ hour \implies (2.5/60)/minute

\lambda = np

p = \frac{\lambda}{n}

\lambda = 30/day \implies 2.5/ hour \implies (2.5/60)/minute

p = \frac{\lambda}{n} = \frac{2.5}{3600}

\lambda = np

p = \frac{\lambda}{n}

i.e., increase n

\lambda = np

p = \frac{\lambda}{n}

\lambda = 30/day \implies 2.5/ hour \implies (2.5/3600)/second

p = \frac{\lambda}{n} = \frac{2.5}{21600}

i.e., increase n even more

till

\(n \rightarrow \infty\)

\lambda = np

p = \frac{\lambda}{n}

p_X(k) = \lim {n \choose k} p^k (1-p)^{n-k}

n \to +\infty

(we will compute this limit on the next slide)

p_X(k) = \lim {n \choose k} p^k (1-p)^{n-k}

n \to +\infty

p_X(k) = \lim \frac{n!}{k!(n-k)!} (\frac{\lambda}{n})^k (1-\frac{\lambda}{n})^{n-k}

n \to +\infty

p_X(k) = \lim \frac{n!}{k!(n-k)!} (\frac{\lambda}{n})^k (1-\frac{\lambda}{n})^{n}(1-\frac{\lambda}{n})^{-k}

n \to +\infty

p_X(k) = \lim \frac{n!}{k!(n-k)!n^k} \lambda^k (1-\frac{\lambda}{n})^{n}(1-\frac{\lambda}{n})^{-k}

n \to +\infty

p_X(k) = \lim \frac{n!}{k!(n-k)!n^k} \lambda^k (1-\frac{\lambda}{n})^{n}(1-\frac{\lambda}{n})^{-k}

n \to +\infty

p_X(k) = \frac{\lambda^k}{k!} \lim \frac{n*(n-1)*\dots*(n-k+1)(n-k)!}{(n-k)!n^k} \lim (1-\frac{\lambda}{n})^{n} \lim (1-\frac{\lambda}{n})^{-k}

n \to +\infty

n \to +\infty

n \to +\infty

p_X(k) = \frac{\lambda^k}{k!} \lim \frac{n}{n}*\frac{(n-1)}{n}*\dots*\frac{(n-k+1)}{n} \lim (1-\frac{\lambda}{n})^{n} \lim (1-\frac{\lambda}{n})^{-k}

n \to +\infty

n \to +\infty

n \to +\infty

1

e^{-\lambda}

1

p_X(k) = \frac{\lambda^k}{k!}e^{-\lambda}

\mathbb{R}_X = \{0, 1, 2, 3, \dots\}

p_X(k) = \frac{\lambda^k}{k!}e^{-\lambda}

\lambda = 4

```
import seaborn as sb
import numpy as np
from scipy.stats import poisson
x = np.arange(0,20)
lambdaa = 4
rv = poisson(lambdaa)
ax = sb.barplot(x=x, y=rv.pmf(x))
```

\rightarrow \infty

p_X(k) = \frac{\lambda^k}{k!}e^{-\lambda}

\lambda = 20

```
import seaborn as sb
import numpy as np
from scipy.stats import poisson
x = np.arange(0,40)
lambdaa = 20
rv = poisson(lambdaa)
ax = sb.barplot(x=x, y=rv.pmf(x))
```

\rightarrow \infty

p_X^{\mathcal{B}}(2) = {1000 \choose 2} (\frac{1}{10000})^{2}(1 - \frac{1}{10000})^{998}

=0.00452

p_X^{\mathcal{P}}(2) = \frac{(0.1)^2}{2!}e^{-0.1}

=0.00452

(a generalisation of the binomial distribution)

p_1=0.50

p_2=0.25

p_3=0.15

p_4=0.10

k_1=5

k_2=2

k_3=2

k_4=1

\Sigma p_i=1

\Sigma k_i=10 = n

X_1= \#~of~Maruti~car~owners

X_2= \#~of~Hyundai~car~owners

X_3= \#~of~Mahindra~car~owners

X_4= \#~of~Tata~car~owners

\mathbb{R}_{X_1}= \{1, 2, ..., 10\}

\mathbb{R}_{X_2}= \{1, 2, ..., 10\}

\mathbb{R}_{X_3}= \{1, 2, ..., 10\}

\mathbb{R}_{X_4}= \{1, 2, ..., 10\}

such~that~X_1+X_2+X_3+X_4 = 10

(a generalisation of the binomial distribution)

p_1=0.50

p_2=0.25

p_3=0.15

p_4=0.10

k_1=5

k_2=2

k_3=2

k_4=1

\Sigma p_i=1

\Sigma k_i=10 = n

1~~~2~~~3~~4~~~5~~~6~~~7~~8~~~9~~10

4^{10}

k_1=5

k_2=2

k_3=2

k_4=1

\Sigma k_i=10 = n

(a generalisation of the binomial distribution)

p_1=0.50

p_2=0.25

p_3=0.15

p_4=0.10

k_1=5

k_2=2

k_3=2

k_4=1

\Sigma p_i=1

\Sigma k_i=10 = n

1~~~2~~~3~~4~~~5~~~6~~~7~~8~~~9~~~10

{10 \choose 5}

{10-5 \choose 2}

{10-5-2 \choose 2}

{10-5-2-2 \choose 1}

\frac{10!}{5!(10-5)!}

\frac{(10-5)!}{2!(10-5-2)!}

\frac{(10-5-2)!}{2!(10-5-2-2)!}

\frac{(10-5-2-2)!}{1!(10-5-2-2-1)!}

\frac{10!}{5!2!2!1!}

= \frac{n!}{k_1!k_2!k_3!k_4!}

\frac{n!}{k_1!k_2!k_3!k_4!}

p_1^{k_1}p_2^{k_2}p_3^{k_3}p_4^{k_4}

(a generalisation of the binomial distribution)

p_1=0.50

p_2=0.25

p_3=0.15

p_4=0.10

k_1=5

k_2=2

k_3=2

k_4=1

\Sigma p_i=1

\Sigma k_i=10 = n

1~~~2~~~3~~4~~~5~~~6~~~7~~8~~~9~~~10

p_{X_1,X_2,X_3,X_4}(x_1,x_2,x_3,x_4) =

\frac{n!}{k_1!k_2!k_3!k_4!}p_1^{k_1}p_2^{k_2}p_3^{k_3}p_4^{k_4}

(a generalisation of the binomial distribution)

p_1=0.50

p_2=0.25

p_3=0.15

p_4=0.10

k_1=5

k_2=2

k_3=2

k_4=1

\Sigma p_i=1

\Sigma k_i=10 = n

1~~~2~~~3~~4~~~5~~~6~~~7~~8~~~9~~~10

p_{X_1,X_2,X_3,X_4}(x_1,x_2,x_3,x_4) = \frac{n!}{k_1!k_2!k_3!k_4!}p_1^{k_1}p_2^{k_2}p_3^{k_3}p_4^{k_3}

p_1=p=0.7

p_2= 1- p = 0.3

k_1=6

k_2=n -k

\Sigma p_i=1

\Sigma k_i= n

p_{X_1,X_2}(x_1,x_2) = \frac{n!}{k!(n-k)!}p^{k}(1-p)^{n-k}

(binomial distribution)

\frac{{a \choose x} {N-a \choose n-x}}{{N \choose n}}

\frac{\lambda^x}{x!}e^{-\lambda}

\frac{n!}{x_1!x_2!...x_r!}p_1^{x_1}p_2^{x_2}...p_r^{x_r}

{x-1\choose r-1} p^{r}(1-p)^{(x-r)}

X:

p_X(x) = \frac{1}{6}~~~\forall x \in \{1,2,3,4,5,6\}

X:

p_X(x) = \begin{cases} \frac{1}{b - a + 1}~~~a \leq x \leq b \\~\\ 0~~~~~~~~~otherwise \end{cases}

p_X(x) = \frac{1}{100}~~~1 \leq x \leq 100

\mathbb{R}_X = \{x: a \leq x \leq b\}

p_X(x) = \begin{cases} \frac{1}{b - a + 1} = \frac{1}{n}~~~1 \leq x \leq n \\~\\ 0~~~~~~~~~otherwise \end{cases}

a = 1 ~~~~ b = n

p_X(x) = \begin{cases} \frac{1}{b - a + 1} = 1~~~x = c \\~\\ 0~~~~~~~~~otherwise \end{cases}

a = 1 ~~~~ b = c

p_X(x) \geq 0

\sum_{k=1}^\infty p_X(i) = 1 ?

p_X(x) = \frac{1}{b - a + 1}

=\sum_{i=a}^b \frac{1}{b-a+1}

=(b-a+1) * \frac{1}{b-a+1} = 1