Has it ever happened to you that you feel like you used to know something but you don’t remember it anymore? Well that happened to me today as I went through the Finite Mathematics textbook. Some of those though problems brought back memories of long math study nights at the library a couple years ago.
On the bright side, as I went through the book I also found some pretty interesting stuff about random numbers and probabilities in chapter 7. It called my attention because often times random algorithms are used in web pages, games and many other computer applications that I am familiar with.
Just to give you an example the other day I accessed my blackboard to take a biology quiz. The quiz was composed of 9 questions pulled out straight from the book and I could take it as many times as I wanted, easy A you might say!, but here is the catch. I had to get all the 9 questions right in order to get credit. In my first attempt I got 6 questions right, so I had to try again but guess what! The questions were completely different this time and so were the next 3 attempts (Yes it took me 5 attempts to pass the quiz). That is what random algorithms do. This kind of blackboard quiz uses a pool of questions and randomly selects a set of nine. Let’s do some math! there were 9 questions and say there were 5 different alternates per question, so that means that I had 5 9= 1,953,125 possible quizzes! Talk about learning biology.
function rand ( n )
return ( Math.floor ( Math.random ( ) * n + 1 ) );
Basically this function takes a whole number argument,
n, and returns a random number between 1 and
n. then uses other methods to finally leave us with a whole integer number.
For my Bio quizzes the random numbers produced by such code are each associated to a set of questions so that I get a different quiz every time.
Random number generators have applications in gambling, statistical sampling, computer simulation, cryptography, and other areas where a random number is useful in producing an unpredictable result. Here are a couple of links to pages showing some interesting applications.
Then considering that using random results is so useful, maybe next time you are debating whether or not to go out, why not let an unpredictable coin toss decide for you?
Entry filed under: Uncategorized.