Inspiration

We wanted a fun, fast-to-demo project built around random processes we’ve been learning (Poisson arrivals, exponential service times, CTMCs). Lines and waiting are something everyone experiences—urgent care, dining halls, event entry—so we built a tool that makes “randomness” visible and helps explain why wait times feel unpredictable.

What it does

Random is a mini “queue + randomness” simulator/calculator. It lets you pick a scenario (e.g., urgent care, event entry, barber shop) and then:

models arrivals as a Poisson process and service as exponential builds a CTMC / birth–death model for the system state (# people in system) computes steady-state probabilities Pn outputs key performance metrics: average number in system L and in queue LQ effective arrival rate λa (accounts for blocking/diversion) average time in system W and waiting time WQ via Little’s Law fraction of time servers are busy / probability of congestion fraction of customers blocked/diverted (access impact)

How we built it

Defined states n=0,1,…,K as “number of customers/patients in system.” Set birth rates λn (accepted arrivals) and death rates μn (service completions), including: multi-server service μn=min⁡(n,s)μ optional capacity limit K optional diversion policy (e.g., accept prob depends on current n)

Solved for steady-state probabilities using the lab-style recursion:Pn∝∏i=0n−1λiμi+1,∑nPn=1 Computed L,LQ from Pn, then used Little’s Law:W=Lλa,WQ=LQλa Implemented it as a simple Python app (notebook/terminal) for quick iteration and demo.

Challenges we ran into

Interpreting wording correctly (e.g., “time until you’re checked” vs “until you’re checked and allowed in” changes whether you include your own service time). Handling state-dependent arrivals (diversion/blocking makes λn vary by state, so λa must be computed as a time-average ∑Pnλn). Choosing assumptions that are simple enough for a hackathon but still faithful to the math (exponential service, Poisson arrivals).

Accomplishments that we're proud of

We turned course concepts (Poisson, exponential, CTMC, birth–death, Little’s Law) into a working tool that produces interpretable outputs. The results are presented in a way that mirrors “lab solution style” (states → rates → Pn → metrics). The project clearly connects randomness to real-world access and wellbeing (congestion and diversion affect who gets served and when).

What we learned

ow memorylessness makes exponential/Poisson models powerful and simplifies analysis. How to go from a real story to a model: define states, define rates, solve balance equations. Why effective arrival rate matters in blocked/diverted systems. How queue performance metrics relate: Pn→L→W.

What's next for Random

Add a Monte Carlo simulation mode to validate analytic CTMC results and show variability visually. Add a simple UI (Streamlit) with sliders for λ,μ,s,K and policy toggles. Expand scenarios (dining hall, advising office, bus stop) and include equity/access metrics (e.g., probability wait exceeds threshold). Support non-exponential service times (move toward M/G/1 approximations) for realism.

Built With

Share this project:

Updates