About the Mod 7. I've checked your question and saw what I feel is a bug in VB. The Mod 7 should map to a value between 0 and 6 always, ..,-7,0,7,14,21,.. Mod 7 = 0; ..,-6,1,8,15,22,.. Mod 7 = 1; ...; ..-1,6,13,20,27,.. Mod 7 = 6. However VB calculates -1 Mod 7 =-1!! This is clearly going...
You should select just one function and use this for your random values.
For a good idea of what the derivative does you should make a graph of the function, for instance x^3. Following the graph you see that near 0, the graph is hardly going up. Therefore points near 0 map to points nearer...
The logic of the math is in the derivitive. The derivitive should be nearer zero where you want the emphasis and away from zero where you do not want it. A function with a derivitive higher than or equal zero is easiest to map, so this why I use x^3. You could also use x^5 or higher, a log or an...
Do you mean something like this?
Dim datFirst As Date, datLast As Date
Dim intFirstDay As Integer, intMyDay As Integer
intMyDay = vbWednesday
datFirst = CDate("1-1-2002")
'keep it less then the first of the next year
datLast = CDate("1-1-2003")
'difference between...
There are quite a number of ways to get some numbers more often than others.
1. As a mathematician I would use some function to remap the values to increase the chances. You could use a random function to generate a number between 0 and 1 and use some function to map into 0 to 1 again, but with...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.