( ! ) Notice: session_start() [function.session-start]: Server 127.0.0.1 (tcp 21201) failed with: Failed reading line from stream (0) in /var/www/html/common-2.3/SWAT/SWAT.php5 on line 108
Call Stack
#TimeMemoryFunctionLocation
10.000496768{main}( )../discussion.php5:0
20.0010177376include_once( '/var/www/html/interactivate/config/standardIncludes.php5' )../discussion.php5:22
32.561718516784SWAT->startSession( )../standardIncludes.php5:110
42.561818516784session_start ( )../SWAT.php5:108
Interactivate: Random Number Generators

Interactivate


Random Number Generators


Shodor > Interactivate > Discussions > Random Number Generators

Mentor: Can you come up with several fair ways to randomly choose a number from 1 to 3? From 1 to 5? From 1 to N? (That means your method should work for any number.)

Student 1: We can put as many numbered balls in a bag as we want, and pull one out each time we need a random number:

Student 2: Or we can buy a lottery machine:

Student 3: Or we can build a spinner:

Mentor: Indeed, all these methods will work for any number. We can also use a computer program to give us numbers in a fair way. These programs, not surprisingly, are called random number generators.

Can you come up with more ways to randomly choose a number?


a resource from CSERD, a pathway portal of NSDL NSDL CSERD