chapter one

This commit is contained in:
2026-05-19 23:33:50 -07:00
parent 45ceef48cd
commit d176120b7e
8 changed files with 526 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
.env
+9
View File
@@ -4,3 +4,12 @@ My roadmap for becoming competent quant and capable of creating automated tradin
Current Goal: **Learn Quantitative Foundations** Current Goal: **Learn Quantitative Foundations**
## Other
issue templating
reading # blue
coding # green
exam # orange
writeup # purple
research # yellow
bug # red (for when your code breaks)
@@ -0,0 +1,203 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "a6732353-51d5-4478-9cf8-5834e57e5a4e",
"metadata": {},
"source": [
"# Chapter 1 Notes"
]
},
{
"cell_type": "markdown",
"id": "48d9ec9e-83da-40ca-ae79-3c45f8af137c",
"metadata": {},
"source": [
"## Main Concepts\n",
"\n",
"Outcome: A result of a random experiment.\n",
"\n",
"Sample Space: The set of all possible outcomes.\n",
"\n",
"Event: A subset of the sample space.\n",
"\n",
"Inclusion-exclusion principle holds for probability\n",
"\n",
"Consider a sample space S. If S is a countable set, this refers to a discrete probability\n",
"mode\n"
]
},
{
"cell_type": "markdown",
"id": "7ac122be-50b2-423c-b88f-e4b3327b21bd",
"metadata": {},
"source": [
"## Example Problems"
]
},
{
"cell_type": "markdown",
"id": "7fb87a35-a470-4d98-935f-80c814e3f95d",
"metadata": {},
"source": [
"Example 1.5 - soln\n",
"\n",
"- there are 10 people with white shirts and 8 people with red shirts;\n",
"- 4 people have black shoes and white shirts\n",
"- 3 people have black shoes and red shirts\n",
"- the total number of people with white or red shirts or black shoes is 21\n",
"\n",
"Let A be the set of people with white shirts, B be the set of people with red shirts and let C be the set of people with black shoes.\n",
"\n",
"\\begin{align*}\n",
"|A|=10 \\\\\n",
"|B|=8 \\\\\n",
"|A \\cap C| = 4 \\\\\n",
"|B \\cap C| = 3 \\\\\n",
"|A \\cup B \\cup C| = 21\n",
"\\end{align*}\n",
"\n",
"Now we solve for $|C|$:\n",
"\n",
"\\begin{align*}\n",
"|A| + |B| + |C| - |A \\cap B| - |A \\cap C| - |B \\cap C| + |A \\cap B \\cap C| = 21 \\\\\n",
"10 + 8 + |C| - 0 - 4 - 3 - 0 = 21 \\\\\n",
"18 + |C| - 7 = 21 \\\\\n",
"|C| + 11 = 21 \\\\\n",
"|C| = 10\n",
"\\end{align*}\n",
"\n",
"$\\therefore$ number of people with black shoes is 10\n"
]
},
{
"cell_type": "markdown",
"id": "72b40733-531a-48f3-9879-75601684afc2",
"metadata": {},
"source": [
"Example 1.11 - soln\n",
"\n",
"Suppose we have the following information:\n",
"1. There is a 60 percent chance that it will rain today.\n",
"2. There is a 50 percent chance that it will rain tomorrow.\n",
"3. There is a 30 percent chance that it does not rain either day.\n",
"\n",
"T = rains\n",
"F = no rain\n",
"\n",
"$S = \\{(F, F), (F, T), (T, F), (T, T)\\}$\n",
"\n",
"$P((T, F) \\cup (T, T)) = 0.6$\n",
"\n",
"$P((F, T) \\cup (T, T)) = 0.5$\n",
"\n",
"$P((F, F)) = 0.3$\n",
"\n",
"\\begin{align*}\n",
"P(S) = 1 \\\\\n",
"P(\\{(F, F)\\} \\cup \\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 1 \\\\\n",
"P((F,F)) + P(\\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 1 \\\\\n",
"0.3 + P(\\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 1 \\\\\n",
"P(\\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 0.7 \\\\\n",
"P(\\{(F, T)\\} \\cup \\{(T, T)\\}) + P((T, F)) = 0.7 \\\\\n",
"0.5 + P((T, F)) = 0.7 \\\\\n",
"P((T, F)) = 0.2 \\\\\n",
"P(\\{(T, F)\\} \\cup \\{(T, T)\\}) + P((F, T)) = 0.7 \\\\\n",
"P((F, T)) = 0.1\n",
"\\end{align*}\n",
"\n",
"Find the following probabilities:\n",
"\n",
"a. The probability that it will rain today or tomorrow.\n",
"\n",
"\\begin{align*}\n",
"P((T, F) \\cup (F, T) \\cup (T, T)) = 0.7\n",
"\\end{align*}\n",
"\n",
"b. The probability that it will rain today and tomorrow.\n",
"\n",
"\\begin{align*}\n",
"P((T, T)) = 1 - 0.3 - 0.2 - 0.1 = 0.4\n",
"\\end{align*}\n",
"\n",
"c. The probability that it will rain today but not tomorrow.\n",
"\n",
"\\begin{align*}\n",
"P((T, F)) = 0.2\n",
"\\end{align*}\n",
"\n",
"d. The probability that it either will rain today or tomorrow, but not both.\n",
"\n",
"\\begin{align*} \n",
"P(\\{(T, F)\\} \\cup \\{(F, T)\\}) = P((T, F)) + P((F, T)) = 0.2 + 0.1 = 0.3\n",
"\\end{align*}\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "8b5131dd-5ebd-4156-b808-f8df273317fb",
"metadata": {},
"source": [
"Example 1.12 - soln\n",
"\n",
"$S = \\{ -1, 0, 1, 2, 3, ... \\}$\n",
"\n",
"$\\forall x \\in S, P(x) = \\frac{1}{2^{x + 2}}$\n",
"\n",
"What is the probability that I win more than or equal to 1 dollar and less than 4 dollars?\n",
"\n",
"\\begin{align*} \n",
"P({1, 2, 3}) = P(1) + P(2) + P(3) \\\\\n",
"= 1/8 + 1/16 + 1/32\n",
"\\end{align*}\n",
"\n",
"What is the probability that I win more than 2 dollars?\n",
"\n",
"\\begin{align*} \n",
"\\sum_{i=3}^{\\infty} P(i) = P(3) + P(4) + P(5) + P(6) + ... \\\\\n",
"= 1/32 + 1/64 + 1/128 + 1/256 + ... \\\\\n",
"=\\frac{\\frac{1}{32}}{1 - \\frac{1}{2}}\n",
"=\\frac{1}{16}\n",
"\\end{align*}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69962960-18a6-436b-b9eb-9a6dfae7559a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "11163495-a6cc-43b9-bf41-02748b13d210",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
@@ -0,0 +1,3 @@
# Notes for Introduction to Probability, Statistics, and Random Processes
## Ch.1
@@ -0,0 +1,244 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "a6732353-51d5-4478-9cf8-5834e57e5a4e",
"metadata": {},
"source": [
"# Chapter 1 Notes"
]
},
{
"cell_type": "markdown",
"id": "48d9ec9e-83da-40ca-ae79-3c45f8af137c",
"metadata": {},
"source": [
"## Main Concepts\n",
"\n",
"Outcome: A result of a random experiment.\n",
"\n",
"Sample Space: The set of all possible outcomes.\n",
"\n",
"Event: A subset of the sample space.\n",
"\n",
"Inclusion-exclusion principle holds for probability\n",
"\n",
"Consider a sample space S. If S is a countable set, this refers to a discrete probability\n",
"mode\n"
]
},
{
"cell_type": "markdown",
"id": "7ac122be-50b2-423c-b88f-e4b3327b21bd",
"metadata": {},
"source": [
"## Example Problems"
]
},
{
"cell_type": "markdown",
"id": "7fb87a35-a470-4d98-935f-80c814e3f95d",
"metadata": {},
"source": [
"Example 1.5 - soln\n",
"\n",
"- there are 10 people with white shirts and 8 people with red shirts;\n",
"- 4 people have black shoes and white shirts\n",
"- 3 people have black shoes and red shirts\n",
"- the total number of people with white or red shirts or black shoes is 21\n",
"\n",
"Let A be the set of people with white shirts, B be the set of people with red shirts and let C be the set of people with black shoes.\n",
"\n",
"\\begin{align*}\n",
"|A|=10 \\\\\n",
"|B|=8 \\\\\n",
"|A \\cap C| = 4 \\\\\n",
"|B \\cap C| = 3 \\\\\n",
"|A \\cup B \\cup C| = 21\n",
"\\end{align*}\n",
"\n",
"Now we solve for $|C|$:\n",
"\n",
"\\begin{align*}\n",
"|A| + |B| + |C| - |A \\cap B| - |A \\cap C| - |B \\cap C| + |A \\cap B \\cap C| = 21 \\\\\n",
"10 + 8 + |C| - 0 - 4 - 3 - 0 = 21 \\\\\n",
"18 + |C| - 7 = 21 \\\\\n",
"|C| + 11 = 21 \\\\\n",
"|C| = 10\n",
"\\end{align*}\n",
"\n",
"$\\therefore$ number of people with black shoes is 10\n"
]
},
{
"cell_type": "markdown",
"id": "72b40733-531a-48f3-9879-75601684afc2",
"metadata": {},
"source": [
"Example 1.11 - soln\n",
"\n",
"Suppose we have the following information:\n",
"1. There is a 60 percent chance that it will rain today.\n",
"2. There is a 50 percent chance that it will rain tomorrow.\n",
"3. There is a 30 percent chance that it does not rain either day.\n",
"\n",
"T = rains\n",
"F = no rain\n",
"\n",
"$S = \\{(F, F), (F, T), (T, F), (T, T)\\}$\n",
"\n",
"$P((T, F) \\cup (T, T)) = 0.6$\n",
"\n",
"$P((F, T) \\cup (T, T)) = 0.5$\n",
"\n",
"$P((F, F)) = 0.3$\n",
"\n",
"\\begin{align*}\n",
"P(S) = 1 \\\\\n",
"P(\\{(F, F)\\} \\cup \\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 1 \\\\\n",
"P((F,F)) + P(\\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 1 \\\\\n",
"0.3 + P(\\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 1 \\\\\n",
"P(\\{(F, T)\\} \\cup \\{(T, F)\\} \\cup \\{(T, T)\\}) = 0.7 \\\\\n",
"P(\\{(F, T)\\} \\cup \\{(T, T)\\}) + P((T, F)) = 0.7 \\\\\n",
"0.5 + P((T, F)) = 0.7 \\\\\n",
"P((T, F)) = 0.2 \\\\\n",
"P(\\{(T, F)\\} \\cup \\{(T, T)\\}) + P((F, T)) = 0.7 \\\\\n",
"P((F, T)) = 0.1\n",
"\\end{align*}\n",
"\n",
"Find the following probabilities:\n",
"\n",
"a. The probability that it will rain today or tomorrow.\n",
"\n",
"\\begin{align*}\n",
"P((T, F) \\cup (F, T) \\cup (T, T)) = 0.7\n",
"\\end{align*}\n",
"\n",
"b. The probability that it will rain today and tomorrow.\n",
"\n",
"\\begin{align*}\n",
"P((T, T)) = 1 - 0.3 - 0.2 - 0.1 = 0.4\n",
"\\end{align*}\n",
"\n",
"c. The probability that it will rain today but not tomorrow.\n",
"\n",
"\\begin{align*}\n",
"P((T, F)) = 0.2\n",
"\\end{align*}\n",
"\n",
"d. The probability that it either will rain today or tomorrow, but not both.\n",
"\n",
"\\begin{align*} \n",
"P(\\{(T, F)\\} \\cup \\{(F, T)\\}) = P((T, F)) + P((F, T)) = 0.2 + 0.1 = 0.3\n",
"\\end{align*}\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "8b5131dd-5ebd-4156-b808-f8df273317fb",
"metadata": {},
"source": [
"Example 1.12 - soln\n",
"\n",
"$S = \\{ -1, 0, 1, 2, 3, ... \\}$\n",
"\n",
"$\\forall x \\in S, P(x) = \\frac{1}{2^{x + 2}}$\n",
"\n",
"What is the probability that I win more than or equal to 1 dollar and less than 4 dollars?\n",
"\n",
"\\begin{align*} \n",
"P({1, 2, 3}) = P(1) + P(2) + P(3) \\\\\n",
"= 1/8 + 1/16 + 1/32\n",
"\\end{align*}\n",
"\n",
"What is the probability that I win more than 2 dollars?\n",
"\n",
"\\begin{align*} \n",
"\\sum_{i=3}^{\\infty} P(i) = P(3) + P(4) + P(5) + P(6) + ... \\\\\n",
"= 1/32 + 1/64 + 1/128 + 1/256 + ... \\\\\n",
"=\\frac{\\frac{1}{32}}{1 - \\frac{1}{2}}\n",
"=\\frac{1}{16}\n",
"\\end{align*}"
]
},
{
"cell_type": "markdown",
"id": "4609aba5-dfdc-4500-bec2-cfa2e544cca7",
"metadata": {},
"source": [
"Example 1.17 - soln\n",
"\n",
"I roll a fair die twice and obtain two numbers X1 = result of the first roll and X2 = result\n",
"of the second roll. Given that I know X1 + X2 = 7, what is the probability that X1 = 4 or\n",
"X2 = 4?\n",
"\n",
"What is our sample space?\n",
"\\begin{align*} \n",
"D = \\{1,2,3,4,5,6\\} \\\\\n",
"S = D \\times D\n",
"\\end{align*}\n",
"\n",
"\\begin{align*} \n",
"P(A|B) = \\frac{P(A \\cap B)}{P(B)}\n",
"\\end{align*}\n",
"\n",
"\\begin{align*} \n",
"A = \\{(x,y) \\mid x=4 \\lor y = 4 \\} \\\\\n",
"|A| = 12 \\\\\n",
"P(A) = \\frac{|A|}{|S|} \\\\\n",
"= \\frac{12}{36} = \\frac{1}{3}\n",
"\\end{align*}\n",
"\n",
"\\begin{align*} \n",
"B = \\{(x,y) \\mid x+y = 7 , x,y \\in \\mathbb{N}\\} \\\\\n",
"|B| = 6 \\\\\n",
"P(B) = \\frac{1}{6} \\\\\n",
"\\end{align*}\n",
"\n",
"\\begin{align*} \n",
"P(A \\cap B) = \\frac{1}{18}\n",
"\\end{align*}\n",
"\n",
"\n",
"\\begin{align*} \n",
"B = \\{(x,y) \\mid x+y = 7 , x,y \\in \\mathbb{N}\\} \\\\\n",
"A = \\{(x,y) \\mid x=4 \\lor y = 4 \\} \\\\\n",
"P(A|B) = \\frac{P(A \\cap B)}{P(B)} \\\\\n",
"= \\frac{P(A \\cap B)}{P(B)} \\\\\n",
"= \\frac{\\frac{1}{18}}{\\frac{1}{6}}\n",
"= \\frac{6}{18} = \\frac{1}{3}\n",
"\\end{align*}\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "11163495-a6cc-43b9-bf41-02748b13d210",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
@@ -0,0 +1,3 @@
# Notes for Introduction to Probability, Statistics, and Random Processes
## Ch.1
+63
View File
@@ -0,0 +1,63 @@
import json
import urllib.request
# --- MANDATORY AUTH CONFIGURATION ---
GITEA_URL = "http://git.burke.lan:3000" # No trailing slash
TOKEN = ""
OWNER = "burkkyy"
REPO = "roadmap"
MILESTONE_ID = 1
TASKS = [
# {"title": "", "body": ""},
]
CHAPTERS = [
"Ch.3",
"Ch.4",
"Ch.5",
"Ch.6",
"Ch.7",
"Ch.8",
"Ch.9",
"Ch.10",
"Ch.12",
"Ch.13",
"Ch.14",
]
for ch in CHAPTERS:
TASKS.append({"title": f"{ch} - Problems", "body": f""})
headers = {
"Authorization": f"token {TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json"
}
url = f"{GITEA_URL}/api/v1/repos/{OWNER}/{REPO}/issues"
if not TASKS:
print("Warning: 'TASKS' list is empty. Please populate your task templates before running.")
exit(1)
for task in TASKS:
title = task["title"]
body = task["body"]
payload = {
"title": title,
"body": body,
"milestone": int(MILESTONE_ID)
}
data = json.dumps(payload).encode('utf-8')
req = urllib.request.Request(url, data=data, headers=headers, method="POST")
try:
with urllib.request.urlopen(req) as response:
if response.status == 201:
print(f"Successfully created issue: {title}")
except Exception as e:
print(f"Failed to create issue '{title}': {e}")