Live data from Hacker News

Are two heads better than one?

eieio.games

71–78 of 78 posts

Re: Are two heads better than one?

#71

No one commenting on the inaccuracy (or at least imprecision) of the Python output cited in the article?? "A:T, B:T - chances - H 6.0% | T 94.0% | occurs 34.0% of the time" By the simplest of math for unrelated events, the chance of both A & B lying about the coin is 20% of 20%, or .2 * .2 = 0.04, or 4.0% ... The "Let's prove it" section contains the correct analysis, including that our chance of being correct is 80%…

This is an interesting question!

But no, the python output is correct (although I do round the values). It's counterintuitive but these are two different questions:

    1. What are the odds that both players lie? (4%)
    2. Given that both players say tails, what are the odds that the coin is heads (~6%)
Trivially, the answer for question (1) is 0.2 * 0.2 = 4%

The answer for question (2) is 0.02 / 0.34 = 6%

One way of expressing this is Bayes Rule: we want P(both say tails | coin is heads):

    * we can compute this as (P(coin is heads | both say tails) * P(coin is heads)) / P(both say tails)
    * P(coin is heads | both say tails) = 0.04 (both must lie)
    * P(coin is heads) = 0.5
    * P(both say tails) = 0.04 * 0.5 + 0.64 * 0.5 = 0.34
This gives us (0.04 * 0.5) / 0.34 = 0.02 / 0.34 ~= 6%

I think that might not be convincing to you, so we can also just look at the results for a hypothetical simulation with 2000 flips:

    * of those 2000 flips, 1000 are tails
    * 640 times both players tell the truth
    * 40 times both players lie
    * 680 times (640 + 40) both players *agree*
    * 320 times the players disagree
We're talking about "the number of times they lie divided by the number of times that they agree"

40 / 680 ~= 6%

We go from 4% to 6% because the denominator changes. For the "how often do they both lie" case, our denominator is "all of our coin flips." For the "given that they both said tails, what are the odds that the coin is heads" case, our denominator is "all of the cases where they agreed" - a substantially smaller denominator!

The three players example is just me rounding 89.6% to 90% to make the output shorter (all examples are rounded to two digits, otherwise I found that the output was too large to fit on many screens without horizontal scrolling).

Re: Are two heads better than one?

#72
post #45

Earlier quoted context omitted.

You will have an error rate of less than or equal to 1%. You can't average two measurements and get a result with a higher error rate than the worst of the original measurements had. You wouldn't be well served by averaging a measurement with a 1% error and a measurement with a 90% error, but you will have still have less than or equal to 90% error in the result. If the errors are correlated, you could end up with a…

My reasoning is that a clock is either right or wrong. The average of a right and a wrong clock is wrong. Half as wrong as the wrong one, but still wrong. If this is a good mental model for dealing with clock malfunctions depends on the failure modes of the clocks.

This is not how continuous probabilities work. The probability that a clock is exactly right is zero; hence there is always some error in a measurement of time. Adding additional clocks will always cause the error to be less or equal to the maximum error.

Re: Are two heads better than one?

#73

What if, in the event of a tie (just Alice & Bob), we always decide to trust Alice. Would that not improve our probability of guessing the tie correctly, i.e. back to 80% success?

no in fact that's the proof that adding Bob doesn't help. If Alice & Bob disagree, then since both are correct with same probability it doesn't matter if you pick alice or bob. So WLOG you choose to trust Alice. But now when Alice and Bob agree, that means that you also trust Alice's output [as in you're only right if Alice is right (which is same as when Bob's right since Bob and Alice match)]. So in both cases you are right when Alice is right, i.e. you trust Alice and that means you don't even care about Bob's output.

I think why it feels odd is that most people intuitively answer a different question. If you had to bet on an outcome then Alice and bob agreeing gives you more information. But here you're not dealing with that question, you're either right and wrong; and whether or not Alice & Bob agree, you're effectively "wagering the same" in both cases (where your wager is 0.8, the probability [or expectation] that one is correct).

Re: Are two heads better than one?

#75

Earlier quoted context omitted.

I’ve never heard the bring one or three, I’ve always just heard three. I think that exact saying implies that if you have two and one isn’t working out you’ll go crazy but if you have one you’ll be oblivious until it’s too late. A well serviced rolex in 2026 with laser cut gears drifts +/- 15sec per day. One with hand filed gears is going to be +/- a minute on a good day, and that’s what early navigation was using. I…

15s per day sounds EXTREME. Are you even serious? Even the cheapest Chinese hand watch has 50x better precision.

I am serious, mechanical watches are fascinating but they are much less accurate that a cheap quartz watch.

Re: Are two heads better than one?

#76

What if, in the event of a tie (just Alice & Bob), we always decide to trust Alice. Would that not improve our probability of guessing the tie correctly, i.e. back to 80% success?

no in fact that's the proof that adding Bob doesn't help. If Alice & Bob disagree, then since both are correct with same probability it doesn't matter if you pick alice or bob. So WLOG you choose to trust Alice. But now when Alice and Bob agree, that means that you also trust Alice's output [as in you're only right if Alice is right (which is same as when Bob's right since Bob and Alice match)]. So in both cases you…

[deleted]

Re: Are two heads better than one?

#77

What if, in the event of a tie (just Alice & Bob), we always decide to trust Alice. Would that not improve our probability of guessing the tie correctly, i.e. back to 80% success?

no in fact that's the proof that adding Bob doesn't help. If Alice & Bob disagree, then since both are correct with same probability it doesn't matter if you pick alice or bob. So WLOG you choose to trust Alice. But now when Alice and Bob agree, that means that you also trust Alice's output [as in you're only right if Alice is right (which is same as when Bob's right since Bob and Alice match)]. So in both cases you…

Although revisiting this, you have to be a bit careful about the argument.

Basically what you're doing is breaking down p(correct) = p(correct & agree) + p(correct & disagree) where former is 0.8*0.8 and latter is 0.8*0.2. Explicitly computing the conditional probability however makes calculating more difficult: p(correct | agree)*p(agree) + p(correct | disagree)*p(disagree). This is something like (16/17) * (0.8*0.8 + 0.2*0.2) + 0.5 * (0.8*0.2*2) which is not easy to arrive at intuitively unless you grind through the calculation.

So _conditioned_ on them agreeing you are right ~94% while conditioned on them disagreeing it's a coin-toss (because when they disagree exactly one is right, and it's equally likely to be alice or bob). Interesting case where the unconditional probability is actually more intuitive and easier than the conditional.

Re: Are two heads better than one?

#78
post #54
post #16

What happens if Bob lies to Alice 20% of the time and Alice lies to me 20% of the time but I only get input from Alice?

In that case following Alice's input is still the best strategy, but you'll be worse off: you'd only be right if both tell the truth, at 80% 80%=64%, or both lie, at 20% 20%=4%, for a total of 68%. In the general case of n intermediate occasional liars, the odds of the final result being accurate goes to 50% as n grows large, which makes sense, as it will have no correlation anymore to the initial input.

Thanks. I came up with this Python simulation that matches your 68%:

    import random

    def lying_flippers(num_flips=1_000_000):
        """

        - Bob flips a coin and tells Alice the result but lies 20% of the
          time.
        - Alice tells me Bob's result but also lies 20% of the time.
        - If I trust Bob, I know I'll be correct 80% of the time.
        - If I trust Alice, how often will I be correct (assuming I don't
          know Bob's result)?

        """

        # Invert flip 20% of the time.
        def maybe_flip_flip(flip: bool):
            if random.random()  {bob_percent_correct:.1%}")

        # Trusting Alice should lead to being correct ?% of the time.
        # This model produces 68%.
        print(f"Trust Alice -> {alice_percent_correct:.1%}")

        print()
Post reply on HN