Re: Date.getTime()



On 13 Jan 2006 05:39:47 -0800, fritz-bayer@xxxxxx wrote:
> Now I have noticed, that the miliseconds returned by getDate() are
> not uniformly distributed when it comes to the last digit of the
> long number "milis".
>
> Most of the time it remains zero. I guess that's because the
> miliisecond count is always zero in the dates, which I read in.
> However, I thought that the last digit should be uniformly
> distributed from 0 to 9.
>
> That's in fact what I would like to try to achieve. Can somebody
> tell me, which piece of code will turn the miliseconds returned from
> the Date.getTime() function into a number, whose last digit is
> randomly distributed between 0 and 9 ?

Unless I've completely misunderstood the problem, it seems to me that
for any Date representing a time on a whole second boundary, the
number of milliseconds returned by getTime() will always be a multiple
of 1000.

Do you intend to *modify* the dates in order to achieve a random
distribution in the last digit?

Perhaps the problem is the way the timestamps are generated in the
first place, with second accuracy.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Re: Randomness of digits within pi
    ... But what is known about the distribution of larger digits ... The influence of the base makes the decimal expansion ... of numbers that are reflected in the digit expansions (e.g. ... Ok when i come to think of it maybe the digit patterns have a wave ...
    (sci.math)
  • Re: Initial Digit In Random Numbers
    ... engine in which you could input data, such as the area of all the ... as the initial digit 32% of the time. ... areas had the same distribution whether they are measured in square ...
    (sci.math)
  • Re: Random number generation and probabilities
    ... joyo wrote: ... In a non infinite generation, if the mean is K, K ... X in a large digit string is a random variable. ... approximated by a normal distribution. ...
    (sci.math)
  • Re: A weird question about pi
    ... > The short answer is yes, almost certainly, but nobody even knows whether the ... > expansion of pi. ... It appears that the distribution is random for the first 100,000 ... Further work would be needed to ensure that each digit is randomly ...
    (sci.math)
  • Re: Energy constrained RL
    ... It has a cost. ... to me that reversible adiabatic computation can approach zero ... Learning cannot be a reversible process (even though ... entropy of this distribution, and 2) a reduction in the uncertainty of the ...
    (comp.ai.philosophy)