VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak
VBA Random Seed Is Weak VBA Random Seed Is Weak
VBA Random Seed Is Weak
Go Back  Xtreme Visual Basic Talk > > > > VBA Random Seed Is Weak


Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2017, 07:49 AM
zunebuggy zunebuggy is offline
Newcomer
 
Join Date: Sep 2010
Posts: 22
Default VBA Random Seed Is Weak


I only seem to have this issue with Excel VBA. VB 6 seems to handle this better.

I have 4 random values

Code:
Randomize
randomR1 = Int((67 - 1 + 1) * Rnd + 1) 
randomR2 = Int((3 - 1 + 1) * Rnd + 1) 
randomR3 = Int((1409 - 1 + 1) * Rnd + 1) 
randomR4 = Int((5449 - 1 + 1) * Rnd + 1)
So I have words in columns A, B and C
A has 1409 words
B has 5449 words
C has 67 word

They are put together in 3 ways and that is determined by randomR2

I am surprised at the number of exact repeats when we are talking random. The odds of all 4 of these numbers coming up the same sometimes 4 and 5 times in a row are astronomical and points to serious flaws in the randomness.

Is there anything I can do (besides keeping an array of already used combinations) to make my random closer to true random. Maybe there is a website where I can use a function to pull a seed number for the Randomize command? Randomize Timer does not do anything either.

Like I said, the VB6 random seed generator was a little more random then Excel VBA is, but this is what I have to work with.

Thank you,
Z
Reply With Quote
  #2  
Old 04-07-2017, 09:24 AM
OnErr0r's Avatar
OnErr0rVBA Random Seed Is Weak OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,774
Default

This is regarding VB6 Rnd, but I doubt VBA uses anything different: Random Numbers
__________________
Quis custodiet ipsos custodues.
Reply With Quote
  #3  
Old 04-12-2017, 08:31 AM
Daigon Ali Daigon Ali is offline
Regular
 
Join Date: Aug 2014
Location: London
Posts: 59
Default

If this is in a loop then you could try the Randomize once before staring it or maybe leaving it out altogether.
Reply With Quote
Reply

Tags
random, rnd, randomize, words, seed, vba, randomr2, excel, closer, true, combinations, serious, astronomical, row, flaws, randomness, keeping, array, generator, vb6, pull, times, function, command, timer


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak VBA Random Seed Is Weak
VBA Random Seed Is Weak
VBA Random Seed Is Weak
 
VBA Random Seed Is Weak
VBA Random Seed Is Weak
 
-->