Skip to main content
added 49 characters in body
Source Link

Let's suppose we have this expression:

(i % 1000000) * 1000 + ms

where i is an always increasing number, and ms is the millisecond part of the current time ( ranging 0..999). So whileeach time we are calling the expression above, at random intervals, while i is increasing ialways obtaining all unique values, the result of the expression above will potentially returns duplicated, intuitively. How to show this in an acceptable form? Is there a way to show the probability next iteration will generate a duplicate?

Let's suppose we have this expression:

(i % 1000000) * 1000 + ms

where i is an always increasing number, and ms is the millisecond part of the current time ( ranging 0..999). So while we are increasing i obtaining all unique values, the result of the expression above will potentially returns duplicated, intuitively. How to show this in an acceptable form?

Let's suppose we have this expression:

(i % 1000000) * 1000 + ms

where i is an always increasing number, and ms is the millisecond part of the current time ( ranging 0..999). So each time we are calling the expression above, at random intervals, while i is increasing always obtaining all unique values, the result of the expression above will potentially returns duplicated, intuitively. How to show this in an acceptable form? Is there a way to show the probability next iteration will generate a duplicate?

Source Link

Prove that an expression can create duplicate

Let's suppose we have this expression:

(i % 1000000) * 1000 + ms

where i is an always increasing number, and ms is the millisecond part of the current time ( ranging 0..999). So while we are increasing i obtaining all unique values, the result of the expression above will potentially returns duplicated, intuitively. How to show this in an acceptable form?