1) arbitrary pdfs

2) Expectation and variance of continuous RVs

p_X(x)

1~~~2~~~3~~~4~~~5~~~6

0.2

0.4

0.6

0.8

1.0

x

p_X(x)

1~~~2~~~3~~~4~~~5~~~6

0.2

0.4

0.6

0.8

1.0

x

F_X(x)

1~~~2~~~3~~~4~~~5~~~6

0.2

0.4

0.6

0.8

1.0

x

P(X \leq x)

F_X(x)

p_X(x)

2

3

4

5

6

7

8

9

10

11

12

x

P(X \leq x)

\frac{1}{36}

\frac{2}{36}

\frac{3}{36}

\frac{4}{36}

\frac{5}{36}

\frac{6}{36}

\frac{5}{36}

\frac{4}{36}

\frac{3}{36}

\frac{2}{36}

\frac{1}{36}

\frac{1}{6}

\frac{2}{6}

\frac{3}{6}

\frac{4}{6}

\frac{5}{6}

1 = \frac{6}{6}

2

3

4

5

6

7

8

9

10

11

12

x

\frac{1}{36}

\frac{3}{36}

\frac{6}{36}

\frac{10}{36}

\frac{15}{36}

\frac{21}{36}

\frac{1}{6}

\frac{2}{6}

\frac{3}{6}

\frac{4}{6}

\frac{5}{6}

1 = \frac{6}{6}

\frac{26}{36}

\frac{30}{36}

\frac{33}{36}

\frac{35}{36}

\frac{36}{36}

p_X(x)

2

3

4

5

6

7

8

9

10

11

12

x

\frac{1}{36}

\frac{2}{36}

\frac{3}{36}

\frac{4}{36}

\frac{5}{36}

\frac{6}{36}

\frac{5}{36}

\frac{4}{36}

\frac{3}{36}

\frac{1}{36}

\frac{1}{6}

\frac{2}{6}

\frac{3}{6}

\frac{4}{6}

\frac{5}{6}

1 = \frac{6}{6}

\Omega

p_X(x) \geq 0

P(a \leq X \leq b) = \sum_{x=a}^b p_X(x)

f_X(x) \geq 0

P(a \leq X \leq b) = \int_{a}^b f_X(x) dx

\int_{-\infty}^\infty f_X(x) dx = 1

\sum_x p_x(x) = 1

\delta

f_X(x)

P_X(a\leq x \leq a + \delta) = f_X(x)\cdot \delta

P(X=x) = 0 \forall x

P(a\leq X \leq b)

P_X(a\leq x \leq a + \delta) \approx f_X(x)\cdot \delta

f_X(x)\geq 0

\int_{-\infty}^\infty f_X(x) dx = 1

1) arbitrary pdfs

2) Expectation and variance of continuous RVs

\frac{1}{b - a}

b

p_X(x)

f_X(x)

a_1

b_1

[

]

P(a_1 \leq X \leq b_1) = \frac{1}{b-a} (b_1 - a_1)

a

b

\dots

\dots

\frac{1}{b - a + 1}

a

b

f_X(x)

p_X(x)

a

b

\dots

\dots

\frac{1}{b - a + 1}

E[X] = \sum_x xp_X(x)

E[g(X)] = \sum_x g(x) p_X(x)

Var(X) = E[X^2] - (E[X])^2

E[X] = \int_{-\infty}^{\infty} xf_X(x) dx

E[g(X)] = \int_{-\infty}^{\infty}g(x) p_X(x)dx

Var(X) = E[X^2] - (E[X])^2

E[X] = \int_{a}^{b} x\frac{1}{b-a} dx

E[g(X)] = \int_{-\infty}^{\infty}g(x) p_X(x) dx

Var(X) = E[X^2] - (E[X])^2

\frac{1}{b - a}

b

f_X(x)

a

b

=\frac{a+b}{2}

E[X] = \int_{-\infty}^{\infty} xf_X(x) dx

E[X^2] = \int_{a}^{b} x^2\frac{1}{b-a} dx

