diff --git a/st2334/cheatsheet.pdf b/st2334/cheatsheet.pdf index 37647a9..6c8fde7 100644 Binary files a/st2334/cheatsheet.pdf and b/st2334/cheatsheet.pdf differ diff --git a/st2334/cheatsheet.typ b/st2334/cheatsheet.typ index b1dfe3e..2a9954b 100644 --- a/st2334/cheatsheet.typ +++ b/st2334/cheatsheet.typ @@ -1,12 +1,11 @@ -#import "@preview/cram-snap:0.2.2": * +#set page(paper: "a4", flipped: true, margin: 0.5cm, columns: 4) +#set text(size: 9pt) +#set list(spacing: 1.2em) -#set page(paper: "a4", flipped: false, margin: 0.5cm) -#set text(size: 11pt) - -#show: cram-snap.with( - column-number: 2, -) - *Mututally Exclusive* - $A inter B = emptyset$ +- *Union* - $A union B = { x : x in A or x in B }$ +- *Intersection* - $A inter B = { x : x in A and x in B }$ +- *Complement* - $A' = { x : x in S and x in.not A }$ - $(A inter B)' = (A' union B')$ - *Multiplication* - R experiments performed sequentially. Then $n_i dot ... dot n_r$ possible outcomes for $r$ experiments - *Addition* - $e$ can be performed $k$ ways, and $k$ ways do not overlap : total ways: $n_1 + ... + n_k$ @@ -27,24 +26,31 @@ == Conditional Probability - $P(B|A)$ is probability of $B$ given that $A$ has occured -- $P(B|A) = P(A inter B) / P(A), P(A inter B) = P(B|A)P(A)$ +- $P(B|A) = P(A inter B) / P(A)$ +- $P(A inter B) = P(B|A)P(A)$ - $P(A|B) = (P(A)P(B|A)) / P(B)$ - $P(A inter B inter C) = P(A)P(B|A)P(C|B inter A)$ - *Independent* - $P(A inter B) = P(A)P(B), A perp B$ - If $P(A) != 0, A perp B arrow.l.r P(B|A) = P(B)$ (Knowledge of $A$ does not change $B$) +- *Independence vs Mutually exclusive* - + - $P(A) > 0 and P(B) > 0, A perp B arrow.double.r "not mutually exclusive"$ - Partition - $A_i...A_n$ is mutually exclusive and $union.big^n_i=1 A_i = S, A_i...A_n$ is partition of S - $P(B) = sum^n_(i=1) P(B inter A_i) = sum^n_(i=1) P(A_i)P(B|A_i)$ - $n = 2, P(B) = P(A)P(B|A) + P(A')P(B|A')$ - *Bayes Theorem* - $P(A_k|B) = (P(A_k)P(B|A_k)) / (sum^n_(i=1)P(A_i)P(B|A_i))$ - - $n = 2, P(A|B) = (P(A)P(B|A)) / (P(A)P(B|A) + P(A')P(B|A'))$ +- $n = 2, P(A|B) = (P(A)P(B|A)) / (P(A)P(B|A) + P(A')P(B|A'))$ == Random Variables -- PMF of $X - f(x) = cases(P(X=x) "if" x in R_X, 0 "otherwise")$ +- Notations: + - ${X = x} = {s in S : X(s) = x) in S$ + - ${X in A} = {s in S : X(s) in A) in S$ +== Probability Distributions +- PMF(_Discrete_) of $X - f(x) = cases(P(X=x) "if" x in R_X, 0 "otherwise")$ - Properties (*must* satisfy) + $f(x_i) >= 0, x_i in R_X$ + $f(x_i) = 0, x_i in.not R_X$ + $sum^infinity_(i=1)f(x_i) = 1$ -- PDF of $X$ is function that satisfies the following +- PDF(_Continuous_) of $X$ is function that satisfies the following + $f(x) >= 0, x in R_X "and" f(x) = 0, x in.not R_X$ + $integral_R_X f(x) dif x = 1$ + $a <= b, P(a <= X <= b) = integral^b_a f(x) dif x$ @@ -52,7 +58,8 @@ - CDF (Discrete) - $F(X) = P(X <=x)$ - $P(a<=X<=b) = P(X<=b) - P(X= 0$, not necessary $f(x) <= 1$ -- Expectation(Discrete): $E(X) = mu_X = sum_(x_i in R_X) x_i f(x_i)$ -- Expectation(Continuous): $E(X) = mu_X = integral^(infinity)_(-infinity)x_i f(x_i)$ +== Expectation +- Expectation(Discrete): $ E(X) = mu_X = sum_(x_i in R_X) x_i f(x_i) $ +- Expectation(Continuous): $ E(X) = mu_X = integral^(infinity)_(-infinity)x_i f(x_i) $ +- *Properties* + $E(a X + b) = a E(X) + b$ + $E(X + Y) = E(X) + E(Y)$ + Let $g(dot)$ be arbitrary function. - - $E[g(X)] = sum g(x)f(x)$ + - $ E[g(X)] = sum g(x)f(x) \ "or"\ E[g(X)] = integral_R_X g(x)f(x) $ - example - $E(X^2) = sum x^2f(x)$ - - $E[g(X)] = integral_R_X g(x)f(x)$ -- Variance - $sigma^2_x = V(X) = E(X - mu)^2$ +- Variance - $ sigma^2_x = V(X) = E(X - mu)^2 = E(X^2) - E(X)^2 $ - Discrete - $V(X) = sum (x-mu_x)^2 f(x)$ - Continuous - $V(X) = integral^(infinity)_(-infinity) (x-mu_x)^2 f(x)$ - - Properties + - *Properties* + $V(a X + b) = a^2V(X)$ + $V(X) = E(X^2) - E(X)^2$ + Standard Deviation = $sigma_x = sqrt(V(X))$ -== Joint Distribution -- Discrete - $f_(X, Y)(x,y) = P(X = x, Y = y)$ +== Joint Probability Function +- Discrete $ f_(X, Y)(x,y) = P(X = x, Y = y) $ +- *Properties* + $f(X,Y)(x, y) >= 0, (x, y) in R_(X,Y)$ + $f(X,Y)(x, y) = 0, (x, y) in.not R_(X,Y)$ + $sum^infinity_(i=1)sum^infinity_(j=1)(x_i,y_i) = 1$ -- Continuous - $P((X, Y) in D) = integral.double_((x, y) in D) f(x,y) dif y dif x$ +- Continuous $ P((X, Y) in D) = integral.double_((x, y) in D) f(x,y) dif y dif x $ - $P(a<=X<=b, c<=Y<=d) = integral^b_a integral^d_c f(x, y) dif y dif x$ +- *Properties* + $f_(X,Y)(x, y) >= 0$, for any $(x,y) in R_(X,Y)$ + $f_(X,Y)(x, y) = 0$, for any $(x,y) in.not R_(X,Y)$ + $integral^infinity_(-infinity)integral^infinity_(-infinity)f_(X,Y)(x, y) dif x dif y= 1$ -- Marginal Probability Distribution +=== Marginal Probability Distribution - Discrete - $f_X (x) = sum_y f_(X,Y)(x,y)$ - Continuous - $f_X (x) =integral^infinity_(-infinity) f_(X,Y)(x,y) dif y$ -- Conditional Distribution - $f_(Y|X) (y|x) = (f_(X,Y)(x,y)) / (f_X (x))$ +- Conditional Distribution - $ f_(Y|X) (y|x) = (f_(X,Y)(x,y)) / (f_X (x)) $ - If $f_X (x) > 0, f_(X,Y)(x,y) = f_X (x) f_(Y|X) (y|x)$ - $P(Y <= y | X = x) = integral^y_(-infinity) f_(Y|X)(y|x) dif y$ - $E(Y | X = x) = integral^infinity_(-infinity) y f_(Y|X)(y|x) dif y$