Ad
-

Acerca de los números aleatorios

A random number generator (RNG) produces numbers that lack any predictable pattern. This page generates random integers between any two bounds you choose, entirely in your browser. Typical uses include picking giveaway winners, assigning presentation order, sampling items for review, generating lottery-style picks, dice rolls, and randomized practice problems.

Computers cannot produce true randomness from arithmetic alone — a fact formalized by John von Neumann's 1951 remark that anyone considering arithmetic methods of random digits is "in a state of sin." Software RNGs are therefore pseudorandom: they run a deterministic algorithm whose output passes statistical tests for randomness. JavaScript's Math.random(), which this tool uses, is a pseudorandom generator; for cryptographic keys or gambling-grade fairness, use a cryptographic RNG such as the Web Crypto API's crypto.getRandomValues, which browsers implement from a cryptographically secure source.

Cómo funciona el muestreo aleatorio de este generador

To draw a random integer between min and max inclusive, the generator produces a uniformly distributed value and maps it onto the integer range. When every number in the range is equally likely, each individual draw of a number between 1 and N has probability 1/N. Uniform draws are independent: the generator has no memory, so a number that has not appeared recently is not "due" — the belief otherwise is known as the gambler's fallacy.

Para el muestreo sin reemplazo (por ejemplo, asignar posiciones únicas a una lista de personas), extraiga repetidamente pero omita los números ya utilizados hasta que cada uno haya sido asignado una vez, o mezcle la lista y lea el orden.

Rangos aleatorios comunes y referencia de probabilidad.

La siguiente tabla enumera los rangos utilizados con frecuencia y la probabilidad de que aparezca un valor específico en un único sorteo uniforme.

None

RangeValoresProbabilidad de un valor específico
Tirada de dados (1–6)61/6 ≈ 16,7%
Estilo moneda (0–1)21/2 = 50%
Rueda de ruleta (0–36, europea)371/37 ≈ 2,7%
Lotería 6/49 partido único491/49 ≈ 2,0%
Elige 1 de 1001001%
Sorteo entre 250 inscritos2501/250 = 0,4%

Semillas, pseudoaleatoriedad y reproducibilidad.

A pseudorandom generator starts from an internal state (a seed) and advances deterministically; the same seed yields the same sequence, which is why scientific simulations often accept a seed for reproducibility. Browser Math.random() implementations are seeded automatically and are not designed to be reproducible or cryptographically secure. For statistics-grade simulations, tools supporting fixed seeds or the Python NumPy Generator API are a better fit; for drawings where fairness matters publicly, prefer a transparent method such as a filmed dice roll or a certified lottery terminal.

Randomness is a foundational resource in computing, statistics, and cryptography. Monte Carlo methods — used across physics, finance, and engineering — obtain numerical results by repeated random sampling, a technique named after the casino district of Monaco and developed on early computers by Stanislaw Ulam and John von Neumann at Los Alamos in the 1940s. Randomized algorithms also underpin modern machine-learning training, in the form of random weight initialization, shuffling, and dropout.

Randomized controlled trials, the gold standard in medicine, depend on unbiased random assignment of participants to treatment and control groups. Proper randomization prevents selection bias from systematically favoring one group; that is why trial registries publish the randomization method. The same principle applies at smaller scale: randomly assigning chore orders, presentation slots, or A/B test variants removes the quiet biases of alphabetization or self-selection.

In games, dice and shuffled decks are physical randomizers with centuries of history; digital games replicate them with pseudorandom calls, and competitive formats increasingly publish their randomization procedures so participants can verify fairness. Tabletop role-playing games use polyhedral dice — d4, d6, d8, d10, d12, d20 — each a uniform draw over its face count, exactly what a range-limited integer generator reproduces.

A brief fairness note for drawings: assign each entrant a number first, generate one integer in the full range, and record the result before announcing it. Avoid re-rolling "until it feels right," which introduces human bias and, over many drawings, systematically distorts outcomes. For high-stakes selections, publish the method and the seed or use an independent third-party drawing service.

Preguntas frecuentes

¿Es este generador realmente aleatorio?

Ningún generador de software es verdaderamente aleatorio. Esta herramienta utiliza Math.random() de JavaScript, un generador pseudoaleatorio cuya salida pasa pruebas estadísticas de aleatoriedad. Para fines criptográficos, utilice una fuente segura como crypto.getRandomValues.

¿Puedo generar un número entre dos valores cualesquiera?

Sí. Establezca los límites mínimo y máximo y cada sorteo devolverá un número entero dentro de ese rango inclusive, con cada valor en el rango igualmente probable.

¿Por qué apareció el mismo número dos veces seguidas?

Con un generador independiente uniforme, se esperan repeticiones. Tomando del 1 al 6, la probabilidad de que la siguiente tirada coincida con la anterior es 1/6; En muchos sorteos, las corridas y los grupos son normales, no evidencia de sesgo.

¿Es justo realizar un sorteo?

Es uniforme e imparcial en el sentido estadístico ordinario, pero no es auditable por terceros. Para sorteos impugnados públicamente, utilice un método que los testigos puedan verificar o un servicio de aleatorización certificado.

¿Cuál es la diferencia entre pseudoaleatorio y criptográficamente seguro?

Los generadores pseudoaleatorios son algoritmos deterministas adecuados para juegos y muestreos; Los generadores criptográficamente seguros (CSPRNG) resisten la predicción incluso después de observar muchas salidas y son necesarios para claves, tokens y aleatoriedad sensible a la seguridad.

Ad