#collision
2 APIs with this tag
Birthday Paradox API
Birthday-paradox and collision-probability maths as an API, computed locally and deterministically. The probability endpoint computes the chance that at least two of n people share a birthday among d equally likely days, P = 1 − Π(1 − i/d), evaluated in log space for accuracy — the famous result that just 23 people give about a 50.7 % chance, 50 people about 97 % and 70 people about 99.9 %. The people-needed endpoint inverts it: the smallest group size to reach a target probability (23 for 50 %, 57 for 99 %), with the √(2·d·ln(1/(1−p))) approximation. The collision endpoint generalises the birthday bound to any space — pass a number of buckets or a hash size in bits — and returns the collision probability P ≈ 1 − e^(−n²/2d), the rule behind hash collisions and UUID-uniqueness estimates, where a 50 % chance needs roughly 1.177·√d items. Days and buckets default to 365. Everything is computed locally and deterministically, so it is instant and private. Ideal for probability-education, security, cryptography, hashing, data-engineering and statistics app developers, collision-risk and birthday-problem tools, and teaching material. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the birthday/collision probability; for full distributions use a probability API.
api.oanor.com/birthdayparadox-api
Momentum & Collision API
Linear momentum, impulse and one-dimensional collisions as an API, computed locally and deterministically. The momentum endpoint computes the linear momentum p = m·v of a moving body, with its kinetic energy, and solves for whichever of the mass, velocity or momentum you leave out. The impulse endpoint applies the impulse-momentum theorem, J = F·Δt = m·Δv = Δp: from a force and a time it gives the impulse and, with a mass, the change in velocity; or from a mass and a velocity change it gives the impulse and the average force over a contact time — the physics of a bat hitting a ball or an airbag softening a crash. The collision endpoint solves a head-on collision between two bodies using conservation of momentum and a coefficient of restitution: e = 1 for a perfectly elastic collision (kinetic energy conserved), e = 0 for a perfectly inelastic one (the bodies stick together), or any value between for a partially inelastic collision — returning both final velocities, the conserved total momentum, the kinetic energy before and after, and the energy lost. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics-education and simulation tools, game and ballistics engines, vehicle-crash and sports apps, and engineering-dynamics software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is linear momentum and collisions; for rotational angular momentum and flywheel energy use a flywheel API.
api.oanor.com/momentum-api