Also, I don't understand what you mean by 'mathematically pure', but that's on my end.
Also, I don't understand what you mean by 'mathematically pure', but that's on my end.
The other way is to ask "what is a function"?
Normally, a sorting function is expressed as
sort(List[Comparable]) -> List[Comparable]
your sorting function however has a different way of working. It has an additional input, the time. Now you might argue that you aren't taking the time as input, but you are...somehow. So in reality, your function has a signature sort(int, List[Comparable]) -> List[Comparable]
There's this extra int input which is weird, so you don't have. Computational complexity tools like O-notation don't concern themselves with such things. O notation only cares about how the runtime changes as the size of the input changes.If the size of the int "time" is bounded (which it is, since the max is 86400), then one of the inputs is constant. It can be ignored.
Purity in this context is the idea that the function only acts on its inputs, there are no external forces that modify how it works. Pure functions are mathematical objects, impure functions aren't really.
So once you convert your construction to being pure, it becomes more clear why the function is ill-formed: you've got this extra constant size input (that runtime analysis can ignore) that you claim affects the runtime. Something is clearly amiss.