Discrete Probability II

Random Variables

  • A random variable is a function f:URf: U \rightarrow \mathbb{R}, where UU is the sample space.
  • It assigns a real number to each outcome in the sample space.
  • The randomness comes from the initial random selection of xx from UU.
  • Denoted by capital letters such as XX, YY, or ZZ.

Probability Distributions

  • A probability distribution is a function that assigns a probability to each member of a set, such that the probabilities add up to 1.
  • For a random variable XX, each possible value kk has a probability, written as Pr(X=k)Pr(X = k).
  • The probabilities of the values of XX constitute the probability distribution of XX.
  • Events have probabilities, while random variables have probability distributions.
  • Pr(X+Y=k)=(i,j):i+j=kPr((X=i)(Y=j))Pr(X + Y = k) = \sum_{(i,j): i+j=k} Pr((X = i) \land (Y = j))
  • Two random variables XX and YY are independent if Pr((X=x)(Y=y))=Pr(X=x)Pr(Y=y)Pr((X = x) \land (Y = y)) = Pr(X = x) \cdot Pr(Y = y).

Expectation

  • Expectation E(X)E(X) of a random variable XX is a representative value, also called the expected value or mean.
  • E(X)=kkPr(X=k)E(X) = \sum_{k} k \cdot Pr(X = k), where the sum is over all possible values of XX.
  • E(c)=cE(c) = c if cc is a constant.
  • E(αX)=αE(X)E(\alpha X) = \alpha E(X) if α\alpha is a constant.

Linearity of Expectation

  • For any random variables XX and YY, E(X+Y)=E(X)+E(Y)E(X + Y) = E(X) + E(Y).
  • If XX and YY are independent, then E(XY)=E(X)E(Y)E(XY) = E(X)E(Y).

Median

  • The median mm of a random variable XX is a real number such that Pr(Xm)12Pr(X \le m) \ge \frac{1}{2} and Pr(Xm)12Pr(X \ge m) \ge \frac{1}{2}.

Mode

  • The mode of a random variable XX is the value gg for which Pr(X=g)Pr(X = g) is greatest.

Variance

  • Variance Var(X)Var(X) of a random variable XX measures how far its values tend to be from its expected value μ=E(X)\mu = E(X).
  • Var(X)=E((Xμ)2)Var(X) = E((X - \mu)^2)
  • Standard deviation of X=Var(X)X = \sqrt{Var(X)}.
  • Var(X)=E(X2)μ2=E(X2)E(X)2Var(X) = E(X^2) - \mu^2 = E(X^2) - E(X)^2
  • If XX and YY are independent, then Var(X+Y)=Var(X)+Var(Y)Var(X + Y) = Var(X) + Var(Y).

Chebyshev’s Inequality

  • For any random variable XX with expectation μ\mu and variance σ2\sigma^2, and any tR+t \in \mathbb{R}^+, the probability that XX is at least tt standard deviations away from its mean is at most 1t2\frac{1}{t^2}: Pr(Xμtσ)1t2Pr(|X - \mu| \ge t\sigma) \le \frac{1}{t^2}.

Uniform Distribution

  • Each integer between aa and bb inclusive has the same probability, and all other integers have zero probability.
  • Pr(X = x) = {\begin{array}{ll} \frac{1}{b-a+1}, & \text{if } a \le x \le b; \ 0, & \text{otherwise.} \end{array}
  • E(X)=a+b2E(X) = \frac{a+b}{2}
  • Var(X)=(ba+1)2112Var(X) = \frac{(b - a + 1)^2 - 1}{12}

Binomial Distribution

  • A Bernoulli trial is a random experiment with two possible outcomes: success (probability pp) and failure (probability q=1pq = 1-p).
  • X = {\begin{array}{ll} 1, & \text{with probability } p; \ 0, & \text{with probability } 1-p. \end{array}
  • E(X)=pE(X) = p
  • Var(X)=p(1p)Var(X) = p(1 - p)
  • The binomial distribution gives the probability of kk successes in nn Bernoulli trials: Pr(Z=k)=(nk)pk(1p)nkPr(Z = k) = \binom{n}{k} p^k (1 - p)^{n-k}.
  • ZBin(n,p)Z \sim Bin(n, p)
  • E(Z)=npE(Z) = np
  • Var(Z)=np(1p)Var(Z) = np(1 - p)

Poisson Distribution

  • Pr(X=k)=eμμkk!Pr(X = k) = e^{-\mu} \frac{\mu^k}{k!}, for all kN0k \in \mathbb{N}_0.
  • XPoisson(μ)X \sim Poisson(\mu)
  • E(X)=μE(X) = \mu
  • Var(X)=μVar(X) = \mu
  • The Poisson distribution is often used as an approximation to the Binomial distribution when nn is large and npnp is small.

Geometric Distribution

  • Pr(X=k)=(1p)k1pPr(X = k) = (1 - p)^{k-1}p, for every kNk \in \mathbb{N}.
  • XGeom(p)X \sim Geom(p)
  • E(X)=1pE(X) = \frac{1}{p}
  • Var(X)=1pp2Var(X) = \frac{1-p}{p^2}
  • The geometric distribution has the memoryless property.
  • If XGeom(p)X \sim Geom(p) and tNt \in \mathbb{N}, then the distribution of XtX-t given that XtX \ge t is also geometric with probability pp.

Coupon Collector's Problem

  • Let random variable ZZ be the number of trials until we have seen each possible outcome at least once.
  • E(Z)=nH<em>nE(Z) = nH<em>n, where H</em>nH</em>n is the nn-th harmonic number.
  • H<em>nlog</em>en+γH<em>n \approx \log</em>e n + \gamma, where γ\gamma is the Euler-Mascheroni constant.
  • E(Z)n(logen+γ)E(Z) \approx n(\log_e n + \gamma)
  • E(Z)nlogenE(Z) \approx n \log_e n