Live data from Hacker News

Hello, World

m.whitehouse.gov

91–100 of 121 posts

Re: Hello, World

#91

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.

Jimmy Carter aside, what kind of code do navy people write?

During Carter's era or today. In 90 I was trained for a year in computer engineering for our sonar computer mainframe including Assembly. The idea was that if we were on deployment and a bug caused a problem we could potentially figure it out and maybe fix it without stopping the mission. I was programming on my own for 8 years prior to that as a hobby so was actually correcting the instructor on a couple of occasions. There is also the rate DT which does programming all the time I think. I wanted to get into that rate but the wait was a year and I was impatient.

Re: Hello, World

#93

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?

Brainteasers tend to follow a particular pattern. The amount of information the various Alices and Bobs and Charlies have seems at first glance to obviously be inadequate to the task they're given. Then a closer examination reveals that there's some sublte extra scrap of information, and you can generally assume than that the answer is to use that to trace out the possibilities to find the actual answer. So knowing t…

One of the main challenges, however, seems like it would rear its head as soon as you leave the confines of a defined brain teaser, where you know for sure that there is a "trick" even if you can't see it, and real world situations such as in programming, where you don't yet know if the specific problem is solvable at all.

Re: Hello, World

#94
I solved (believe) the puzzle in 3 minutes.

A says B result is the same as A result. B says A result is different from B result,

so that A covers (H,H) and (T,T), B covers (H,T) and (T, H), so always A or B is true, so they always win.

Re: Hello, World

#95
I haven't looked at any of the solutions. Or any of the other comments.So at the risk of posting a redundant comment :

Alice guesses that Bob's coin is the same as hers. Bob guesses that Alice's coin is the opposite to hers.

It's fairly straightforward. I'd like to know the computer science angle to this though.

EDIT: From the computer science that I know :

We need to find an invariant that all permutations of coin flips always satisify. Intuition tells us that Alice's coin might be the same as Bob or vice versa :

If you construct a truth table :

  Alice  Bob     Alice's Coin same as bob    Bob's opposite to Alice

  H      H               YES                            NO

  T      T               YES                            NO

  H      T               NO                             YES

  T      H               NO                             YES
The expression :

  Alice's coin same as Bob || Bob's opposite to Alice
Always evaluates to true. So Alice can guess her flip and Bob can guess the opposite.

But what if we had Alice , Bob and George and atleast one of them had to get the other two right ?

Is there a general pattern ?

  Alice Bob George
  H     H   H
  H     H   T
  H     T   H
  H     T   T
  T     H   H
  T     H   T
  T     T   H
  T     T   T
Will try and figure it out over dinner :D .

Re: Hello, World

#96

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?

Honestly the situation was a little confusing because I like to think about a thought experiment which is similar (a coordinated three-person game called "Betrayal" which exemplifies the weirdness of quantum mechanics) and due to this I imagined that the "win criterion" was "Alice and Bob both have to get each other's answer right."

When I re-read the description and said "oh, they only have to have one correct answer between them," it was just like, "how can I make sure that when Alice is wrong then Bob is right?". The solution followed about a second later, "well if Alice guesses the same as her flip, maybe Bob guesses the opposite of his", without any logic tables or further reasoning or anything. Then I drew up the 4 possible coin flips and the resulting predictions and wins, to prove that it was correct, just in case I was somehow missing something.

Re: Hello, World

#97

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?

This puzzle you can get without being "clever" by just following the logic:

Suppose Alice got Heads. Say she guesses Heads. Then when Bob gets Heads they win. When Bob gets Tails Alice is wrong so Bob needs to guess Heads when he gets Tails.

Flip the scenario around when Alice gets Tails and you get the whole strategy

Re: Hello, World

#98
I think I was slow coming up with this, but basically I wrote a lot of tables out and came up with...SPOILER...

Alice always guessing the same as what she flips and Bob always guessing different.

But - my question is this: Are there any other possible solutions to this puzzle?

Either way, I'm pretty sure this is just an Illuminati code plot from the White House to find the world's top coders and recruit them into some CIA program.

Re: Hello, World

#99

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?

So what I did was wrote out all 16 possible outcomes in an excel spreadsheet. I used T and F for tails and heads, because I'm used to reasoning in true or false. http://i.imgur.com/jKYSo3P.png. Then I noticed the two edge cases of: TTTT, and FFFF and came to the conclusion that is was not possible for them to agree on the same guess beforehand (i.e. Both guess tails or both guess heads). So then, by trial and error, I checked what would happen if one chose the same as their flip, and the other chose different from their flip. I bolded the case where it was valid to my rules, and deleted an invalid case http://i.imgur.com/E3jnIkd.png, and saw that it worked.

Re: Hello, World

#100
post #75
post #69

Earlier quoted context omitted.

An actual fun problem: 100 prisoners are each assigned a black or white hat, at random. As always, they cannot communicate after the hats are assigned. Then they are shown each other. None sees own hat, everyone sees everyone elses hat. Then they are led into separate rooms and each guesses their own hat color. They win only if everybody guesses correctly. What strategy maximizes the probability of that event?

Gurl pna trg svsgl creprag ol rirelbar thrffvat fhpu gung gur ahzore bs oynpx ungf vf rira (be bqq). I wouldn't be surprised if this is optimal, but I also wouldn't be surprised if it's not.

Yikes. Rot13?? I haven't seen this since the days of UseNet, circa 1995! :-D
Post reply on HN