What is the randomization power in rand function.? For example UNIX drand48 can generate a randomization of 2^48 (~10^14).

 채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 18일

0 개 추천

2^53 different possibilities.
You should also be caring about how long the period is (that is, the time until the sequence repeats.) It is on the order of 2^11000 for the default randomization routine.

댓글 수: 4

Sandeep Ganji
Sandeep Ganji 2013년 10월 18일
Thank you for the quick reply. Does using the rng('shuffle') improves the randomness?
Shashank Prasanna
Shashank Prasanna 2013년 10월 18일
rng('shuffle') just resets the seed of the RNG based on the current time on your machine. Doesn't do anything to the algorithm itself.
Walter Roberson
Walter Roberson 2013년 10월 18일
편집: Walter Roberson 2013년 10월 18일
If your thought is to periodically have your program use rng('shuffle') in order to "improve the randomness", then interestingly it can be shown that this will reduce the randomness, because the times used as input to the shuffling will end up being correlated.
If you need "cryptographic strength" randomness, then you need to use special routines for that purpose that are "hardened" to reduce leakage of information about the internal state of the generator.
Sandeep Ganji
Sandeep Ganji 2013년 10월 18일
Thank you. I will consider shifting to a more robust random number generator.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2013년 10월 18일

댓글:

2013년 10월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by