Population and Distribution

Large N & Leeuwenhoek (70700173)

Yue Hu

Open Question

Why does Dr. Hu almost always “sacrifice” the programming teaching?

Options:

  • He’s not good at it
  • It’s too easy for teaching
  • It’s worthless to learn programming
  • It’s frustrated to teach programming

Overview

  1. Properties of distributions
  2. Types of distributions
  3. Distribution → Prediction

1 Properties of distributions

1.1 (Probability) distribution

The mathematical function that gives the probabilities of occurrence of different possible outcomes for an experiment.

  • Probability Mass Function (PMF):
    • Discrete
    • Histogram
  • Probability Density Function (PDF):
    • Continuous
    • Density plot
  • Cumulative density function (CDF): \(F(x) = P(X \leq x) = \int_{-\infty}^{x} f(t) \, dt\)

1.2 Integral

1.3 PDF and CDF

1.4 Properties of PMF/PDF

  • None-negative

  • Total area = \(\int^{+\infty}_{-\infty}f(x)dx = 1.\)

  • \(P(x = c) = \int^c_cf(x)dx = 0.\)

  • \[P(a\leq x \leq b) = \int^b_af(x)x = \int^b_{-\infty}f(x)dx -\int^a_{-\infty}f(x)dx.\]

  • CDF: \(P(X\leq x)\), PDF = \(\frac{\partial CDF}{\partial X}.\)

  • Power ~
  • Sum ~
  • Product ~

1.5 Partial derivative

1.6 Describe a distribution: Say hello to moments, again

Moments: Specific quantitative measures of the shape of a function.

Physics

  • 0th: Total mass
  • 1st: Center of mass
  • 2ed: Rotational inertia

Statistics

1.7 About Means

  • Arithmetic Mean (AM):
    • \[\bar{x} = \frac{x_1 + x_2 + x_3 + \ldots + x_n}{n} = \frac{\sum x_i}{n}\]
  • Geometric Mean (GM):
    • \[GM = \left( x_1 \cdot x_2 \cdot x_3 \cdot \ldots \cdot x_n \right)^{\frac{1}{n}} = \left( \prod x_i \right)^{\frac{1}{n}}\]
  • Harmonic Mean (HM):
    • \[HM = \frac{n}{\left(\frac{1}{x_1} + \frac{1}{x_2} + \frac{1}{x_3} + \ldots + \frac{1}{x_n}\right)} = \frac{n}{\sum \left(\frac{1}{x_i}\right)}\]
    • A special type of weighted mean

2 Types of Distribution

2.1 Distribution: Types and Examples

Discrete

Jacob Bernoulli (1654–1705)

Siméon Poisson (1781–1804)

Continuous

Gerolamo Cardano (1501–1576)

Clarl F. Gauss (1777–1855)

2.2 Bernoulli

Throwing a fair coin

Bernoulli: Let \(k\in 0, 1,\) p is P(X = 1)

CDF: \[ F = \begin{cases} 0, if\ k<0,\\ 1 - p, if\ k \in[0, 1),\\ 1, if\ k \geq 1. \end{cases} \]

PMF:

\[f(k;p) = p^k(1 - p)^{1 - k}\]

  • μ = p
  • σ2 = p(1 - p)

2.3 Binomial distribution

Throwing multiple fair coins

PMF: \(f(k; n, p) = {n \choose k}p^k(1 - p)^{n - k}\) Why combination?

  • n, number of trials;
  • p, the success probability in each trial;
  • k, the number of success
  • μ = np
  • σ2 = np(1 - p)

2.4 Application

A university hired 100 graduate students per year, 25 female and 75 male. Given that the general hired ratio is 4:6 for women:men, what’s the chance that the employment is gender discrimination free?

Let’s assume the employment of any student does not affect the chance of hiring others. Why is this important?

\[PDF = {n \choose r}\pi^r(1 - \pi)^{n - r}\]

\[P(25) = {100 \choose 25}0.4^{25}(1 - 0.4)^{75} = 0.0006.\]

Implication:

Very unlikely.

2.5 Poisson Distribution

PMF: \(Pr(X{=}k)= \frac{\lambda^k e^{-\lambda}}{k!},\)

k is the number of occurrences

μ = λ;
σ2 = λ.

