Not Yet Answered # how does it work

jakesee nerdinator Narue 5,707 nerdinator Narue 5,707 nerdinator WaltP 2,905 Narue 5,707 firstPerson 761 nerdinator Narue 5,707 Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

0

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.

*Edited 6 Years Ago by jakesee*: n/a

0

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.

0

**>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.

0

>

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.

*Edited 6 Years Ago by nerdinator*: n/a

0

**>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:

- Humans are very good at thinking in structured ways. Even if you think you're being random, it's probably not even close.
- 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
```

*Edited 6 Years Ago by Narue*: n/a

-1

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.

*Edited 3 Years Ago by mike_2000_17*: Fixed formatting

0

>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:

1

**>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.

0

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

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

0

>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.

*Edited 6 Years Ago by nerdinator*: n/a

1

**>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.

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

code for the listbox - datagridview interaction

At the top of the code ...

the function that I created to find the ...