## 2/2/09 Randomization

*February 2, 2009 at 2:19 am* *felipecol* *
1 comment *

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.

Blackboard uses Javascript, this programming language as any other uses little pieces of code such as the following to create random numbers.

`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?

Thanks,

Edison.

Entry filed under: Uncategorized.

1.Sam | February 2, 2009 at 3:51 pmIt’s weird to think that math probability is all around us and we don’t even know it. I never thought of how they used random counting such as your biology quiz. I remember in high school, when they would give us assigned seats, it would do it randomly as well.

P.s. is there not supposed to be an extra credit quiz for this post?