## sonisuhas

how does the ramdomize function works??
does it have some formulae to bring out its output?

## jakesee

how does the ramdomize function works??
does it have some formulae to bring out its output?

afaik, a sequence of digits e.g. 8532054032548682364893584362054... is stored in ... (somewhere) ...; Before the call the rand() function, you supply it with a "seed" which sorts of put a finger at one digit position. The next time you call the rand() function, it will iterate through the sequence, producing psuedo random numbers. It is random, because you don't know where it is starting at. It is psuedo, because it isnt really random.

You can verify this by using a for loop and supply the same seed each time you call rand(). You will see that you will always get the same digit as output.

Although I am not sure if you restarting the program / computer / clock will change the sequence or not.

## nerdinator

If you are referring to the function that returns a random number...
Good question.Computers can't generate random numbers the way our mind does,random itself is kind of strange,not that well defined.
I think it could be done by using the time function.

## Narue 5,707

>how does the ramdomize function works??
>does it have some formulae to bring out its output?

This random number tutorial might help.

>Computers can't generate random numbers the way our mind does
Our minds are exceptionally bad at coming up with random numbers. If you grab anyone off of the street and ask them to come up with fifty random numbers, you'll probably find a distinct pattern. The most common patterns are no repetitions, excessive odd numbers, and alternating large and small numbers.

## nerdinator

>
Our minds are exceptionally bad at coming up with random numbers. If you grab anyone off of the street and ask them to come up with fifty random numbers, you'll probably find a distinct pattern. The most common patterns are no repetitions, excessive odd numbers, and alternating large and small numbers.

Well,you cant decide anything out of 50 numbers.That really make any sense.Let the random function print 50 numbers and I'll decipher a pattern out of it.
So,as long it 'seems' random it does the job.So,more the random it 'seems' the better it is.

## Narue 5,707

>Well,you cant decide anything out of 50 numbers.
It was an example. The point is that people are notoriously bad at coming up with suitably random numbers. I believe it's because of two things:

1. Humans are very good at thinking in structured ways. Even if you think you're being random, it's probably not even close.
2. Most people don't understand what it means to be random. If you get a repeated value, I suspect the vast majority will say that it's not random.

>Let the random function print 50 numbers and I'll decipher a pattern out of it.
Okay, then please do so:

``````33  45  48  29  13   8  46  32   7  21
27   3  11  14   6  20   5  37  26  49
22  38  24  44  39  28  17  16  41  34
43  36   4  30  23  25  12  18  31   2
9  40  15  50  10  19  42  47  35   1``````

## nerdinator

start quote:

``````33  45  48  29  13   8  46  32   7  21
27   3  11  14   6  20   5  37  26  49
22  38  24  44  39  28  17  16  41  34
43  36   4  30  23  25  12  18  31   2
9  40  15  50  10  19  42  47  35   1
``````

end quote.

If these numbers end here,I'd say something like:
let user start with x.
the series is `x,x+12,x+15,x-4,...` I think you get it.
So,I don't there is any real sense if you say '50 random numbers'.

And you are right about

Most people don't understand what it means to be random. If you get a repeated value, I suspect the vast majority will say that it's not random.

If you think of a real theoretical random function,there is a probability that numbers repeat.

## WaltP 2,905

>Let the random function print 50 numbers and I'll decipher a pattern out of it.
Okay, then please do so:

If these numbers end here,I'd say something like:
let user start with x.
the series is x,x+12,x+15,x-4,... I think you get it.

You're kidding, right? Yeah, we get it, Smokey :icon_rolleyes:

## Narue 5,707

>let user start with x.
>the series is x,x+12,x+15,x-4,...

How very droll. Though it frightens me that you might actually be serious.

## firstPerson 761

>> Computers can't generate random numbers the way our mind does

Citation please? I am interested on where you got this info.

## nerdinator

>let user start with x.
>the series is x,x+12,x+15,x-4,...

How very droll. Though it frightens me that you might actually be serious.

lol.Easy on me!
So,if the series is an AP,then it is not random,GP,it is not random,
but if there is more than one relation between 2 consecutive numbers,then it is random,huh?
Suppose you want a computer to decipher some sense out of those numbers you gave,it would display infinite number of relations including the one I gave.

[TEX]2,5,7,8[/TEX]
What can you mean if you said the four numbers are 'random'?
:icon_question:
One might say it is random,another might say it isn't.

## Narue 5,707

>One might say it is random,another might say it isn't.
One might also say that in trying to sound intelligent, you missed the point completely.