HN user

daveFNbuck

3,803 karma
Posts1
Comments1,677
View on HN

That's not p hacking. That's just the nature of p values. P hacking is when you do things to make a particular experiment more likely to show as a success.

If you do that, people outside the package can also do Username(x) conversions instead of calling NewUsername. Making value package private means that you can only set it from outside the package using provided functionality.

They show the DFA for it on the site, it's 3 states. There's a starting state for the first . and then two states that transition back and forth between whether z was the last character or not.

I think what's actually happening here is that they're doing the intersection on the DFAs and then producing a regex from the resulting DFA. The construction of a regex from a DFA is where things get ugly and weird.

Having a constant runtime means there's a constant bound on the runtime, not that the runtime is an exact constant value. 100 + 1/n would still be constant, as it's bounded above and below by constants.

To have sub-constant time it would have to go to 0 as n increases, as otherwise we could bound the time below by a constant. This isn't possible, as a computer will take at least 1 time unit on every input. So the expected time will always be at least 1.

An algorithm can't have that property for its expected runtime, as it can only look at a sub-constant amount of the input of it runs in sub-constant time.

it's not possible for it to behave differently as n increases because it doesn't have enough time to distinguish between different values of n once it's large enough.

I'm not sure what your big-O expression is supposed to mean, but if a sequence is decreasing and bounded below (which runtime is) then it has a limit. Since the sequence is discrete, it can't get arbitrarily close to the limit without reaching it. So at some point the runtime will stop decreasing.

You can approximate the runtime with a function that decreases forever, but the actual runtime will be constant for large enough n.

Running any (halting) algorithm on a human computer is constant time, because you're bound by the number of states you can fit into some terabytes, but nobody should actually try to use that as a final analysis.

That's the sort of thing I would usually say to explain why we do things like use asymptomatic analysis and ignore polynomial factors. If you have a different solution, that's great, but you're no longer taking about the kind of runtime the article is about.

"constant time" in complexity theory just means there's a constant bound on runtime. It doesn't have to actually have the exact same runtime down to the instruction for every input. Here, the bound would be a quadrillion.

Of course, showing a constant upper-bound doesn't tell us that it isn't even faster than constant as in the proposition I was responding to. That's why I focused on the constant lower-bound.

You can't have that because when N=K that's not a valid expression and when N>K you're putting a negative number in the big-O notation. You can't have negative runtime.

All algorithms have a lower-bound on runtime of 1. If a sequence is decreasing and bounded below, it converges to a value [1]. If the sequence is discrete, that means it reaches exactly that limit and never deviates from it.

[1] https://en.wikipedia.org/wiki/Monotone_convergence_theorem

Edit: it is trivial to construct an algorithm with this property.

It's actually impossible to construct an algorithm that has its runtime decrease as the input size grows. You can do this for finitely many examples, but we're talking about asymptotics here. With discrete run-times and a lower-bound of 1 operation, the run-time will have to stop decreasing at some point and just stay at the same constant value for all but finitely-many exceptions. This makes it a constant-time algorithm.

A constant run-time is a counter-example to that caption though, as the problem doesn't take longer as the input grows. An example would be checking if a number is divisible by 2. You only need to check 1 bit, so it doesn't take any longer as you add more bits that the algorithm doesn't touch.

I think the key thing you're missing here is that they were talking about behavior as the number of flips goes to infinity. That long improbable upper end becomes more and more improbable over time. As time goes to infinity, the probability of being in it goes to 0. With a finite population, everyone is ruined.

I ran the same simulation as you. After 100 iterations, the richest one had $71. After another 1,000 iterations, the richest one had $78 (of a total $133). After another 10,000 iterations, the richest one had 10^-165 dollars. They were still an extreme outlier with 95% of the total wealth, but he had almost nothing.

Likewise if the free market is used as a way to reduce the availability of content, I can be against that while still supporting it as a guiding concept.

Joe Rogan being on Spotify is entirely about limiting the availability of his podcast. They're paying him to not make his episodes available outside of Spotify.

An Odd Card Trick 5 years ago

You're misunderstanding the objection. They're saying that if you move 1L of wine to the water side, the side you poured into will have fewer than 11L and when you pour 1L back the two sides won't have equal volume.

Sure, every time anything happens to you, your state of mind is different. My point is that the relevant part of your state of mind doesn't necessarily change.

If you report a different number, that means some things in your mind changed. Those things may or may not include the level of pain you're experiencing.

Let's take an example with a bit more objectivity. If you ask me to rate how long a tv show is on a scale of 1-10 and I know the show is 30 minutes, how do I turn that into a 1-10 scale? Suppose I mostly watch shows with 12-minute episodes. This is relatively long, so I give it an 8.

Later I start watching hour-long shows. You ask me again how long this show is on a 1-10 scale. Now I put it at a 5. I don't think the show got shorter, and I don't experience it as being shorter. I just changed how I contextualize the length of shows for a 1-10 scale.

It would be silly to say that watching hour-long shows is a good way to shorten the mental experience of watching a 30-minute show.

They haven't even necessarily changed the state of their mind. It's hard to accurately report your own subjective experiences in a measurable way. Maybe you're not sure where your pain falls on a 1-10 scale. There's a range of numbers you think might fit how you feel.

Before a placebo treatment, you pick something at the higher end. After the treatment, you think maybe it helped, so you pick something on the lower end despite feeling the same.

Maybe you even feel worse than you did at the start of the study but you've gotten used to a higher baseline amount of pain and you're having a relatively good morning compared to that so you report a low number.

This is about how your self-reports change, not necessarily about how your state of mind changes.