Skip to main content

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

To find the period of a non full cycle LCG PRNG for a given seed you just need to count the number of iterations of the PRNG until it generates the seed value once more.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

To find the period of a non full cycle LCG PRNG for a given seed you just need to count the number of iterations of the PRNG until it generates the seed value once more.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

To find the period of a non full cycle LCG PRNG for a given seed you just need to count the number of iterations of the PRNG until it generates the seed value once more.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

Add answer for the case of a non full cycle LCG PRNG.
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

To find the period of a non full cycle LCG PRNG for a given seed you just need to count the number of iterations of the PRNG until it generates the seed value once more.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

To find the period of a non full cycle LCG PRNG for a given seed you just need to count the number of iterations of the PRNG until it generates the seed value once more.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

added 21 characters in body
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than RANDU.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

If you constrain yourself to full cycle LCG PRNGs then the answer is easy, by definition it's simply $m$.

From the referenced wikipedia page:

Period length

The period of a general LCG is at most $m$, and for some choices of a much less than that. Provided that $c$ is nonzero, the LCG will have a full period for all seed values if and only if:

While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters $c$, $m$, and $a$.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and lead to many results which are currently being questioned because of the use of this poor LCG.

Why you want to use a full cycle generator

If you don't constrain yourself to full cycle LCG PRNGs then you are taking a huge risk.

If you don't know that a given LCG is full cycle then you could could end up with a generator with an arbitrary number of mutually distinct sequences, some of which could be embarrassingly small and have appalling randomness, possibly even worse than the infamous RANDU generator.

You really don't want to have to check every possible seed value to make sure that it generates a sequence which is long enough for your application.

Further reading

For an excellent primer on pseudo random number generators, I would strongly recommend that you read the Numerical Recipes chapter on Random Numbers.

added 21 characters in body
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31
Loading
added 212 characters in body
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31
Loading
deleted 18 characters in body
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31
Loading
deleted 18 characters in body
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31
Loading
Source Link
Mark Booth
  • 2.4k
  • 19
  • 31
Loading