#### naught

##### Member level 3

I`m considering the Linear Feedback Shift Register to generate the uniform distributed numbers.

I tried using short FFs to generate sequences. but it seems to me not random because the FFs is short, and sequence repeated itself in a short and fixed cycle.

So I try the longer FFs, say 63 bits LFSR.

But I have a question here. Since the integers between 0 to 3 is all what I want, and thus I would map all the numbers confined to the range between 0 to 3, by mod function.

say if number 42 is generated, 42 mod 4 => 2, then I get 2.

in the end, just a sequence of 0,1,2,3 is desirable.

Does this change the randomness(even though it`s pseudo random)? and is the sequence still uniformly distributed?

Personally I feel it is, because the mod function is, at least it seems to me, sort of linear(it`s not)

thx in advance.8-O

I tried using short FFs to generate sequences. but it seems to me not random because the FFs is short, and sequence repeated itself in a short and fixed cycle.

So I try the longer FFs, say 63 bits LFSR.

But I have a question here. Since the integers between 0 to 3 is all what I want, and thus I would map all the numbers confined to the range between 0 to 3, by mod function.

say if number 42 is generated, 42 mod 4 => 2, then I get 2.

in the end, just a sequence of 0,1,2,3 is desirable.

Does this change the randomness(even though it`s pseudo random)? and is the sequence still uniformly distributed?

Personally I feel it is, because the mod function is, at least it seems to me, sort of linear(it`s not)

thx in advance.8-O

Last edited: