Skip to content
LUDA · 學思辨行

LUDA · 學思辨行

Learn extensively, Understand deeply, Discern clearly, and Act resolutely.

  • About
  • Learning Path

Category: Randomization

How reservoir sampling keeps a uniform subset

November 13, 2026By HoHo Zhao

Short answer: Reservoir sampling draws k items uniformly from a stream of unknown length. The first k items fill the reservoir. When item i arrives, with i counted from 1, it replaces a random reservoir slot with probability k/i. Algorithm R uses one random number per item and O(k)…

Algorithms, RandomizationLeave a comment

How RANSAC fits a model to inliers

November 13, 2026By HoHo Zhao

Short answer: RANSAC fits a geometric model when many points are outliers. It draws the smallest sample that determines the model, fits, and counts how many points agree within a threshold. After enough trials it refits on the largest inlier set. The number of trials needed to see at…

Algorithms, RandomizationLeave a comment

How Fisher-Yates shuffles with one swap per index

November 13, 2026By HoHo Zhao

Short answer: The Fisher-Yates shuffle, in the modern inside-out or the usual in-place form, produces each permutation of an array with equal probability. The in-place loop walks i from the end down to 1 and swaps i with a uniformly chosen index j in 0..i, inclusive. That is n−1…

Algorithms, RandomizationLeave a comment
  • Algorithms
  • Arithmetic
  • Authelia
  • Clustering
  • Coding
  • Compression
  • Cryptography
  • CSS
  • Distributed Systems
  • Docker
  • Dynamic Programming
  • Exact Algorithms
  • Games
  • Geometry
  • Grafana
  • Graphs
  • Greedy
  • Heaps
  • Homelab
  • IPsec
  • LDAP
  • Linear Algebra
  • Logging
  • Loki
  • nginx
  • Number Theory
  • Numerical
  • Optimization
  • Parsing
  • Prometheus
  • Randomization
  • Range Queries
  • Sampling
  • Scheduling
  • Search
  • Searching
  • Sequences
  • Sketches
  • Sorting
  • Streams
  • Strings
  • SVG
  • Synchronization
  • Systems
  • Transforms
  • Trees

Docker EAP-MSCHAPv2 FreeRADIUS Grafana gzip IKEv2 IPsec LogQL Loki OpenLDAP Promtail StrongSwan

© 2026 LUDA · 學思辨行. Powered by WordPress.