Skip to content

Commit 82e7781

Browse files
committed
TOP Notes until first midterm.
1 parent 18d8c53 commit 82e7781

6 files changed

Lines changed: 258 additions & 11 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Basic Combinatorics
3+
date: 2025-09-04
4+
---
5+
6+
## Counting principles
7+
8+
Let $n_1,\dots,n_k$ be the numbers of options in $k$ independent choices (e.g. rice, protein, beans, vegetables). The multiplication principle says that the total number of possible outcomes is
9+
$$
10+
n_1 \times n_2 \times \cdots \times n_k.
11+
$$
12+
13+
When different cases must be considered separately, the addition principle says that if there are $m_1,\dots,m_\ell$ possibilities in each case, then the total number is $m_1 + \cdots + m_\ell$.
14+
15+
## Permutations
16+
17+
A **permutation** of $n$ distinct objects is an ordering. There are $n! = n\times(n-1)\times\cdots\times 1$ ways to arrange $n$ objects.
18+
> Example: five people solving five exam problems can assign problems to people in $5!=120$ ways.
19+
20+
## Combinations and binomial coefficients
21+
22+
To choose $k$ objects from $n$ without regard to order, count the ordered selections and then divide by $k!$. The number of subsets of size $k$ is
23+
$$
24+
{n \choose k} = \frac{n!}{k!\,(n-k)!},
25+
$$
26+
27+
called a **binomial coefficient**.
28+
> Example: from 30 students, the number of ways to choose 3 for a presentation is ${30 \choose 3}$.
29+
30+
The binomial theorem expands $(a+b)^n$ as
31+
$$
32+
(a+b)^n=\sum_{k=0}^{n} {n\choose k} a^{n-k} b^{k}.
33+
$$
34+
35+
Useful identities include ${n \choose k}={n \choose n-k}$ and the recursive sum $\sum_{i=0}^{k-1} {n-i\choose k-i-1}={n\choose k}$.
36+
37+
## Multinomial coefficients
38+
39+
To divide $n$ items into $r$ groups of sizes $n_1,\dots,n_r$ with $n_1+\cdots+n_r=n$, the number of ways is
40+
$$
41+
\frac{n!}{n_1!n_2!\cdots n_r!}.
42+
$$
43+
44+
For instance, arranging 30 students into ten presentation groups of three has ${30 \choose 3,3,\dots,3} = \tfrac{30!}{(3!)^{10}}$ possibilities.
45+
46+
## Multiset permutations
47+
48+
If a word has repeated letters, e.g.\ P,E,P,P,E,R, the number of distinct rearrangements is $\tfrac{6!}{3!\,2!}$; count all $6!$ permutations and divide by the $3!$ ways to reorder the three P’s and $2!$ ways to reorder the two E’s.
49+
50+
## Stars and bars: integer partitions
51+
52+
To distribute $n$ identical candies among $r$ kids so each gets at least one, find the number of positive integer solutions to $x_1+\cdots+x_r=n$. Imagine placing $r-1$ dividers into $n-1$ slots to separate $n$ candies; there are ${n-1 \choose r-1}$ solutions. If zero candies are allowed, give each child one candy first and then distribute the remaining $n+r-1$ candies; the answer becomes ${n+r-1\choose r-1}$.
53+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Axioms of Probability
3+
date: 2025-09-06
4+
---
5+
6+
## Sample space, events and set operations
7+
8+
A **sample space** $S$ is the set of all possible outcomes, and an **event** is a subset of $S$. Sets can be combined using intersection ($A\cap B$), union ($A\cup B$), complement ($A^c$) and difference ($B\setminus A$); De Morgan’s laws $(A\cap B)^c=A^c\cup B^c$ and $(A\cup B)^c=A^c\cap B^c$ help relate complements.
9+
10+
## Probability measure axioms
11+
12+
A probability measure $P$ assigns numbers to events such that $0\le P(E)\le 1$, $P(\emptyset)=0$, $P(S)=1$, and $P(E_1\cup E_2\cup\cdots)=P(E_1)+P(E_2)+\cdots$ for disjoint events. Probabilities can be interpreted as areas in a Venn diagram.
13+
14+
### Identities and the inclusion–exclusion principle
15+
16+
From additivity one derives useful identities:
17+
18+
- Complement: $P(A^c)=1-P(A)$.
19+
- Decomposition: $P(B)=P(A\cap B)+P(B\setminus A)$.
20+
- Union: $P(A\cup B)=P(A)+P(B)-P(A\cap B)$, and more generally for $n$ events the inclusion–exclusion formula sums intersections of increasing size with alternating signs. The union bound states $P(E_1\cup\cdots\cup E_n)\le P(E_1)+\cdots+P(E_n)$.
21+
22+
## Uniform probability on finite spaces
23+
24+
If $S$ has finitely many equally likely outcomes, then $P(E)=\frac{\#E}{\#S}$.
25+
> Example: two dice have $36$ equally likely outcomes; the event “sum = 7” contains six outcomes, so the probability is $6/36=1/6$. Drawing 7 cards from a 52‑card deck, the probability of getting a four‑of‑a‑kind is
26+
$$
27+
P(E)=\frac{13\cdot {48\choose 3}}{{52\choose 7}}.
28+
$$
29+
30+
In the birthday problem with 23 people, the probability that at least two share a birthday is $1-\frac{365\cdot364\cdots(365-22)}{365^{23}}$, which exceeds $\tfrac{1}{2}$.
31+
32+
## Examples and applications
33+
34+
- **Coin‑flip experiment:** sample space $\{HH,HT,TH,TT\}$; event “flips differ” has two outcomes, so $P=2/4=1/2$.
35+
- **Presentation order:** the six permutations of three presenters form the sample space; the event “Alice goes first” has two outcomes, giving probability $1/3$.
36+
- **Derangements:** permuting $n$ students’ seats, let $A_k$ be the event that student $k$ stays put. By inclusion–exclusion, the probability at least one student remains fixed is $\sum_{k=1}^n(-1)^{k-1}{n\choose k}\frac{(n-k)!}{n!}$.
37+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Conditional Probability and Independence
3+
date: 2025-09-11
4+
---
5+
6+
## Conditional probability
7+
8+
For events $E$ and $F$ with $P(F)>0$, the **conditional probability** of $E$ given $F$ is
9+
$$
10+
P(E\mid F)=\frac{P(E\cap F)}{P(F)}.
11+
$$
12+
13+
Thinking of $F$ as a new sample space helps interpret $P(\cdot\mid F)$. The product rule follows immediately: $P(E\cap F)=P(E\mid F)P(F)$, and more generally for events $E_1,\dots,E_n$ one can write
14+
$$
15+
P(E_1\cap\cdots\cap E_n)=P(E_1\mid E_2\cap\cdots\cap E_n)\,P(E_2\mid E_3\cap\cdots\cap E_n)\cdots P(E_n).
16+
$$
17+
18+
The **law of total probability** states that if $F_1,\dots,F_m$ form a partition of $S$, then
19+
$$
20+
P(E)=\sum_{i=1}^m P(E\mid F_i)\,P(F_i).
21+
$$
22+
23+
**Bayes’ formula** expresses the reversed conditional:
24+
$$
25+
P(F\mid E)=\frac{P(E\mid F)\,P(F)}{P(E)}=\frac{P(E\mid F)\,P(F)}{P(E\mid F)\,P(F)+P(E\mid F^c)\,P(F^c)}.
26+
$$
27+
28+
> Examples
29+
> - Alice flips a fair coin to decide between two classes; the probability she gets an A overall is $0.9\cdot 0.5 + 0.8\cdot 0.5=0.85$.
30+
> - In a Covid test with 50% prevalence, sensitivity 96% and false‑positive rate 2%, if you test positive then $P(\text{Covid}\mid\text{positive}) = \frac{0.96\cdot 0.5}{0.96\cdot 0.5+0.02\cdot 0.5} = \frac{48}{49}$.
31+
> - From an urn containing two unusual dice, drawing and rolling a 3 gives probability $P(\text{dice A}\mid\text{roll 3})=2/3$.
32+
33+
## Independence
34+
35+
Events $E$ and $F$ are **independent** if
36+
$$
37+
P(E\cap F)=P(E)\,P(F).
38+
$$
39+
This means that knowing $F$ does not change the probability of $E$. Independence is distinct from disjointness (mutually exclusive events): independent events can both occur. If $E$ and $F$ are disjoint and independent, then one must have probability zero. Independence extends to families of events: events $A_1,\dots,A_n$ are *pairwise independent* if every pair is independent, and *mutually independent* if $P(A_{i_1}\cap\cdots\cap A_{i_k})=P(A_{i_1})\cdots P(A_{i_k})$ for every $k\ge 2$. Pairwise independence does not imply mutual independence; for three coins, the events “first flip is heads,” “second flip is tails” and “all flips are the same” are pairwise independent but not mutually independent.
40+
41+
## Applications
42+
43+
- **Product law**: rolling two dice, the event “sum=8” and the event “first roll is 2” are not independent since $P(E\cap F)=\tfrac{1}{36}\ne \tfrac{5}{36}\cdot \tfrac{1}{6}$; but “sum=7” and “first roll is 2” are independent.
44+
- **Law of total probability and Bayes’ rule** appear in computing disease tests or decision trees as above.
45+
- **Repeated trials**: if you repeatedly roll a die, the probability that the first 6 appears on the $n$‑th roll is $(5/6)^{\,n-1}\,(1/6)$ and the probability of exactly $k$ successes in $n$ rolls is given by the binomial distribution${n \choose k}(1/6)^k(5/6)^{\,n-k}$.
46+
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: Discrete Random Variables
3+
date: 2025-09-16/18/23/25
4+
---
5+
6+
## Expectation
7+
For a discrete random variable $X$ with p.m.f. $p_X(t)=P[X=t]$,
8+
$$
9+
\E[X] = \sum_{t} t p_X(t), \quad \E[f(X)] = \sum_t f(t) p_X(t),
10+
$$
11+
12+
**Interpretations**
13+
- Weighted average over the values of $X$: $\sum_t t P[X=t]$.
14+
- Weighted average over outcomes $\omega$ in the sample space $S$: $\sum_{\omega\in S} X(\omega) P(\{\omega\})$.
15+
16+
> Examples:
17+
> - Fair die $X\in\{1,\dots,6\}$: $\E[X]=3.5$.
18+
> - Heads in three fair flips $Y\in\{0,1,2,3\}$: $\E[Y]=1.5$.
19+
> - Indicator $\mathbf{1}_A$: $\E[\mathbf{1}_A]=P(A)$.
20+
21+
## Linearity of expectation
22+
For random variables $X,Y$ and scalar $a\in\mathbb{R}$,
23+
$$
24+
\E[aX+Y] = a \E[X] + \E[Y].
25+
$$
26+
No independence required.
27+
28+
**Counting-by-indicators trick**
29+
If $X=\sum_{i=1}^n \mathbf{1}_{A_i}$ counts how many events $A_i$ occur, then
30+
$$
31+
\E[X] = \sum_{i=1}^n P(A_i).
32+
$$
33+
> Example: number of fixed points in a random permutation - $\E[X]=1$.
34+
35+
## Variance
36+
Variance measures spread around the mean:
37+
$$
38+
\operatorname{Var}(X) = \E[(X-\E X)^2] = \E[X^2] - (\E X)^2.
39+
$$
40+
Useful identities:
41+
- For constants $a,b$: $\operatorname{Var}(aX+b)=a^2 \operatorname{Var}(X)$.
42+
- For an indicator: $\operatorname{Var}(\mathbf{1}_A)=P(A)\big(1-P(A)\big)$.
43+
- If $X=\sum_{i=1}^n \mathbf{1}_{A_i}$ with independent indicators, then
44+
$$
45+
\operatorname{Var}(X)=\sum_{i=1}^n P(A_i)\big(1-P(A_i)\big).
46+
$$
47+
48+
## Inclusion–Exclusion via indicators
49+
Using $\mathbf{1}_{A^c} = 1 - \mathbf{1}_A$ and expanding
50+
$\mathbf{1}_{\cup_i E_i} = 1 - \prod_{i=1}^n (1-\mathbf{1}_{E_i})$, then taking expectations yields
51+
$$
52+
P\Big( \bigcup_{i=1}^n\ E_i \Big)
53+
= \sum_{k=1}^n (-1)^{k-1}
54+
\sum_{1 \leq i_1 < \cdots < i_k \leq n}
55+
P(\E_{i_1} \cap \cdots \cap \E_{i_k}).
56+
$$
57+
58+
### Bernoulli
59+
60+
If $X\in\{0,1\}$ takes value $1$ with probability $p$, we write $X\sim\operatorname{Ber}(p)$. Its pmf is $p_X(1)=p$, $p_X(0)=1-p$; the expectation is $p$, and the variance is $p(1-p)$.
61+
62+
### Binomial
63+
64+
Let $X$ be the total number of successes in $n$ independent Bernoulli$(p)$ trials. Then $X\sim \operatorname{Bin}(n,p)$ and can be written $X=X_1+\cdots+X_n$ with $X_i\sim\operatorname{Ber}(p)$. The pmf is
65+
$$
66+
P(X=k) = {n\choose k} p^k (1-p)^{ n-k}.
67+
$$
68+
69+
Using linearity of expectation, $\E[X]=\sum_{i=1}^n \E[X_i]=np$, and the variance is $\operatorname{Var}(X)=np(1-p)$.
70+
> Examples: the number of heads in 3 fair flips follows $\operatorname{Bin}(3,\tfrac12)$; when rolling 10 dice, the number of sixes follows $\operatorname{Bin}(10,\tfrac16)$.
71+
72+
### Poisson
73+
74+
A **Poisson** random variable $X\sim \operatorname{Poi}(\lambda)$ has pmf
75+
$$
76+
P(X=k) = \frac{\lambda^k e^{-\lambda}}{k!}, \quad k=0,1,2,\dots.
77+
$$
78+
79+
From the series expansion of $e^\lambda$, these probabilities sum to one. The expectation and variance are both $\lambda$. A Poisson variable arises as an approximation to $\operatorname{Bin}(n,p)$ when $n$ is large and $p$ is small with $np=\lambda$.
80+
81+
> For example, the number of 5‑star characters obtained in 500 draws with a 0.6% rate is approximately $\operatorname{Poi}(3)$.
82+
83+
### Geometric
84+
85+
If you repeatedly flip a $p$‑biased coin until the first head appears, the total number of flips $X$ (including the successful flip) follows a **geometric** distribution with parameter $p$, denoted $X\sim \operatorname{Geom}(p)$. The pmf is
86+
$$
87+
P(X=k) = (1-p)^{k-1} p,\quad k=1,2,\dots,
88+
$$
89+
90+
since the first $k-1$ flips must be tails and the $k$‑th flip a head. Summation identities yield
91+
$$
92+
\E[X] = \frac{1}{p},\qquad \operatorname{Var}(X) = \frac{1-p}{p^2}.
93+
$$
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"slug": "01-intro",
4+
"title": "1 - Basic combinatorics",
5+
"date": "2025-09-04"
6+
}
7+
,
8+
{
9+
"slug": "02-axioms",
10+
"title": "2 - Axioms of probability",
11+
"date": "2025-09-06"
12+
}
13+
,
14+
{
15+
"slug": "03-conditional-independence",
16+
"title": "3 - Conditional Probability and Independence",
17+
"date": "2025-09-11"
18+
}
19+
,
20+
{
21+
"slug": "04-05-drv",
22+
"title": "4/5 - Discrete random variables",
23+
"date": "2025-09-16/18/23/25"
24+
}
25+
]

notes/metadata/courses.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
}
88
,
99
{
10-
"slug": "J-N5",
11-
"title": "Japanese N5 Level",
12-
"semester": "Nan",
13-
"instructor": "Mr. Yano"
10+
"slug": "MATH-UA-333",
11+
"title": "Theory of Probability (MATH-UA 333)",
12+
"semester": "Fall 2025",
13+
"instructor": "Prof. Yu"
1414
}
1515
,
1616
{
@@ -19,11 +19,4 @@
1919
"semester": "Fall 2025",
2020
"instructor": "Prof. Shatah"
2121
}
22-
,
23-
{
24-
"slug": "Convex",
25-
"title": "Convex Optimization",
26-
"semester": "NAN",
27-
"instructor": "Self-study"
28-
}
2922
]

0 commit comments

Comments
 (0)