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?
Hello, World
91–100 of 121 posts
Re: Hello, World
#92From 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?
Re: Hello, World
#93Earlier 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…
Re: Hello, World
#94A 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
#95Alice 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
#96Spoiler: 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?
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
#97Spoiler: 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?
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
#98Alice 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
#99Spoiler: 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?
Re: Hello, World
#100Earlier 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.