Application

  1. Number of Network Failures per Week
  2. Number of Website Visitors per Hour
  3. Number of Arrivals at a Restaurant
  4. Number of Calls per Hour at a Call Center
  5. Average Number of Storms in a City
  6. Number of Emergency Calls Received by a Hospital Every Minute

2.6 Uniform Distribution

CDF: \[F = \begin{cases} 0, if\ x < a,\\ \frac{x - a}{b - a}, if\ x \in[a, b),\\ 1, if\ x \geq b. \end{cases}\]

PDF:

\[f(x) = \begin{cases} 1/(b - a), if\ x \in [a, b],\\ 0, otherwise.\end{cases}\]

2.7 Moments of the Uniform Distribution

\[\begin{align} \mu =& \int^b_a x \frac{1}{b - a} dx, \\ =& \frac{1}{b - a}\int^b_axdx, \\ =& \frac{1}{b - a}\frac{x^2}{2}|^b_a, \\ =& \frac{b^2 - a^2}{2(b - a)}, \\ =& \frac{a + b}{2}. \end{align}\]

\[\begin{align} \sigma^2 =& \sum x^2p(x) - \mu^2, \\ =& \int^b_ax^2\frac{1}{b - a}dx - (\frac{a + b}{2})^2, \\ =& \frac{1}{b - a}\int^b_ax^2dx - (\frac{a + b}{2})^2,\\ =& \frac{1}{b - a}\frac{x^3}{3}|^b_a - (\frac{a + b}{2})^2,\\ =& \frac{b^3 - a^3}{3(b - a)} - (\frac{a + b}{2})^2 = \frac{(b - a)^2}{12}. \end{align}\]

2.8 Application of the Uniform Distribution

Any type of random number generators.

Discrete uniform distribution

The probability of occurrence of the events is equally likely and falls within a finite set of values

E.g.:

  1. Guessing a birthday of a stranger
  2. Raffle tickets
  3. Lucky Draw Contest
  4. Throwing a Dart

2.9 Normal Distribution: Gaussian curve

PDF:

\[f(x) = \varphi(\frac{x - \mu}{\sigma}) = \frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x - \mu)^2}{2\sigma^2}}.\]

When μ = 0; σ2 = 1, standard normal distribution.

Z Score:

\(Z = \frac{x - \mu}{\sigma}\)\(f(x) = \frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(z)^2}{2}}\)

2.10 Z to Probability

Old days

Cool kids

pnorm(<Z-score>)

2.11 Application

Given that the average IQ in the U.S. is 100 with a standard deviation of 16, what’s the probability a US citizen’s IQ is higher than 125 or lower than 85?

\(Z_1 = \frac{125 - 100}{16} =\) 1.5625

\(Z_2 = \frac{85 - 100}{16} =\) -0.9375

  • P(X ≥ 125) = 1 - pnorm((125 - 100)/16) = 0.0590851
  • P(X < 85) = pnorm((85 - 100) / 16) = 0.1742507

What’s the substantive statement?

p-value: \(P(z\leq x)\).

We’ll talk about about that later.

3 Distribution → Prediction

3.1 Meaning

“What would you guess if asking you the chance of heads to toss a coin?”

  1. μ = E(X) = ∑ xp(x)
  2. σ2 = E(x - μ)2 = ∑ (x - μ)2p(x)

Rule of expectation

  • E(aX + bY + c) = aE(X) + bE(Y) + c;
  • var(aX + bY) = a2var(x) + b2var(y) + 2ab•cov(x, y)

3.2 Application

X is the reward generator of a paid module of a video game, the seed of which is based on tossing a fair dice (😑). When the dice is tossed, the reward is produced following this function: g(X) = 2 + 3X. What’s the expectation of rewards a whale can get by purchasing this module?

\[E(X) = \sum xp(x) = 1\times\frac{1}{6} + 2\times\frac{1}{6} +\dots+6\times\frac{1}{6} = 3.5.\]

Then \[E(g(x)) = E(2 + 3X) = 2 + 3\times 3.5 = 12.5.\]

The whale can gain 12.5 points of rewards by paying for this module.

3.3 Take-home point

4 Appendix

4.1 Bonus: What’s derivative

4.2 Want to watch more?