Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Math & CS Notes Repository

A structured collection of study notes spanning pure mathematics, theoretical computer science, physics, programming, networking, and AI architecture.

## Contents

### Math
- [Complex Numbers](math/complex-numbers.md) -- Conjugates, Euler's formula, Taylor expansion of e^(ix)
- [Modular Arithmetic](math/modular-arithmetic.md) -- Definition, clock arithmetic, congruence properties
- [Linear Algebra](math/linear-algebra.md) -- Function spaces K^X, scalar-product associativity proof

### Theoretical Computer Science
- [The Halting Problem](theoretical-cs/halting-problem.md) -- Turing's undecidability proof, h/h+ construction, self-reference
- [Paradoxes & Self-Reference](theoretical-cs/paradoxes.md) -- Liar paradox, Cantor diagonalization, Monty Hall Trolley Problem

### Physics
- [Quantum Mechanics](physics/quantum-mechanics.md) -- Schrodinger equation, wave functions, Hilbert space

### Programming
- [Python Mutability](programming/python-mutability.md) -- References vs copies, list aliasing, += rebinding behavior

### Networking
- [VLAN Configuration](networking/vlan-configuration.md) -- Cisco switch commands, access/trunk modes
- [IPv4 Subnetting](networking/ipv4-subnetting.md) -- Complete CIDR table, binary calculations, private ranges, IPv4 classes
- [DNS](networking/dns.md) -- Resolution flow, hierarchy, record types

### AI Architecture
- [Agentic Patterns](ai-architecture/agentic-patterns.md) -- Multi-agent patterns: parallel, sequential, loop, router, aggregator, network, hierarchical

### Puzzles & Misc
- [Connect All 9](puzzles/connect-nine.md) -- Classic dot puzzle, triangular numbers (termial)
- [Orbital Mechanics](puzzles/orbital-mechanics.md) -- Planetary orbits, Kepler's laws

## Topic Map

```
┌─────────────────┐
│ Complex Numbers│
└────────┬────────┘
│ Euler's formula
┌─────────────────┐ ┌──────────────┐
│ Quantum │────────→ │ Linear │
│ Mechanics │ Hilbert │ Algebra │
└─────────────────┘ space └──────────────┘
┌─────────────────┐ │ finite fields
│ Modular │ ←───────────────┘
│ Arithmetic │
└────────┬────────┘
│ binary math
┌─────────────────┐
│ IPv4 Subnetting │
└────────┬────────┘
┌────────┴────────┐
│ VLAN DNS │
└─────────────────┘

┌─────────────────┐ ┌──────────────────┐
│ Halting Problem │────────→│ Paradoxes & │
│ (Turing 1936) │ self- │ Self-Reference │
└──────────────────┘ ref └──────────────────┘

┌─────────────────┐ ┌──────────────────┐
│ Python │ shared │ Agentic │
│ Mutability │ state │ Architectures │
└──────────────────┘────────└──────────────────┘
```

## Source

Notes transcribed from handwritten pages, reference images, and community discussions (r/askmath, r/trolleyproblem, r/askastronomy, r/PythonLearnersHub, networks.baseline, leadgenman).
136 changes: 136 additions & 0 deletions notes/ai-architecture/agentic-patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Agentic Architectures

## Single System vs Multi-Agent System

### Single System
```
User ──→ AI Agent ──→ Response
Memory
Tools
```

### Multi-Agent System
```
User ──→ AI Agent ←──→ AI Agent
│ │
Memory Tools
Tools Memory
```

Multiple agents collaborate, each with their own memory and tools.

## Patterns in Multi-Agent Systems

### 1. Parallel
```
┌─ AI Agent ─┐
In ──→───┤ ├───→ Out
└─ AI Agent ─┘
```
Multiple agents process the same input simultaneously. Good for speed and redundancy.

### 2. Sequential
```
In ──→ AI Agent ──→ AI Agent ──→ Out
```
Each agent's output feeds into the next. Good for pipelines and staged processing.

### 3. Loop
```
In ──→ AI Agent ──→ AI Agent ──→ Out
▲ │
└──────────────┘
```
Agents iterate until a condition is met. Good for refinement and self-correction.

### 4. Router
```
┌──→ Out
In ──→ AI Agent
└──→ Out
```
One agent decides where to send the input. Good for classification and routing.

### 5. Aggregator
```
In ──→───┐
AI Agent ──→ Out
In ──→───┘
```
Combines multiple inputs into a single output. Good for summarization and synthesis.

### 6. Network
```
┌─────────────┐
In ──→ AI Agent ←→ AI Agent ──→ Out
└─→ AI Agent ←─┘
```
Fully connected agents that can communicate freely. Good for complex reasoning.

