Advertisement

04.14.2005 at 09:50PM PDT, ID: 21389832
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.4

Randomize is not so Random

Asked by vdhant in Active Server Pages (ASP)

Tags: , ,

Hi all
I try and keep it as simple as i can. Basically i am working on a piece of code the generates 4 random numbers (let these numbers be a, b, c and d). Also note that the numbers will always appear in this order. Numbers a through c are random number between 01 and 99 and d is between 0 and 9. Now the way that this code works is it creates one string that contains the 4 number as they are each generated. For example lets say this first string is 1947299, a = 19, b = 47, c = 29 and d = 9.

Now as the string is created it is enters it into the database and the program generates another string (constructed the same way as the first is, and again randomly generating each number in the sequence) and that compares that string to the rest of the generated strings in the database.

Now in doing this i can create the program fine that’s not my problem, my problem is that i would have thought that the chances of getting the same string (which remember is constructed of 4 randomly generated number) appearing twice would have been a fairly remote prospect (lets say about 1 in 10 000 000 chance, which is would be great). Because for the problem at hand i cant have the one sequence appearing more that once in say a run of 5000 strings.

Now when i sat down and ran some tests i was blown away by how often a randomly created string (which is shown to be constructed buy the about) appears.

For example i ran 500 test cases. Each test case consisted of rerunning a script that ran though the process of generating string and kept going until it found one that was repeated twice. Of those 500 tests, 3 finished with the results of ending with less that 100 strings generated before a duplicate was created. A further 50 ended with less that 500 strings generated before a duplicate was created. Then the next 165 ended before 1000 strings generated before a duplicate was created.

In short in all of these test cases NONE of these managed to get above 5000 before finding a duplicate. In fact only 25% of the test cases managed to get above 2500 strings with the other falling under 2500. One would thing if you had a dice with 10 000 000 sides the chances of rolling the dice 4 times and getting number a, b, c, and d the chances of getting this same exact sequence appearing again anytime soon would be pretty remote.

SO does anyone have any idea on how to create a piece that will be able to do the above with a minimum of 5000 strings created before creating a duplicate.

Hope you can help
antStart Free Trial
 
Loading Advertisement...
 
[+][-]04.14.2005 at 10:03PM PDT, ID: 13788154

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2005 at 10:27PM PDT, ID: 13788254

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 12:55AM PDT, ID: 13788740

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 01:03AM PDT, ID: 13788781

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 01:10AM PDT, ID: 13788826

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 04:28AM PDT, ID: 13789668

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 04:33AM PDT, ID: 13789701

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 04:35AM PDT, ID: 13789706

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 04:38AM PDT, ID: 13789727

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 04:45AM PDT, ID: 13789779

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 05:29AM PDT, ID: 13790030

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 06:16AM PDT, ID: 13790325

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 06:20AM PDT, ID: 13790354

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.15.2005 at 06:39AM PDT, ID: 13790515

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 07:16AM PDT, ID: 13790884

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: generate, number, random
Sign Up Now!
Solution Provided By: danataylor
Participating Experts: 6
Solution Grade: B
 
 
[+][-]04.15.2005 at 07:21AM PDT, ID: 13790937

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 04:10PM PDT, ID: 13795400

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2005 at 04:41AM PDT, ID: 13805129

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2005 at 08:53PM PDT, ID: 13873003

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32