Harvard CS50x & CS50AI Algorithms Suite

Interactive demonstrations and implementations of the 21 computer science and artificial intelligence modules in C and Python.

🎮 Adversarial Minimax AI (Unbeatable)

Module 11: Optimal adversarial decision-making using Minimax with Alpha-Beta pruning cut-offs.

Your turn (X). Click a cell to play.

📖 Coleman-Liau Readability Index

Module 02: Evaluates text complexity via average letters and sentences per 100 words.

Grade Level: Ready for analysis

💳 Luhn Checksum & IIN Verifier

Module 01: Double-add-modulo algorithm detecting valid Visa, MasterCard, and American Express formats.

Result: Valid VISA (Checksum Passed)

âš¡ Scaled Dot-Product Attention

Module 21: Computes self-attention weight distribution: Softmax(Q·K^T / √d_k) · V.

Matrix computed across tokens

Foundational Systems & Memory Architecture (01 - 09)

Memory safety, bitwise serialization, graph cycle detection, and cryptographic primitives.

# Module Core Mathematical Focus Time Complexity Status
01 Luhn Validator Card checksum validation & IIN detection O(N) Pass (3/3)
02 Readability Analyzer Coleman-Liau linguistic index calculation O(N) Pass (2/2)
03 Symmetric Ciphers Caesar modulo shift & substitution key bijective mapping O(N) Pass (2/2)
04 Tideman Voting Ranked pairs Condorcet winner & DAG cycle prevention O(V² + E) Pass (1/1)
05 Image Convolution Filters Sobel gradient edge detection & Gaussian box blur O(W × H × K²) Pass (5/5)
06 Forensic JPEG Carver 512-byte sector memory dump reconstruction O(N) Pass (1/1)
07 High-Speed Hash Dictionary djb2 hashing with separate chaining collision resolution O(1) avg Pass (2/2)
08 DNA Profiler Short Tandem Repeat (STR) forensic pattern matching O(N × M) Pass (2/2)
09 Finance Ledger Atomic equity trading transactions & market valuation O(1) Pass (2/2)

Autonomous Artificial Intelligence & Decision Systems (10 - 21)

Graph search, adversarial games, Bayesian inference, reinforcement learning, and transformers.

# Module Algorithmic Mechanism Domain Status
10 Degrees Shortest Path Breadth-First Search on bipartite graph Graph Search Pass (1/1)
11 Minimax Adversary Game tree search with Alpha-Beta pruning Game Theory Pass (1/1)
12 Propositional Logic Engine Model checking & logical entailment verification Knowledge & Logic Pass (1/1)
13 Minesweeper Inference Agent Subset relation inference & constraint propagation Knowledge & Logic Pass (1/1)
14 PageRank Markov Engine Iterative algebraic convergence & random surfer walk Uncertainty Pass (2/2)
15 Bayesian Heredity Joint probability distribution on genetic Bayesian network Uncertainty Pass (1/1)
16 Crossword CSP AC-3 arc consistency & backtracking with MRV heuristic Optimization Pass (1/1)
17 k-Nearest Neighbors Euclidean distance classification, Sensitivity & Specificity Machine Learning Pass (2/2)
18 Nim Q-Learning Temporal difference reinforcement learning agent Reinforcement Pass (2/2)
19 Convolutional Neural Network 2D Convolution, Max Pooling & Softmax Dense layer Deep Learning Pass (3/3)
20 Context-Free Grammar Parser Syntactic tree parsing & noun phrase chunking NLP Pass (2/2)
21 Transformer Self-Attention Scaled dot-product attention & masked token prediction Transformers Pass (2/2)

Engineering Architecture & Verification Standard

Built with zero extraneous dependencies, native testing, and deterministic edge execution.

1. Native Node.js 22 Test Suite: Tested using node:test and node:assert/strict via tsx. Total Tests: 21 Total Suites: 2 (Systems & Artificial Intelligence) Passing: 21 / 21 (100% Pass Rate) Vulnerabilities: 0 2. Edge Compatibility: All algorithms run natively in standard V8 environments, Node.js, and Cloudflare Pages edge workers. 3. Verified Determinism: - Alpha-Beta Minimax produces strictly optimal countermoves. - AC-3 algorithm reduces domain values prior to backtracking. - Markov random surfer reaches stationary distribution matching algebraic iteration.