Code covered by the BSD License  

Highlights from
RANDI_ORG: True random integer numbers

4.0

4.0 | 1 rating Rate this file 4 Downloads (last 30 days) File Size: 3.51 KB File ID: #27849

RANDI_ORG: True random integer numbers

by Giampiero Salvi

 

07 Jun 2010 (Updated 18 Jun 2010)

Queries www.random.org to collect true random integer numbers.

| Watch this File

File Information
Description

The RANDI_ORG function has a similar usage as the RANDI function. However, instead of returning pseudo-random numbers, it queries the site http://www.random.org to collect true random numbers. Refer to the web site for a discussion on the difference between pseudo and true randomness.

Note that http://www.random.org allows limited traffic per day, check the site for more details.

Acknowledgements
This submission has inspired the following:
WWW.RANDOM.ORG random integers/sequences/strings
MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
11 Jun 2010 Simon Cross

This looks like a very useful functions for a lot of my projects which rely on'random' numbers and I would prefer them to be really random, so many thanks for posting it. Unfortunately when I run it I get the following error message:

??? Undefined function or variable 'a'

Error in ==> randi_org at 61
if any(a<+0)

I am running it in Mac OSX Leopard

Thanks for your help

Simon Cross

14 Jun 2010 Jan Simon

Did you try URLREAD to get the values?
It is necessary to mention the guidelines of the web service, which involve a quota of 2e5 bits per day, which accumulates to upto 1e6 bits, per TCP/IP. If the quota is exceeded, stop requesting new values. Get values in as large chunks as possible, because requesting single numbers produces large traffic on the server.
Thanks, Jan

15 Jun 2010 Oleg Komarov

API: http://www.random.org/clients/http/

An example: http://www.random.org/sequences/?min=1&max=52&col=1&format=plain&rnd=new

I think this method will be feasible through platforms.

Oleg

15 Jun 2010 Giampiero Salvi

Thanks for the feedback! Now the function uses urlread and there's a warning about limited traffic from www.random.org.

Please login to add a comment or rating.
Updates
08 Jun 2010

- fixed examples in the help text
- fixed handling of negative sizes

13 Jun 2010

- fixed small bug

15 Jun 2010

- removed dependencies on curl (using urlread instead)
- added warning about limited traffic from www.random.org

18 Jun 2010

- without arguments checks for quota at www.random.org

18 Jun 2010

- fixed random.org limitation of 10000 numbers per query

Tag Activity for this File
Tag Applied By Date/Time
mathematics Giampiero Salvi 08 Jun 2010 09:34:31
statistics Giampiero Salvi 08 Jun 2010 09:34:31
signal processing Giampiero Salvi 08 Jun 2010 09:34:31

Contact us at files@mathworks.com