Live data from Hacker News

Hello, World

m.whitehouse.gov

41–50 of 121 posts

Re: Hello, World

#41

From the first link: I find it difficult to believe that in the entirity of Jimmy Carter's Navy career, he wrote zero lines of code.

Might be close, 1953 was the year of his discharge, so he might not have written anything.

Re: Hello, World

#42

If the answer is 'at least one of them always write down "heads or tails"', then lol

I had assumed there was no real solution and figured it being a clever semantic play.

I stand corrected, very nice puzzle :)

Re: Hello, World

#43

Earlier quoted context omitted.

My experience arriving at this solution made me a bit curious as to how others solved it. Was there reasoning involved before you arrived at a strategy and verified it, or did the strategy just come to you? Did you try multiple strategies, and if so, was there a method to generating/iterating on them, or were they just coming to you and you tried them?

For me, I immediately guessed the strategy on my first guess (one same, one opposite) and somehow automagically intuited it was correct, but did not really understand why. Then I understood once I looked at the thread.

That was exactly my experience and the reason I asked the question :)

The answer just appeared with zero awareness of any effort or reasoning that may have lead to it -- the only reasoning I perceived was in verifying the solution. So I got curious as to how intuition could solve this problem roughly on its own, or with so little help from conscious reasoning that I didn't notice it.

From the replies it seems there are two key realizations that combined could lead directly to the solution, and both realizations strike me as things that intuition would be good at noticing. The first is that each player likely has deterministic rule that is dependent on their coin, so there are only two candidate strategies per player. And the second is that the players likely have different strategies.

Re: Hello, World

#45

Spoiler: Bob always chooses the same as his flip, Alice always chooses the opposite of her flip. B A H H - Bob chooses heads, Win H T - Alice chooses heads, Win T H - Alice chooses tails, Win T T - Bob chooses tails, Win

Just a comment: They'll had always a win, by sacrificing the possibility of both of them guessing right.

Re: Hello, World

#46

Earlier quoted context omitted.

slightly less verbose: https://gist.github.com/1751cebe44d88dc7db15

`zip toss toss` only produces 2 of the possible outcomes. Try `liftA2 (,) toss toss` instead.

There's always [(a, b) | a <- toss, b <- toss]. It's not as Haskell-y, but it's simpler.

Re: Hello, World

#47

Spoiler: Bob always chooses the same as his flip, Alice always chooses the opposite of her flip. B A H H - Bob chooses heads, Win H T - Alice chooses heads, Win T H - Alice chooses tails, Win T T - Bob chooses tails, Win

My experience arriving at this solution made me a bit curious as to how others solved it. Was there reasoning involved before you arrived at a strategy and verified it, or did the strategy just come to you? Did you try multiple strategies, and if so, was there a method to generating/iterating on them, or were they just coming to you and you tried them?

The only information each person has it their own coin, so their strategy is a pair of functions (f,g) from bits to bits, where either fx=y or gy=x (or both) for any bits x and y. There are only four possibilities for f, so picking, at random, f=id, gives g immediately.
Post reply on HN