Seed generator using 'current' World Population count

Generates a seed that could be used to set the state for random number generation in matlab.
665 Downloads
Updated 3 Jun 2010

View License

Random number generated using Matlab (i.e. rand, randperm,etc) is pseudo-random and not pure-random. This script provides a seed that can be used to set the state in order to generate "near-pure" random numbers using rand, randperm etc. The script grabs the "current" world population count from a website and jumbles up the digits and outputs the seed.

World population count is not "predicable' and randperm of digits inside 'current' world population count is highly random, thus the seed generated is helpful in generating "near-pure" random numbers

Usage:
sd = GenSeed; %generate seed
RandStream.setDefaultStream(RandStream('mt19937ar','seed',sd)); % set the state
rand(1,10) %generate "near-pure" random numbers

Cite As

Pranam Janney (2024). Seed generator using 'current' World Population count (https://www.mathworks.com/matlabcentral/fileexchange/27822-seed-generator-using-current-world-population-count), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Random Number Generation in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Added read_specific_data.m

1.0.0.0