Prisma · coverage-maximizing combinatorial optimization.
A combinatorial-optimization engine built on a companion paper co-authored with Victor Hugo Nascimento (FGV): for a budget of N tickets, it computes the portfolio that maximizes coverage under a chosen prize structure. Applied here to Brazilian lotteries — Lotofácil, Mega-Sena, Quina, Lotomania, Dupla Sena, and Dia de Sorte — where independently drawn random tickets are a provably worse use of the same budget than a portfolio chosen to minimize overlap.
Coverage maximization, made into a tool.
The method comes from a companion paper, "Coverage Maximization and Overlap Minimization for Multi-Ticket Lottery Selection," co-authored with Victor Hugo Nascimento (FGV School of Applied Mathematics). For a lottery of the form "pick k numbers out of a universe of v; win by matching at least t of the d drawn," a random independent-ticket baseline gives a win probability of 1 − (1 − p)ⁿ for n tickets. Prisma's portfolio beats that baseline by construction: it selects tickets that are deliberately anti-correlated, so the same budget covers more of the number space.
The pipeline runs in three stages, entirely inside a Web Worker: a greedy max-coverage selection (with the classical 1 − 1/e approximation guarantee, Nemhauser et al. 1978) builds an initial ticket pool; simulated annealing refines it by minimizing total pairwise overlap Σ|Aᵢ∩Aⱼ|; a Monte Carlo simulation then estimates the resulting P(≥t) directly, rather than trusting a closed-form approximation.
No backend, no account, no data collection — the optimizer, the simulation, and the number crunching all happen client-side.
What Prisma does
- Supports six Brazilian lotteries: Lotofácil, Mega-Sena, Quina, Lotomania, Dupla Sena, and Dia de Sorte — one generic optimizer, per-lottery rules (universe size, pick range, prize thresholds) defined in a config table.
- Lets you fix numbers that must appear in every ticket, and exclude numbers that must never appear — the optimizer works the remaining free space.
- Can fold your own already-chosen tickets into the portfolio: the generated tickets are selected to minimize overlap with those too, not just with each other.
- Reports the resulting win probability via real Monte Carlo simulation, alongside the theoretical optimum Ω*, not just a generated list of numbers.
- A "How it works" page computes its example numbers by actually calling the optimizer — not illustrative, reproducible figures.
- Light theme by default, follows the browser's color-scheme preference, with a persisted manual toggle.
Stack
Frontend
React · TypeScript · Vite
Computation
Web Worker · greedy + simulated annealing · Monte Carlo
Identity & deploy
oklch color tokens · Newsreader + IBM Plex Sans · Vercel
Prisma is an independent tool, with no affiliation to Caixa. A lottery has negative expected value by construction: the optimizer distributes the risk of a fixed budget better across tickets — it does not predict draws or change the underlying odds. For adults only.