You Got Math In My Ruby! (You Got Ruby In My Math!)
summary
Ruby's reduce/inject maps cleanly onto monoids: integers with +, strings and arrays with concatenation, and even Bloom filters (require same bit‑vector length and hash functions) combine by bitwise OR giving a valid identity of all zeros. Monoids let you fold streams incrementally, compose for mean/stddev (Knuth's one‑pass stable algorithm turns into a monoid) and exploit parallel folds for log n speedup in map‑reduce. Trace monoids model commuting operations to quantify available concurrency.
AI-written summary · about
chapters (15)
- 0:00Intro
- 2:11The Problem
- 4:36Mathematical Creatures
- 6:06Reduce
- 6:57Plus
- 8:00Identity
- 10:27Group Operations
- 11:05Parallel Operations
- 13:21Standard Deviation
- 15:20Bloom Filters
- 16:53Combining Bloom Filters
- 18:35Advanced Data Structures
- 19:30An Alphabet
- 21:25Concurrent Computation
- 22:26Trace Mano








