Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
What is probability of random generator repeating more than once?

Imagine we have two independent pseudo-random number generators using same algorithm but seeded differently. And we are generating numbers of same size using these generators, say 32-bit integers. Provided algorithm gives us uniform distribution, there is 1/2^32 probability (or is it?) of a collision. If a collision just happened, what is the probability the very next pair will also be a collision? It seems for me this probability might be different (higher) from that initial uniform-based collision chance. Most of currently existing pseudo-random number generators hold internal state to maintain own stability, and recently happened collision might signal those internal states are somewhat "entangled" giving modified (higher) chance of a collision to happen again.

The question is probably too broad to give any precise answer, but revealing general directions/trends could also be nice. Here are some interesting aspects:

  • Does size of initial collision matter? Is there a difference after a collision of 8 consecutive bits vs 64 bits? How approximately chance of next collision depends on size of generated sequence?

  • Does pattern of pair generation matter? For example, we could find initial collision by executing first generator only once and "searching" second generator. Or we could invoke each generator on every iteration.

  • I'm particularly interested in default javascript Math.random(). 32-bit integers can be generated of that like this (for example). EDIT: As pointed in comments, conversion of random value from [0; 1) range should be done carefully, as exponent of such values is very likely to repeat (and it takes decent part of result extracted this way).

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda