Google Answers Logo
View Question
 
Q: Freeware random number generator ( No Answer,   9 Comments )
Question  
Subject: Freeware random number generator
Category: Miscellaneous
Asked by: hofferino-ga
List Price: $2.00
Posted: 06 Jul 2003 22:22 PDT
Expires: 05 Aug 2003 22:22 PDT
Question ID: 225930
I run a sort of incentive program with my class. Based on the number
of incentive points they've earned, they get to choose x numbers
between 0 and 9999. Each day a jackpot number is drawn. If there's a
winner, he wins the jackpot. If not, the jackpot goes up $1 for
tomorrow.

Until now, I've used the random number generator at www.random.org to
generate a list of numbers to give out to students. I paste it into
Excel, highlight the number of numbers a given student deserves, and
print them. This works fine.

What I'm looking for is this:

1) A random number generator (freeware) that works similar to the one
one www.random.org, but that I can run locally without having to be
connected to the Internet. It must output a large number of numbers
between x and xxxxx in a format that can be pasted into Excel. The
numbers should be as random as possible. I have no programming number,
so the program must be easy to use, and an executable (.exe).

2) In order to enhance the draw each day, I would like a program that
will generate only 1 random number between x and xxxxx, but will do so
in a fashion similar to a lottery, or perhaps like a slot machine,
with a slight delay between each digit chosen. Like 0...... 4.......
5....... 1 instead of just spitting out 451.

The second part of my request is not an absolute necessity. If the
random number generator in 1) is capable of spitting out 1 such
number, even if it does so without staggering the digits, I guess it
would be good enough.

Thanks in advance for your help.

Request for Question Clarification by techtor-ga on 07 Jul 2003 01:26 PDT
So far all the number generator software I could find are shareware
(ranging from $12-99, but mostly around $20). The only free program I
spotted does only 1 to 99, meant for the lottery.

Request for Question Clarification by cynthia-ga on 07 Jul 2003 13:17 PDT
Hi hofferino,

Unless I'm missing something, this Random Number Generator is
downloadable for free to use offline.

Go here:
http://segobit.virtualave.net/rng.htm
And scroll to:
LINEAR CONGRUENTIAL METHOD & BIT SHIFT METHOD
Download them and see if it works for you. The one at the top costs
$20.00, not free, but the screenshot looks perfect, I'm hoping the
free ones are similar!

If these work for you, let me know and I'll post it in the answer box
so I can get paid. If it doesn't work, please clarify why so I can
look for another.

~~Cynthia

Clarification of Question by hofferino-ga on 07 Jul 2003 17:07 PDT
Cynthia-ga,

The random number generators at the link you provided are either
shareware, or freeware -- the freeware version providing only 1 random
number and you can't set its parameters.

I don't know if the shareware one would suit my needs, but I'm not
willing to pay $20 to find out.

The Excel solution posted by carnegie-ga is so far the best for me.

I guess, as neo-dragon-kai-ga suggests, this may call for a custom
program, if no one has as yet done such a thing.

Anyone familiar with Excel macros? Perhaps the slot-machine effect
could be achieved by generating 4 number between 0 and 9 and putting a
time lag for each one showing up. Can this be done??

Request for Question Clarification by cynthia-ga on 11 Jul 2003 11:34 PDT
I don't know enough about formulas to make this work, but I did look
at it and it seems to be what you want. It does not require
installation.

Here's the readme file explanation:

..."This program is a random number generator that uses the equation
r = ((a * b) + c) mod d

Use d for the highest random number generated that you want.

a, b, and c are whatever values you want to generate random as
possible numbers.

It will ask for a then b then c then d then how many numbers you want.

It will write all the random numbers to a file called pad.rnd from the
directory that it was run it.

You will have to play with the equation to find tune how you
want your random numbers. Good Luck..."

Here's the file, let me know if it works for you:
http://www.geocities.com/random1967/random.zip

Clarification of Question by hofferino-ga on 23 Jul 2003 22:00 PDT
Rac-ga, with his Excel macro, seems to have done the trick for me. I
know Excel random numbers aren't truly random, but they're good enough
for me.

Thanks to all who lent a hand!
Answer  
There is no answer at this time.

Comments  
Subject: Re: Freeware random number generator
From: carnegie-ga on 07 Jul 2003 01:11 PDT
 
Dear Hofferino,

In order to place (pseudo-)random numbers into cells of an Excel
spreadsheet, you can use the Excel functions RAND() or RANDBETWEEN(). 
RANDBETWEEN(0,9999) will return the random numbers you require.  A new
random number is returned each time the worksheet is calculated.

Note that RANDBETWEEN() is part of the Analysis ToolPak.  If it does
not appear to be available, you may have to run the setup program
again in order to install the Analysis ToolPak, and/or enable it using
the Add-Ins... command on the Tools menu.

I hope this helps.

Carnegie
Subject: Re: Freeware random number generator
From: haloperidol-ga on 07 Jul 2003 10:21 PDT
 