### 7. Hierarchical
```
AI Agent (manager)
/ \
AI Agent AI Agent
```
A manager agent delegates to worker agents. Good for task decomposition.

## Architecture Examples (with Tools)

### Hierarchical (with external services)
```
AI Agent (orchestrator)
/ | \
AI Agent AI Agent AI Agent
| | |
Vector Search Web Search Gmail
Vector Search Vector Search
```

### Human-in-the-Loop
```
User Input ──→ AI Agent ──→ Person ──→ Response
│ │
AI Agent ←─────────────────┘
```

### Shared Tools
```
User Input ──→ AI Agent ──→ Response
┌─────┼─────┐
Vector Search Web Search Vector DB
```

### Database with Tools
```
User Input ──→ AI Agent ──→ Response
┌─────┼─────┐
AI/KB Web Search Vector DB
Data Transform
```

### Memory Transformation
```
User Input ──→ AI Agent ──→ Response
┌─────┼──────────┐
Web Search Vector Search Vector DB
AI Agent Memory Data Transform
```

## Relevance to BlackRoad

BlackRoad's architecture uses several of these patterns:
- **Router**: The Operator classifies and routes requests
- **Hierarchical**: Cece delegates to specialized tools/services
- **Sequential**: Request → classify → route → execute → respond
- **Shared Tools**: Multiple agents share NumPy, Claude, GPT, Hailo-8

## Connections

- Routing patterns connect to [DNS](../networking/dns.md) (hierarchical resolution)
- Agent memory relates to [Python Mutability](../programming/python-mutability.md) (shared vs. isolated state)
- The halting problem ([Halting Problem](../theoretical-cs/halting-problem.md)) limits what agents can decide
60 changes: 60 additions & 0 deletions notes/math/complex-numbers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Complex Numbers

## Multiplication of Complex Conjugates

```
a(a - aib + aib - ibib)
= a² - (ib)²
= a² + b²
```

**Key identity:**

```
(a + ib)(a - ib) = a² + b²
```

This is the **complex conjugate product** -- multiplying a complex number by its conjugate always yields a real number.

## Imaginary Numbers

```
(y + x)² y
```

- Imaginary unit: `i² = -1`
- Complex number form: `z = a + bi`

## Real Numbers

- `x` is real
- **Euler's identity:** `e^(iπ) + 1 = 0`
- Magnitude: `(y + x)²`

### Absolute Value

```
|x| = 1
|x - 1| = -1 (Note: absolute value is always >= 0; this explores when the inner expression is negative)
A = 1
```

## Euler's Formula Expansion

```
e^(ix) = 1 + ix - x²/2 - ix³/6 + x⁴/24 - ...
```

This is the **Taylor series expansion** of `e^(ix)`:

```
e^(ix) = cos(x) + i·sin(x)

cos(x) = 1 - x²/2! + x⁴/4! - ...
sin(x) = x - x³/3! + x⁵/5! - ...
```

## Connections

- Complex numbers connect to [Quantum Mechanics](../physics/quantum-mechanics.md) via the Schrodinger equation
- Euler's formula connects to [Modular Arithmetic](modular-arithmetic.md) through cyclic groups
71 changes: 71 additions & 0 deletions notes/math/linear-algebra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Linear Algebra - Function Spaces

## Function Space Definition

The set of all functions from X to a field K:

```
K^X = { f : X → K }
```

This is a **vector space** of functions.

## Operations on Function Spaces

### Addition of Functions
```
(f + g)(x) := f(x) + g(x)
```

### Scalar Multiplication
```
(λ · f)(x) := λ · f(x)
```

### Pointwise Multiplication
```
(f * g)(x) := f(x) · g(x)
```

## Key Property: Scalar-Product Associativity

**Proposition 2.2:**

```
λ · (a * b) = (λ · a) * b = a * (λ · b)
```

### Proof

Starting from the left side:

```
(λ · (f * g))(x) = λ · ((f * g)(x))
= λ · (f(x) · g(x))
= (λ · f(x)) · g(x)
= ((λ · f) * g)(x)
```

And from the right side:

```
= f(x) · (λ · g(x))
= (f * (λ · g))(x)
```

This shows scalar multiplication can "pass through" the pointwise product to either factor.

## Why This Matters

This property establishes that **K^X is an algebra over K** -- not just a vector space, but one with a compatible multiplication operation. This is fundamental to:

- **Functional analysis**
- **Operator theory**
- **Quantum mechanics** (operators on Hilbert spaces)
- **Signal processing** (function spaces)

## Connections

- Function spaces connect to [Quantum Mechanics](../physics/quantum-mechanics.md) (wave functions live in Hilbert space)
- Scalar properties relate to [Modular Arithmetic](modular-arithmetic.md) through ring theory
- [Complex Numbers](complex-numbers.md) form the field K in quantum mechanics
Loading
Loading