I don't have any mathematical background, so please excuse my language.
motivation
- Two different computers running a clock which is being reset to the same value (integer, i.e 1464009526876).
- There will be no communication between the two computers from this moment forth
- Due to various reasons, the two clocks will eventually go out of sync
- I'm only interested in functions that specifically call for data from the clock, due to potential differences between the machines, there might be a different call number between the two
- I don't care about the value itself
- I do care for it to be different on each call, and overall having the same value on both ends
- I am willing to sacrifice a certain amount of time in which this value won't change
problem
Assuming two positive integers (a, b), which have a difference of no bigger than (d), which is a constant that can be decided upon beforehand.
The algorithm, accepting a single number(a|b) as an input, will output a new integer which is relative to both, hopefully placed somewhere between the two.
This integer will be the same for both, and basically all numbers within the defined range.
example
a = 1464009526876;
b = 1464009514876;
alg(a); // output: 1464009526800
alg(b); // output: 1464009526800
My overall challenge is to sync the two numbers, and try to generate values that are different, yet somewhat close to the initial reset value and/or the average/relative time passed.
Using NTP won't cut it due to its need to poll for the data (also, as mentioned before, I don't care about the value itself, just for it to be identical and relative to the original reset value).