Random Number Generator


Do you need to generate a random number? You can download an app or go to a website for this. One such site is random.org. This web site says: ” The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs.”

This website goes on to say: “In reality, most random numbers used in computer programs are pseudo-random, which means they are generated in a predictable fashion using a mathematical formula. This is fine for many purposes, but it may not be random in the way you expect if you’re used to dice rolls and lottery drawings.”

At this site they give you dozens of options to generate random numbers including the ability to generate random strings of alphanumeric characters of different lengths. To do this, scroll down to the section called “Lists and Strings and Maps, Oh My!” Th second option is called String Generator.

For Developers

Are you developing a game for the web or an app that requires random numbers? random.org has an API for that. If you click Web tools at the top of the page, and then click Widgets for your Pages. Click on Integer Widget and follow through with the configuration settings on that page. Click Create Widget in step 4 to get the iFrame HTML code to insert into your own site.

You can interface to RANDOM.ORG through JSON-RPC. You can invoke this API from any application that has Internet access, including web applications and mobile apps. You need an API key to use the API.

JSON-RPC is a simple remote procedure call protocol encoded in JSON. Implementations of JSON-RPC exist in many languages. In JavaScript, JSON-RPC is so simple to use that you most likely won’t need a client library.

Wikipedia defines an RPC similar to this: “In distributed computing a remote procedure call (RPC) is when a computer program causes a procedure (computer language subroutine) to execute in another address space (commonly on another computer on a shared network), which is coded as if it were a normal (local computer) procedure call, without the programmer explicitly coding the details for the remote interaction.”

RANDOM.ORG goes on to say: “All interaction takes place via JSON-RPC over secure HTTP between the client application (e.g., web site or mobile app) and the RANDOM.ORG service. All invocations must be made via HTTP POST. In particular, HTTP GET is not supported.”

Excel

To generate a random number in Excel, you can use this function and type in in to a cell as shown: =RAND(). You get a number between 0 and 1. You might get something like 0.919626697. However, Excel will recalculate the RAND function each time the worksheet is opened or each time new information is added.