A non technological solution would be to use several 10 sided dice to
generate the numbers. They are available in many hobby stores.
Subject: Re: Freeware random number generator
From: neo_dragon_kai-ga on 07 Jul 2003 12:14 PDT
 
ok, the dice idea is the actually the most "random" one because
computer doesn't really generate real random numbers.
now, do you want a customized program for windows or something like
that?
Subject: Re: Freeware random number generator
From: haversian-ga on 07 Jul 2003 23:37 PDT
 
Do you have access to a computer running Linux, Solaris, BSD, or one
of the other unix-like operating systems?

Do you have access to a Windows computer running cygwin?

Would you be willing to install cygwin (a free unix environment which
runs within Windows) to arrive at a solution?

Many unices ship with a device called /dev/random which generates very
high-quality randomness.  It is generated one byte at a time, so you
will have to write a simple script to glom together enough bytes to
reach your desired range (2 bytes will do, or more precisely 10 bits)
and then print it as a number.
Subject: Re: Freeware random number generator
From: hofferino-ga on 08 Jul 2003 04:16 PDT
 
Haversian-ga,

Thanks for your interest. I don't run Unix, and I'm scared to tamper
with my system too much. Thanks all the same.
Subject: Re: Freeware random number generator
From: v01d-ga on 11 Jul 2003 07:19 PDT
 
Hello I've written a small C program that generates random numbers. If
you are interested mail me.
Subject: Re: Freeware random number generator
From: rac-ga on 12 Jul 2003 15:05 PDT
 
Hi,
  The sample excel vba macro  will do . Paste this in the excel macro
page and run it. It will display in cell c1 in sheet1, a 4 digit
number each digit generated using random function and display each
digit after some time. To pause time I used a dummy routine in the
program. you can set in the cell z1 in sheet1 how many times the dummy
routine should run based on the pause time needed. Try with number
100000000. Run the program from the tools macro menu.

hope it helps.
RAC

Sub DispRandom()
'
' DispRandom Macro
' Macro recorded 7/12/2003 by Rac

Dim number As String
Dim RndString As String
Dim I As Integer
Dim J As Long
Dim Count As Long


    Worksheets("Sheet1").Range("C1") = ""  'Clear the cell value

    For I = 1 To 4
        number = Int(9 * Rnd())
        Count = Worksheets(1).Range("Z1").Value 'Get the counter value
        
        'Dummy Loop to pass time
        For J = 1 To Count
            A = 2 * 2
        Next J
        
        RndString = Worksheets("Sheet1").Range("C1")
        RndString = RndString + number     'Concatenate
    
        Worksheets("Sheet1").Range("C1") = RndString
            
        
    Next I
    
    
End Sub
Subject: Re: Freeware random number generator
From: hofferino-ga on 13 Jul 2003 00:23 PDT
 
Rac-ga,

I played around with your macro, and it's fantastic! Thanks a million!

One question: If I wanted a number between 0 and 2000, how would I modify it?

Thanks again,

Hofferino
Subject: Re: Freeware random number generator
From: rac-ga on 25 Jul 2003 18:24 PDT
 
Hi,
Sorry I am out city and hope by this time you found the answer to your
question. If not the below code will do
Sub DispRandom() 
' 
' DispRandom Macro 
' Macro recorded 7/12/2003 by Rac 
 
Dim number As String 
Dim RndString As String 
Dim I As Integer 
Dim J As Long 
Dim Count As Long 
 
 
    Worksheets("Sheet1").Range("C1") = ""  'Clear the cell value 
 
        number = Int(2 * Rnd()) 
        Count = Worksheets(1).Range("Z1").Value 'Get the counter value
         
        'Dummy Loop to pass time 
        For J = 1 To Count 
            A = 2 * 2 
        Next J 
         
        RndString = Worksheets("Sheet1").Range("C1") 
        RndString = RndString + number     'Concatenate 
     
        Worksheets("Sheet1").Range("C1") = RndString 
             

    For I = 1 To 3    'As you need now only 3 digits 
        number = Int(9 * Rnd()) 
                 
        'Dummy Loop to pass time 
        For J = 1 To Count 
            A = 2 * 2 
        Next J 
         
        RndString = Worksheets("Sheet1").Range("C1") 
        RndString = RndString + number     'Concatenate 
     
        Worksheets("Sheet1").Range("C1") = RndString 
             
         
    Next I 
     
     
End Sub

Note:
number = Int(2 * Rnd()) 
The Rnd()function gives the random number between 0 to 1. It is
multiplied by the max value of digit you wanted(here 2 and for other
digits 9) The code loop For I to Next I gives the number of digits.
For 0 to 2000 you need first digit to be max of 2 and other 3 digits
max of 9. So we need 2 loops one bloc for max of 2 value and other 3
digit loop for max of 9.

Hope the note is not complicate to understand.

RAC

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy