Live data from Hacker News

Negative Base

en.wikipedia.org

71–74 of 74 posts

Re: Negative Base

#71
post #54

Earlier quoted context omitted.

Are there common languages where -0 != +0? Or are you implying that this would be a good decision when creating a new language?

javascript: > 1/(-0) -Infinity > 1/0 Infinity > Object.is(0, -0) false Of course = doesn't actually test equality in javascript. == reports -0 as being equal to +0, but Object.is reports them as different.

See now, I contest this particular defense because it groups together 'javascript' and 'good decision'.

Re: Negative Base

#72

Earlier quoted context omitted.

Is it not a binary search problem?

I don't want to give too much away but consider that if you start by weighing 6 coins against the other 6, you already know what's going to happen.

Wrong. You don't know which side will be heavier

Re: Negative Base

#73

Earlier quoted context omitted.

Is it not a binary search problem?

Not really - you can reduce it to one but you don't quite have enough information. So I think it goes like this: - you have 12 coins, and each one has an equal chance of being heavier or lighter than the others - so that's 24 possiblities - you have 3 moves, and the result of each move could be one side of the beam goes down, one side goes up, or it balances. That means you can create a system that identifies 3^3 = 2…

"that means you're not really getting any information if the beam balances"

Wrong. If it was true, that would imply that the probability of it balancing is 1, since the information you get is -log2(probability). Obviously the probability of it balancing is lower than 1, so you do get information.

Re: Negative Base

#74
post #73

Earlier quoted context omitted.

Not really - you can reduce it to one but you don't quite have enough information. So I think it goes like this: - you have 12 coins, and each one has an equal chance of being heavier or lighter than the others - so that's 24 possiblities - you have 3 moves, and the result of each move could be one side of the beam goes down, one side goes up, or it balances. That means you can create a system that identifies 3^3 = 2…

"that means you're not really getting any information if the beam balances" Wrong. If it was true, that would imply that the probability of it balancing is 1, since the information you get is -log2(probability). Obviously the probability of it balancing is lower than 1, so you do get information.

You don't get any information if the probability of the beam balancing is either 1 or 0. If you put everyone on the scale, the probability that it will be balanced is 0 - you don't learn anything. So the trick is to exclude some of the sample group in every measurement. You can use a binary search strategy where you divide the coins into "on the scale" and "not on the scale" groups, until you have a set of two that definitely contains the one you're searching for (and then one more measurement will tell you which one of those two it is) - but that strategy requires too many measurements, so you need to use more information at each stage, and you can't throw out coins you've determined to be non-counterfeit.
Post reply on HN