=\frac{1}{b-a}(\frac{b^3}{3} - \frac{a^3}{3})

Var(X) = E[X^2] - (E[X])^2 = \frac{(b-a)^2}{12}

E[X] = \int_{a}^{b} x\frac{1}{b-a} dx

E[X^2] = \int_{a}^{b} x^2\frac{1}{b-a} dx

E[X] =\frac{1}{b-a} * \frac{x^2}{2} |_{a}^b

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

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

=\frac{1}{b-a} * \frac{x^3}{3} |_{a}^b

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

= \frac{1}{b-a}\frac{(b - a)(a^2 + ab + b^2)}{3} = \frac{a^2 + ab + b^2}{3}

Var(X) = E[X^2] - E[X]^2

= \frac{a^2 + ab + b^2}{3} - (\frac{a+b}{2})^2

= \frac{a^2 + ab + b^2}{3} - \frac{a^2 + 2ab + b^2}{4}

= \frac{(b-a)^2}{12}

x^2

e^x

x

e^{-x}

e^{x^2}

e^{-x^2}

20 * e^{-x^2}

e^{-x^2}

\mathcal{N}(0, 1) = \frac{1}{\sqrt{2 \pi}}e^{-x^2}

\int_{-\infty}^{\infty} \frac{1}{\sqrt{2 \pi}}e^{-x^2} dx = 1

\mathcal{N}(0, 1) = \frac{1}{\sqrt{2 \pi}}e^{-x^2}

E[X] = \int_{-\infty}^{\infty}x\cdot\frac{1}{\sqrt{2 \pi}}e^{-x^2} dx

= 0

Var[X] = E[X^2] - (E[X])^2

= 1

\mu = 0, \sigma = 1

\mathcal{N}(\mu, 1) = \frac{1}{\sqrt{2 \pi}}e^{-\frac{(x-\mu)^2}{2}}

E[X] = \int_{-\infty}^{\infty}x\cdot\frac{1}{\sqrt{2 \pi}}e^{-\frac{(x-\mu)^2}{2}} dx

= \mu

Var[X] = E[X^2] - (E[X])^2

= 1

\mu = 2

\mu = 0

\mu = -2

\mu)

\mathcal{N}(0, \sigma^2) = \frac{1}{\sqrt{2 \pi}}e^{\frac{-x^2}{2\sigma^2}}

E[X] = \int_{-\infty}^{\infty}x\cdot\frac{1}{\sqrt{2 \pi}}e^{\frac{-x^2}{2\sigma^2}} dx

= 0

Var[X] = E[X^2] - (E[X])^2

= \sigma^2

\sigma = 0.5

\sigma = 1

\sigma = 2

\sigma)

\mathcal{N}(\mu, \sigma^2) = \frac{1}{\sqrt{2 \pi}}e^{\frac{-(x-\mu)^2}{2\sigma^2}}

E[X] = \int_{-\infty}^{\infty}x\cdot\frac{1}{\sqrt{2 \pi}}e^{\frac{-(x-\mu)^2}{2\sigma^2}} dx

= \mu

Var[X] = E[X^2] - (E[X])^2

\mu = 2, \sigma = 0.5

\mu, \sigma)

= \sigma^2

\mu, \sigma^2

\sigma

\sigma

\sigma

\sigma

\sigma

\sigma

\sigma

\sigma

68\%

95\%

99\%

P(\mu - \sigma \leq X \leq \mu + \sigma)

= \int_{\mu - \sigma}^{\mu + \sigma} \frac{1}{\sqrt{2\pi}} e^{ \frac{-(x - \mu)}{2 \sigma^2} } dx

\approx 0.68

P(\mu - 2\sigma \leq X \leq \mu + 2\sigma)

= \int_{\mu - 2\sigma}^{\mu + 2\sigma} \frac{1}{\sqrt{2\pi}} e^{ \frac{-(x - \mu)}{2 \sigma^2} } dx

\approx 0.95

Flu

\Omega

\Omega

```
import numpy as np
low = 1 //start
high = 72 //total_population
size = 9 //sample_size
np.random.randint(low, high, size)
```