"Synchronize watches!" Classic phrase from war movies.
Usually actors / soldiers used of chronographs, but if they used mobile phones which do not specify the second thing would have happened?
I imagined a number of people who want to synchronize their clocks without knowing the latter. An example:
B: "What time is it?"
A "15 and 24." [Of course the latter may be an unknown random number between 0 and 59]
B: "ok." [B regulates' 15:24 hours on].
suppose then C to B and ask time after time to ask D to C and so on, all this for an arbitrary number N of people.
E ' interesting to see what the difference between the real time (that of the first clock) and time measured by N-th clock.
Now there are two schools of thought. The first (1) provides that in the previous week B at 15:24 hours the exact
while the second (2) assumes that B will take the second of his watch that the chip in this case a random number between 0 59. For which of the two methods has the minor fault (now real than it is now measured by N-th clock)?
I made a PHP script in which the ith person asks for time to (i-1) th person after a random number of seconds (in order to avoid having a synchronization that would send a snapshot and can **** all ). It 'did for N = 1000.
The results using the method (2) are shown in the figure. The red lines, green, blue and purple, are simulations of synchronization with 1000 clocks, while the yellow and black are the random walk. Note the similarity. If you apply method instead (1) is lost at each step a random number of seconds, then the end result is dramatic because the difference between real time and time measured by the ith clock is monotonically increasing with i.
Now you know how to minimize damage to a synchronization crazy.
(and some clocks moving at near the speed of light? Kidding.)
Figure: index of the various clocks against the difference between the ith clock and real time in seconds. Red, green, blue and purple: watches, black and yellow: random walk. I apologize to the colorblind.
0 comments:
Post a Comment