473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

RandomClass

mia023
89
Does the random class checks if the numbers are duplicate or not with out me implementing the algorithm for checking if duplicate?
Jan 1 '08 #1
1 1149
chaarmann
785 Expert 512MB
Does the random class checks if the numbers are duplicate or not with out me implementing the algorithm for checking if duplicate?
You can see the answer already in your thread "checkNonDuplicates".
If you are in doubt about what I said, read in Internet about the definition of "random", then you can see who is wrong and who is right.

But to illustrate it to you, just think of throwing a dice many times:
The numbers returned are random.
It could be that you throw 6,6,6 one time. Or you throw 1,2,3 another time. All sequences have the same possibility. If some sequences don't, that means if I don't have the possibility to throw 3 times 6, then my dices are not random anymore!

A computer cannot produce real random numbers, they are all pseudo-random. But they simulate the natural ranomness pretty much, exactly what you need, especially if you "seed" with the current time.
For example Math.random().
Jan 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tim Smith | last post by:
I have 20-50 methods (C# or Java) with the following identical content which I wish to write only once! public SomeObjOrVoid MethodDiffSigEachTime(SomeParams p) { ResouceObj resObj = null;...
9
by: abhi | last post by:
How do you get random numbers in vb .net? I want random six digit numbers. Cheers, Abhi
4
by: darrel | last post by:
I can grab a random number in vb.net like this: Dim RandomClass As New Random Dim RandomNumber As Integer RandomNumber = RandomClass.Next(1, 26) However, what I want is a random number. Short...
4
by: Ricardo | last post by:
Hi wizards, I have an object , this object generate a set of 9 random numbers. When I generate for example 10 object his 9 random numbers are equals. How can I make this 9 numbers are different...
1
by: Martin Pöpping | last post by:
Hello, I´ve to implement an array which sum always have to 1. In the API Documentation I´ve found Random.NextDouble(), but it always returns a value x with 0.0 <= x < 1.0. Is there a range...
3
by: Cherenee | last post by:
I have the task of creating a tic tac toe game on a 4x4 board. It is a one player game with the computer as the opponent. The player (blue) clicks on a button and the computer (red) should...
9
by: Dariusz Tomoñ | last post by:
Hello, I'd like to include JS from C# code (ASP.NET 2.0). I'm trying not directly from i.e. default.aspx.cs code but from a class belonging to DLL, which is referred in my project. The code...
2
by: lamanvic | last post by:
i am trying to create a list of array with random numbers and use the colour sort to sort them to let the negative number on LHS zero in middle and positive number on RHS and print out the sorted...
0
by: phumla | last post by:
THIS MY CODE,OUTPUT EXPECTED IS EVERYTIME THE IFSTATEMENT IS TRUE, WRITE A LETTER " G". ENTER NEXT NUMBER , WIRTE AGAIN LETTER "O" .ENTER NEXT NUMBER ,ENTER NEXT NUMBER WRITE AGAIN LETTER "N" AND...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.