Live data from Hacker News

A word for a value between 0 and 1 (inclusive)

english.stackexchange.com

221–230 of 325 posts

Re: A word for a value between 0 and 1 (inclusive)

#221
post #75

As the logic dealing with {0, 1} is named after its founder George Boole, a boolean or bool for short. I'd suggest we call a fuzzy truth value in the interval of [0,1] after its founder Lotfi A. Zadeh, a zadehan or zade for short. Edit: Fixed Bool to Boole thanks to globular-toast, my internal syntax checker must have auto corrected that one ;)

I'd only use Zadehan if it not only was a value on the interval [0, 1] but a fuzzy membership value on that interval to which the Zadeh fuzzy logic operators apply.

If it was a probability value to which Bayesian operators apply, Zadehan would be a singularly inappropriate name for the type. Types aren't just ranges but they also define the valid operations (whether syntactically functions, methods, or operators) on the type.

Re: A word for a value between 0 and 1 (inclusive)

#223

"Probability". This question would have a single word answer if it was posted on math.stackexchange.com. literally copy/pasted from wikipedia: > A probability is a way of assigning every event a value between zero and one,

A probability has to lie between 0 and 1 but not every value between 0 and 1 is a probability.

Re: A word for a value between 0 and 1 (inclusive)

#225
post #139
post #90

I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type . In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1]. EDIT: Some of yo…

Great that you like typed languages, and ones that allow for such constrained/dependent typing as well. It seems disingenuous to me to suggest that anyone using other languages do not have this problem. And really, there are quite a few languages to not have this form of typing, and even some reasons for a language to not want this form of typing. So please, don't answer a question by saying "your questions is wrong"…

Sure, such other languages have the problem too, it's just that they are missing the best solution. It's possible for a solution to be simultaneously bad and the best available.

Re: A word for a value between 0 and 1 (inclusive)

#226

I've called this 'unit real' in the past, but wasn't happy with it. 'Portion' is good, from one of the answers. ('Proportion' and 'fraction' unfortunately both suggest a ratio of integers instead of a unit real. It'd sure be convenient if these two different words weren't fixed to that same meaning.) For neologisms, 'tweening' comes to mind. (Think of the coefficient of a convex combination. 'Tweenness' feels just a…

>'Proportion' and 'fraction' unfortunately both suggest a ratio of integers instead of a unit real.

I don't mean to pick on you in particular abecedarius, but I find it amusing to be worried about signalling that irrational numbers are OK given the context is computing and all the numbers are rational anyway.

Re: A word for a value between 0 and 1 (inclusive)

#227
post #185

Earlier quoted context omitted.

I'm genuinely sorry if I came across as condescending, that was not my intention at all. I merely wanted to point out that, in my opinion, this property should be reflected in parameter type, rather than the name. Just like, if we wanted a parameter that should only be a whole number, we wouldn't declare it as a float and name it "MyVariableInteger" and hope that the callers would only send integers. You mentioned th…

So, then the user calling the library with foo(3.5) will get a runtime error (or, ok, maybe even a compile time error). To avoid that, you need to document that the value should be between 0 and 1, and you could do that with a comment line (which the OP wanted to avoid), or by naming the variable or type appropriately: And that takes us back to the original question. (Whether the concept is expressed in the parameter…

[deleted]

Re: A word for a value between 0 and 1 (inclusive)

#228
post #185

Earlier quoted context omitted.

I'm genuinely sorry if I came across as condescending, that was not my intention at all. I merely wanted to point out that, in my opinion, this property should be reflected in parameter type, rather than the name. Just like, if we wanted a parameter that should only be a whole number, we wouldn't declare it as a float and name it "MyVariableInteger" and hope that the callers would only send integers. You mentioned th…

So, then the user calling the library with foo(3.5) will get a runtime error (or, ok, maybe even a compile time error). To avoid that, you need to document that the value should be between 0 and 1, and you could do that with a comment line (which the OP wanted to avoid), or by naming the variable or type appropriately: And that takes us back to the original question. (Whether the concept is expressed in the parameter…

so, basically hungarian notation

Re: A word for a value between 0 and 1 (inclusive)

#229
post #90

I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type . In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1]. EDIT: Some of yo…

I agree that it's a question of type: what would you call that type though?

I propose "pun" - proportion of unity, or "p(er) un".

Re: A word for a value between 0 and 1 (inclusive)

#230
post #90

I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type . In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1]. EDIT: Some of yo…

Is there an example, in any language, showing how you would represent this at the type level? I can’t see how you would do it.

Typescript:

    type NormalisedFloat = number
Admittedly it doesn't add any actual value checking, but it does convey the information when you look at the parameter definition.
Post reply on HN