Hacker News new | past | comments | ask | show | jobs | submit | laneb's comments login

I appreciate the author showing some of the math that drives the optimization. As a reader, I'd suggest introducing SGD ahead of the PD calculations, because it would give a clearer motivation for the PDs.


The typical operation applied to sets of functions is composition, so idempotency of a function f is the condition that f(f(x)) = f(x) for all x in the domain of f. I don't think that applies meaningfully to GET.


It does apply to HTTP idempotency. `x` is the state of the server. `f` is the change to the state of the server that ensues when one makes such-and-such an HTTP call. So taking PUT as an example, `x` is the state before the PUT, `f(x)` is the state after one PUT, and `f(f(x))` is the state after that single PUT is sent twice. Of course in a RFC7231-compliant server, `f(x) = f(f(x))`. Taking GET (or any other nullipotent method) as an example, we also see that in a RFC7231-compliant server, `x = f(x) = f(f(x))`.


Ah yeah that makes sense.


Technically speaking, idempotency as defined by RFC7231 only requires f(x) = f(f(x)).


Yes, and nullipotency requires x = f(x) = f(f(x)), and four of the methods defined in RFC7231 are expected to be nullipotent, otherwise known as "safe". The point of mentioning that is to highlight the relationship between idempotence and nullipotence.


Nothing about names like StopIteration and AttributeError indicate to me that I should use them for control flow. Python just instructs me to use them that way...


My point is, that part of python is IMO a bit ugly. Not due to naming, but because these are exceptions. A type system with good use of optionals across the standard lib is certainly more elegant than ValueError.


The birthday paradox arises because the probability that two candidates do not match is small compared to the number of candidates. In this case, the candidates are photos and a match in fact requires a match on multiple variables (e.g. angle, timing) that are effectively continuous. A match between 2 arbitrary photos must then have zero-ish probability and a non-match must have one-ish. So it still seems inestimably improbable that something like this would happen.


I'm not so sure. While there are multiple variables, chances are the number of landmarks in a given area that a professional photographer will consider likely to stand out as worthwhile in a storm is not all that great. While I'm not a professional photographer, I can think of maybe 3-4 places near me, for example.

And storms do not happen that often, even in places that have them "frequently", and they delimit the time, and even further by e.g. limitations such as whether the wind is too strong or the rain too heavy.

The number of locations they're likely to consider good spots to take the photo from for a given landmark may not be that great either. Both in terms of where you can actually see the landmark from, and in terms of other factors (e.g. in this case the article writer points out that both photographers had found places where they could protect themselves against some of the effects of the weather)

So that narrows locations and timeframe significantly.

Professional photographers are likely to take their time - the article writer mentions 40+ minutes of shots, and using bursts, further increasing the chance for an overlap within already relatively narrow time frames.

Additionally, external events that are the same for both (the waves) will give impulses to both with respect to when to shoot (though of course they might value different things, I'd argue people are more likely to shoot when something dramatic happens - e.g. if you have a dull day and suddenly something happens, you don't expect the pictures of that day to be evenly spaced afterwards).

I'm not saying we should expect it to happen all the time, but I also think it's easy to overestimate the number of possibilities because we've not tried to enumerate which ranges of values are actually likely.


There are probably well over 10 trillion photos taken. Less by professionals, but they are more likely to take the same photo.

Anyway, that low probability applies to every other photo. So, the first photo is compared to every other photo and by the end your talking ~50,000,000,000,000,000,000 comparisons. The odds would have to be mind boggling tiny for this not to happen all the time.


You're missing the other dimension to this: it's not that two photographers took pictures at the exact same time, I'm sure that happens frequently. It's that they took the exact same picture. There were definitely not 10 trillion photos take of this lighthouse in new england.


They don't have to be photos of this lighthouse. Two photos of Old faithful showing the same spray and cloud patterns could be mistaken for copy's of each other.

Another way of thinking about it, what are the odds that out of the ~1,000 photos taken of the same moment they are of the same subject? Now repeat that question 10 million times and the odds don't seem as low.


Especially if people are clustering around interesting happenings.


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: