How likely is for a pseudorandom number generator to generate a long sequence of similar numbers?

How likely is for a pseudorandom number generator to generate a long sequence of similar numbers? “Similar numbers” could be same numbers, or numbers from a given range.

For example, if we consider PRNG algorithm being a simple counter counting from 0 tom MAX, the distribution is uniform and there’s a guarantee of not repeating numbers in a sequence. So, not repeating numbers does not break uniformness. But probably it breaks randomness, does it? To what extent? If so, does it mean, that the better the algorithm, the less guarantee we have to not generate similar numbers in sequence?

I’m particularly interested in the answers regarding Mersenne Twister as a most popular PRNG in programming languages implementations. It’d also be great to know how things are in operating systems’ crypto-secure PRNGs – Yarrow (macOS), Fortuna (FreeBSD) or ChaCha20 (Linux).

How to combine GSA Content Generator + GSA SER

Hello.
I want to correctly build links to my money website without a penalty from Google.
I realized that for this I should first place a link to a page from a web 2.0 resource, and then massively link to this page from other sources, the text on the web 2.0 page must be relevant to link that is placed on this page.
I want to use the GSA Content Generator for relevant text. How can I do it?
How post 1000 relevant to link pages automatically with GSA Content Generator???

I spent the whole day to solve this problem. I watched a lot of videos, I could not find an answer. Help me please

Does a generator really stops the execution at the machine code level, and does it not use the stack?

Never have I heard of a partially executed function before. But it seems the idea of it has been out for some time. Does a generator really stop execution at the machine code level, and that next time when the iterator is invoked, then there is a jump back to that machine code location to continue the execution?

It seems quite strange, as

  1. it differ from mathmatics for what a function is.
  2. the traditional function will add to the stack, and once finished, everything is popped from the stack. But the generator is like a function that stays… so nothing is popped from the stack. So does it use something other than the stack for memory?

Example: JavaScript ES6 Generator:

function* generator() {     yield 1;     yield 3;     yield 5; }  const iterator = generator();  console.log(iterator.next()); console.log(iterator.next()); console.log(iterator.next()); console.log(iterator.next()); 

result:

{value: 1, done: false} {value: 3, done: false} {value: 5, done: false} {value: undefined, done: true} 

using HW random number generator as source of entropy

Currently I am using haveged on my server as source of entropy.

My Server is used as KVM hypervisor, to run virtual machines.

I did not use haveged at the beginning, and I noticed the VMs were draining the entropy pool from the server. Sometimes, when VMs were started SSH waited for enough entropy (to generate session keys, I guess).

Now with haveged, I don’t have this problem anymore.

But I would like to try to use a HW random number generator. I am not saying haveged is bad, but true HW random number generator can only make the entropy better. I have seen some HW RNG which work on basis of Geiger counter, some which collect noise from microphone, and so on.

Which are most reasonable to use ? Could somebody perhaps recommend some specific one ?

Ideally, I would like it to be connected over serial port. Second best would be over USB.

If current time in milliseconds is considered good enough random seed for a pseudorandom number generator, why not just use that time directly?

I was reading about pseudorandom number generators and how they need a seed and how that seed is usually current system time in milliseconds. One of the most common algorithms is the linear congruential generator, which is an algorithm that based on some fixed constants and this seed through some mathematical computations gives the final pseudorandom output.

But what are the disadvantages of using this time directly as a pseudorandom number?

Simple generator of pseudo-random permutations of variable length short sequence

The problem in front of me is to write a function (from scratch) to permute n elements, where n is an argument. I decided to break it down to applying Knuth’s shuffles algorithm, therefore I needed to write a pseudorandom number generator.

So now my task is to write a simple function F(seed,n) that will help me generate indices for the pseudorandom permutations of n elements. However, the function has to be extremely simple: My constraint is that I can only use the following operators: +,-,*,/,%, specifically, no address access, binary encoding, bits selection etc. – only arithmetic on numbers. That is fine, I went for linear congruental generators and implemented a (a*x+c)%m procedure.

As I started testing F(seed,2) it immediately went apparent that the results oscilate between zero and one with a period of two.

My problem is: how can I adjust F to avoid that behavior? Maybe I should generate the n-permutations in a different manner?

In practice, I am only interested in n=<32