diff --git a/source/main.ptx b/source/main.ptx index 5037111..93fc6b0 100644 --- a/source/main.ptx +++ b/source/main.ptx @@ -26,6 +26,7 @@ + diff --git a/source/notes/1-27.ptx b/source/notes/1-27.ptx new file mode 100644 index 0000000..ad9982b --- /dev/null +++ b/source/notes/1-27.ptx @@ -0,0 +1,290 @@ + + +
+ Thursday, Jan 27 + + +

+ This is an outline of the topics we covered in class. + These notes are not a substitute for your own note-taking. + I highly recommend that you take your own notes during class. + If you ever miss a class for any reason, reach out to another student in class to get a copy of their notes. +

+
+ + + + Continuous Distributions + + + +

+ Let X\in [0, 1] with f(x) = kx^{3/2}. + Find k. + + 1 = \int_0^1 f(x)\ dx \amp = \int_0^1 kx^{3/2} dx = \frac{2kx^{5/2}}{5}\bigg|_0^1 = \frac{2k}{5} - 0 + \Rightarrow \quad 1 \amp = \frac{2k}{5} \quad \Rightarrow \quad k = \frac{5}{2} + + Then, we can calculate probabilities, e.g.: + + \Pr\left(X \lt \frac{1}{2}\right) = \int_0^{1/2} \frac{5}{2}x^{3/2}\ dx = \frac{5}{2}\cdot \frac{2x^{5/2}}{5}\bigg|_0^{1/2} = \left(\frac{1}{2}\right)^{5/2} \approx 0.177. + +

+
+
+ +

+ Note: a pdf outputs probability densities, not probabilities. + To get probabilities, we must integrate. +

+ + + +

+ Let X be a continuous random variable with values in [a, b]. + The cumulative distribution function (cdf) is: + + F(x) = \Pr(X \leq x). + + To calculate it: + + F(x) = \int_a^x f(t)\ dt. + +

+
+
+ + + +

+ Let X \in [0, 1], f(x) = \frac{5}{2}x^{3/2}. + Then: + + F(x) = \int_0^x f(t)\ dt \amp = \int_0^x \frac{5}{2}t^{3/2}\ dt = \frac{5}{2}\cdot \frac{2t^{5/2}}{5}\bigg|_0^x + F(x) \amp = x^{5/2} + + Then, we can calculate probabilities, e.g.: + + \Pr\left(X \lt \frac{1}{2}\right) \amp = F\left(\frac{1}{2}\right) = \left(\frac{1}{2}\right)^{5/2} \approx 0.177 + \Pr(0.2 \leq X \leq 0.6) \amp = F(0.6) - F(0.2) = (0.6)^{5/2} - (0.2)^{5/2} \approx 0.261 + +

+
+
+ +

+ Given f(x), we can find F(x) by calculating: + + F(x) = \int_a^x f(t)\ dt. + + Given F(x), we can find f(x) by calculating: + + f(x) = F'(x). + +

+ + + +

+ Suppose a machine needs repairs on average twice per month. + Let T be the time until repair. + This is a Poisson process (\lambda = 2 per month). +

+
+
+ + + +

+ T is said to have the exponential distribution with parameter \lambda. We'll write T \sim \Exp(\lambda). The exponential density function is: + + f(t) = \lambda e^{-\lambda t}, \quad t \geq 0. + +

+
+
+ + + +

+ Let \lambda = 2, f(t) = 2e^{-2t}, t\geq 0. + Then: + + F(t) \amp = \int_0^t f(x)\ dx = \int_0^t 2e^{-2x}\ dx = -e^{-2x}\bigg|_0^x + \amp = -e^{-2t} - (-e^0) = 1 - e^{-2t}. + + So, e.g.: + + \Pr\left(T \leq \frac{3}{4}\right) \amp = F\left(\frac{3}{4}\right) = 1 - e^{-3/2} \approx 0.777 + \Pr(T \gt 1) \amp = 1 - \Pr(T \leq 1) = 1 - F(1) + \amp = 1 - (1 - e^{-2}) = e^{-2} \approx 0.135. + +

+
+
+ + +

+ The distributions Bin, Geom, Poiss, and Exp are conceptually linked. +

+ + + Relationship of common distributions + + + + + Counting Events + Time Until + + + + Discrete Time + Bin + Geom + + + + Continuous Time + Poiss + Exp + + +
+
+
+ + + + Joint Distributions + + + +

+ Let X take values x_1, x_2, \dotsc, x_n and Y take values y_1, y_2, \dotsc, y_m. + The joint distribution of X and Y is the collection of all values \Pr(X = x_i, Y = y_j) for every i, j combination. + The separarte distributions for X and Y are called marginal distributions. +

+
+
+ + + +

+ Suppose X \in \{1, 2, 3\}, Y \in \{0, 1\}, with joint distribution below. +

+ + + Example Joint Distribution + + + + + X = 1 + X = 2 + X = 3 + + + + Y = 0 + 0.1 + 0.15 + 0.05 + + + + Y = 1 + 0.2 + 0.2 + 0.3 + + +
+ +

+ We find the marginal distribution for X by summing along the columns: + + \Pr(X = 1) \amp = 0.3 + \Pr(X = 2) \amp = 0.35 + \Pr(X = 3) \amp = 0.35 + + We find the marginal distribution for Y by summing along the rows: + + \Pr(Y = 0) \amp = 0.3 + \Pr(Y = 1) \amp = 0.7 + +

+
+
+ + + +

+ Random variables X, Y are independent if: + + \Pr(X = x_i, Y = y_j) = \Pr(X = x_i)\Pr(Y = y_j) + + for every i, j combination. +

+
+
+ + + +

+ In the previous example: + + \Pr(X = 2, Y = 1) = 0.2 \neq (0.35)(0.7) = \Pr(X = 2)\Pr(Y = 1), + + so X, Y are not independent. +

+
+
+ + + +

+ Let X, Y indicate heads on the first and second flip, respectively, of a fair coin. + Then: +

+ + + Joint Distribution for Indicator Random Variables + + + + + X = 0 + X = 1 + + + + Y = 0 + 1/4 + 1/4 + + + + Y = 1 + 1/4 + 1/4 + + +
+ +

+ Then the marginal distributions are: + + \Pr(X = 0) \amp = \frac{1}{2} \amp \Pr(Y = 0) \amp = \frac{1}{2} + \Pr(X = 1) \amp = \frac{1}{2} \amp \Pr(Y = 1) \amp = \frac{1}{2} + + Then, for any a, b: + + \Pr(X = a, Y = b) = \frac{1}{4} = \frac{1}{2}\cdot \frac{1}{2} = \Pr(X = a)\Pr(Y = b). + + So X, Y are independent. +

+
+
+
+
\ No newline at end of file