UKBouldering.com

Logic Puzzles (Read 5797 times)

Stabbsy

Offline
  • ****
  • junky
  • Posts: 766
  • Karma: +52/-0
#25 Re: Logic Puzzles
August 07, 2021, 02:35:08 pm
This is a good one

Suppose you're on a game show, and you're given the choice of 3 doors: Behind one door is a car; behind the other 2, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

Yes.

Steve R

Offline
  • ****
  • forum abuser
  • Posts: 647
  • Karma: +53/-1
#26 Re: Logic Puzzles
August 07, 2021, 02:49:58 pm
Enjoying stabbsy's balls. Think I've arrived at a solution for the extension bit. Took a couple of tricky (for me at least) insights and full pen and paper job to get there. Also assumes you're allowed to number/keep track of balls between weighings? Solution is pretty long and convoluted so maybe missed an elegant simple solution?

Wil

Offline
  • ***
  • obsessive maniac
  • Posts: 338
  • Karma: +39/-0
    • Wil Treasure
#27 Re: Logic Puzzles
August 07, 2021, 02:57:37 pm
Martin Gardner's problems are always great. PDFs of his books are available online. Here's my favourite.

Sometimes they're things which have an obvious, long-winded, solution but a very elegant simple one. Some have solutions which just feel very counterintuitive.

Stabbsy

Offline
  • ****
  • junky
  • Posts: 766
  • Karma: +52/-0
#28 Re: Logic Puzzles
August 07, 2021, 03:02:08 pm
Enjoying stabbsy's balls. Think I've arrived at a solution for the extension bit. Took a couple of tricky (for me at least) insights and full pen and paper job to get there. Also assumes you're allowed to number/keep track of balls between weighings? Solution is pretty long and convoluted so maybe missed an elegant simple solution?
Don’t think there’s an elegant solution, I used pen and paper. I think you have to go through all the options and yes, you can keep track of balls between weighings.

I’m still struggling with the blue eyed islanders. I think it’s one of these proof by induction things - there a similar one with hats of different colours but the numbers are much smaller so it’s easier to envisage.

Banana finger

Offline
  • **
  • addict
  • Posts: 154
  • Karma: +11/-0
  • daft lad
#29 Re: Logic Puzzles
August 07, 2021, 03:14:59 pm
This is a good one

Suppose you're on a game show, and you're given the choice of 3 doors: Behind one door is a car; behind the other 2, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

The classic Monty Hall problem. Feels unintuitive, but a nice way of thinking about it would be to frame the problem slightly different. If you had 3 boxes, one with a prize, you make a choice, then the host takes away one of the remaining boxes (which you know does not contain the prize...this is the crucial information addition) then you are asked if you want to change your choice....

Instead, if the host joins the remaining 2 boxes together and asks you, the choice becomes obvious. Because you know the host will not throw the prize away, this is identical to joining the remaining 2 boxes together....If you think of it in this way with more and more boxes, it becomes more obvious.

remus

Offline
  • *****
  • forum hero
  • Posts: 2881
  • Karma: +146/-1
#30 Re: Logic Puzzles
August 07, 2021, 03:33:48 pm
I’m still struggling with the blue eyed islanders. I think it’s one of these proof by induction things...

Good intuition :) It might help to think about the simplest possible example and then build up from there...

Stabbsy

Offline
  • ****
  • junky
  • Posts: 766
  • Karma: +52/-0
#31 Re: Logic Puzzles
August 07, 2021, 03:54:59 pm
Instead, if the host joins the remaining 2 boxes together and asks you, the choice becomes obvious. Because you know the host will not throw the prize away, this is identical to joining the remaining 2 boxes together....If you think of it in this way with more and more boxes, it becomes more obvious.
That’s a really elegant solution! I’ve always just worked through the numbers, but even though you know it’s right it still feels unintuitive. Great way of illustrating what’s going on.

IanP

Offline
  • ****
  • forum abuser
  • Posts: 706
  • Karma: +34/-0
#32 Re: Logic Puzzles
August 07, 2021, 04:19:19 pm
Instead, if the host joins the remaining 2 boxes together and asks you, the choice becomes obvious. Because you know the host will not throw the prize away, this is identical to joining the remaining 2 boxes together....If you think of it in this way with more and more boxes, it becomes more obvious.
That’s a really elegant solution! I’ve always just worked through the numbers, but even though you know it’s right it still feels unintuitive. Great way of illustrating what’s going on.

It is weirdly unintuitive isn't it - thinking of more boxes makes it clear to me.  Imagine 100 boxes with prize in 1, you choose a box, the host opens 98 boxes without a prize, should you change your choice?Feels much more obvious you should the unspoken factor being that the host had the information that allowed him top open the boxes without the prize in. 

Stabbsy

Offline
  • ****
  • junky
  • Posts: 766
  • Karma: +52/-0
#33 Re: Logic Puzzles
August 07, 2021, 05:23:51 pm
On an otherwise deserted and isolated island, 200 perfect logicians are stranded. The islanders are perfectly logical in every decision they make, and they will not do anything unless they are absolutely certain of the outcome. However, they cannot communicate with each other. They are forbidden from speaking with one another, or signing, or writing messages in the sand, else they be shot dead by the captain of a mysterious ship that visits the island each night.

Of the 200 islanders, 100 have blue eyes, and 100 have brown eyes. However, no individual knows what color their own eyes are. There are no reflective surfaces on the island for the inhabitants to see a reflection of their own eyes. They can each see the 199 other islanders and their eye colors, but any given individual does not know if his or her own eyes are brown, blue, or perhaps another color entirely. And remember, they cannot communicate with each other in any way under penalty of death.

Each night, when the captain of the ship comes, the islanders have a chance to leave the barren and desolate spit of land they have been marooned on. If an islander tells the captain the color of his or her own eyes, they may board the ship and leave. If they get it wrong, they will be shot dead.

Now, there is one more person on the island: the guru, who the islanders know to always tell the truth. The guru has green eyes. One day, she stands up before all 200 islanders and says:

I see a person with blue eyes.

Who leaves the island? And when do they leave?

OK, so the blue-eyed islanders problem. Here's where I get to.

NSFW  :
Simplest version is there's only one person with blue eyes. The guru says her thing and the next night the blue-eyed person tells the captain they have blue eyes because they must be the person with blue eyes as they can see no other sets. So for n=1 (where n is the number of blue eyed islanders), the blue eyed islander leaves after 1 day (or n days?).

Then take the case of n=2, everyone can see 2 people with blue eyes except 2 people who can only see one pair of blue eyes. Neither of them leave after day 1 which tells the other one that someone else has blue eyes. This means there is more than 1 person with blue eyes on the island and as they can each only see 1 they both deduce on day 2 that they have blue eyes and tell the captain. So for n=2, they both leave after 2 days.

On that basis, logic suggests that all 100 blue eyed islanders leave on day 100, although it feels massively unintuitive that the guru's statement can get you all way to 100!

Banana finger

Offline
  • **
  • addict
  • Posts: 154
  • Karma: +11/-0
  • daft lad
#34 Re: Logic Puzzles
August 07, 2021, 06:33:57 pm
It's been around quite a bit so you may have seen it already, but I enjoyed the blue eyed islanders puzzle

Quote
On an otherwise deserted and isolated island, 200 perfect logicians are stranded. The islanders are perfectly logical in every decision they make, and they will not do anything unless they are absolutely certain of the outcome. However, they cannot communicate with each other. They are forbidden from speaking with one another, or signing, or writing messages in the sand, else they be shot dead by the captain of a mysterious ship that visits the island each night.

Of the 200 islanders, 100 have blue eyes, and 100 have brown eyes. However, no individual knows what color their own eyes are. There are no reflective surfaces on the island for the inhabitants to see a reflection of their own eyes. They can each see the 199 other islanders and their eye colors, but any given individual does not know if his or her own eyes are brown, blue, or perhaps another color entirely. And remember, they cannot communicate with each other in any way under penalty of death.

Each night, when the captain of the ship comes, the islanders have a chance to leave the barren and desolate spit of land they have been marooned on. If an islander tells the captain the color of his or her own eyes, they may board the ship and leave. If they get it wrong, they will be shot dead.

Now, there is one more person on the island: the guru, who the islanders know to always tell the truth. The guru has green eyes. One day, she stands up before all 200 islanders and says:

I see a person with blue eyes.

Who leaves the island? And when do they leave?


spoiler alert.....i think....



NSFW  :
All the blue eyed folk leave on the 100th night

Banana finger

Offline
  • **
  • addict
  • Posts: 154
  • Karma: +11/-0
  • daft lad
#35 Re: Logic Puzzles
August 07, 2021, 06:41:57 pm
Ok so this one is fucking 9A

Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.

remus

Offline
  • *****
  • forum hero
  • Posts: 2881
  • Karma: +146/-1
#36 Re: Logic Puzzles
August 07, 2021, 06:54:09 pm
...The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.

Oof, sting in the tail! I assume all the gods speak the same language? i.e. if A says 'ja' that means the same as if B says 'ja'.

remus

Offline
  • *****
  • forum hero
  • Posts: 2881
  • Karma: +146/-1
#37 Re: Logic Puzzles
August 07, 2021, 07:07:44 pm
Blue eyed islanders solution here https://www.popularmechanics.com/science/math/a26564/solution-to-riddle-of-the-week-27/

Spoilers
NSFW  :
Spot on Stabbsy and Banana Finger!

As well as the induction element, the other key to it is the shared knowledge of every individual on the island that there's 100 people with brown eyes and 99 with blue eyes, plus the individual who doesn't know their own eye colour. Because every islander starts with this same knowledge they all reach the same conclusion at the same time.

Steve R

Offline
  • ****
  • forum abuser
  • Posts: 647
  • Karma: +53/-1
#38 Re: Logic Puzzles
August 07, 2021, 11:55:08 pm
Enjoying stabbsy's balls. Think I've arrived at a solution for the extension bit. Took a couple of tricky (for me at least) insights and full pen and paper job to get there. Also assumes you're allowed to number/keep track of balls between weighings? Solution is pretty long and convoluted so maybe missed an elegant simple solution?
Don’t think there’s an elegant solution, I used pen and paper. I think you have to go through all the options and yes, you can keep track of balls between weighings.

Ah fair enough, here's a solution if anyone's interested:
NSFW  :
weigh any 4 balls against any other 4 balls
if they balance, let's call it scenario A, if they don't balance scenario B

scenario A first.. 

number remaining unweighed 4 balls 9,10,11,12
weigh 9,10 vs 11,1 (or any other ball just not 12)
-if they balance then weigh 12 vs any other ball and 12 is heavy or light as indicated
-if they don't balance then either (i) 9 or 10 is heavy or 11 light (ii) 9 or 10 is light or 11 heavy depending on which way scales tipped. weigh 9 vs 10 and you know which is the anomaly and whether it's heavy or light

scenario B is a bit harder...
number the heavier side 4 balls 1,2,3,4 and the lighter side 5,6,7,8
weigh 3,5,7 vs 4,6,8 (*hardest step of the puzzle for me was finding this weighing combo)
-if they balance, 1 or 2 is heavy. weigh 1 vs 3 (or any other ball just not 2). if this balances then 2 is heavy, if not then 1 is heavy.
-if they don't balance then either (i) scales tipped in same direction as initial weigh so 3 heavy or 6 or 8 light OR (ii) scales tipped oppositie direction to initial weigh so 5 or 7 light or 4 heavy
for sub-scenario B(i), weigh 6 vs 8.  if balance 3 is heavy. if don't balance 6 or 8 is light (scale will show which)
similarly for sub-scenario B(ii), weigh 5 vs 7.  If balance 4 is heavy.  if don't balance 5 or 7 is light (scale will show which)

phew, probably about as hard to follow that than to just figure it out...

thanks though, thought it was a good puzzle and a nice blend of top down insights and bottom up trial and error to see what works.

If the gods one is 9a, then maybe this might be a good 7c+ warm up:

Three very logical friends, Amy, Bob and Carol, sat in a circle wearing hats. Each hat had a number on it so all three could see the others' numbers but not their own. They were told that the numbers were three different positive single digits.

They each made a statement in turn and were told to raise their hands when they knew their own number. Amy said: "Carol's number is greater than Bob's." No one raised their hand.

Bob then said: "The sum of Amy's and Carol's numbers is even." On hearing this, Carol raised her hand. Even then, Amy and Bob did not raise theirs. But after a pause, and once it had become clear that Amy wasn't going to raise her hand, Bob raised his and then Amy raised hers.

What were Amy's, Bob's and Carol's numbers?

Stabbsy

Offline
  • ****
  • junky
  • Posts: 766
  • Karma: +52/-0
#39 Re: Logic Puzzles
August 08, 2021, 11:41:29 am
Three very logical friends, Amy, Bob and Carol, sat in a circle wearing hats. Each hat had a number on it so all three could see the others' numbers but not their own. They were told that the numbers were three different positive single digits.

They each made a statement in turn and were told to raise their hands when they knew their own number. Amy said: "Carol's number is greater than Bob's." No one raised their hand.

Bob then said: "The sum of Amy's and Carol's numbers is even." On hearing this, Carol raised her hand. Even then, Amy and Bob did not raise theirs. But after a pause, and once it had become clear that Amy wasn't going to raise her hand, Bob raised his and then Amy raised hers.

What were Amy's, Bob's and Carol's numbers?
NSFW  :
Amy 6, Bob 4, Carol 8?

Banana finger

Offline
  • **
  • addict
  • Posts: 154
  • Karma: +11/-0
  • daft lad
#40 Re: Logic Puzzles
August 08, 2021, 05:28:09 pm
This one is fun:

3 logicians walk into a bar. The barman says 'would you all like a drink'?
The first logician says 'i don't know'
The second logician says 'i don't know'
The third logician says 'yes we would all like a drink'

More of a joke than a puzzle!

Steve R

Offline
  • ****
  • forum abuser
  • Posts: 647
  • Karma: +53/-1
#41 Re: Logic Puzzles
August 09, 2021, 10:18:43 am
Three very logical friends, Amy, Bob and Carol...
NSFW  :
Amy 6, Bob 4, Carol 8?
Close but one number is wrong

AndyP

Offline
  • *
  • newbie
  • Posts: 21
  • Karma: +5/-0
#42 Re: Logic Puzzles
August 09, 2021, 11:49:44 am
Ok so this one is fucking 9A

Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.

Here is an answer (not my own, but posting because once you see it the puzzle is significantly downgraded):

NSFW  :
Let E be a function that takes you from a question q to the question [If I asked you 'q' in your current mental state would you say 'ja'?]

If you ask any god E(q), a response of 'ja' indicates that the answer to q is affirmative. If they give a response of 'da' this indicates that the answer to q is negative.

Given this, the puzzle becomes incredibly simple. You just ask the first god E(are you random)? If they answer 'ja then you know they are random, if they answer 'da' then you know they are not random. If you know the first is random you then ask the second god E(are you true?). If you get a 'ja' you know the second is true, and therefore the final one is false. If you get a 'da' you know the second is false, and the final one is true. If the first god answers 'da' to the first question you know they are not random. So, you ask if they are true. If 'ja' then they are true, if 'da' they are false. You can then just proceed as before and do the others by process of elimination. Ask second if they are random. If 'ja' then they are random and final one is whatever is left. If 'da' then the final one is random, and middle one is whatever is left.

Here is why a response of 'ja' to E(q) always entails an affirmative answer:

Suppose the question is 'are you random?', now consider the possible responses we get from each god when asked E(q):

God = True:
Ja = yes.
The answer to q is 'da' (no), so true will answer q with 'da' (no). So true will answer E(q) 'da' (no).
Ja = no.
The answer to q is 'ja', so true will answer q with 'ja' (no). So, true will answer E(q) 'da' (yes)

God = False:
Ja = yes.
The answer to q is 'da' (no), so false will answer q with 'ja' (yes). So, false will answer E(q) with 'da' (no).
Da = yes.
The answer to q is 'ja' (no), so false will answer q with 'da' (yes). So, false will answer E(q) with 'da' (yes).

God = Random.
Random is telling the truth (T(random))
Ja = yes
The answer to q is 'ja' (yes), so T(random) will answer q with 'ja' (yes). So, T(random) will answer E(q) with 'ja' (yes).
Ja = no
The answer to q is 'da' (yes), so, T(random) will answer q with 'da' (yes). So, T(random) will answer E(q) with 'ja' (no).

Random is lying (F(random))
Ja = yes
The answer to q is 'ja' (yes), so F(random) will answer q with 'da' (no). So, F(random) will answer E(q) with 'ja' (yes).
Ja = no
The answer to q is 'da' (yes), so F(random) will answer q with 'ja' (no). So, F(random) will answer E(q) with 'ja' (no).



Stabbsy

Offline
  • ****
  • junky
  • Posts: 766
  • Karma: +52/-0
#43 Re: Logic Puzzles
August 09, 2021, 05:39:07 pm
Quote
Close but one number is wrong
Of course! :slap:
Amy would have to speak first for mine to be right.

Steve R

Offline
  • ****
  • forum abuser
  • Posts: 647
  • Karma: +53/-1
#44 Re: Logic Puzzles
August 17, 2021, 04:10:26 pm
Ok so this one is fucking 9A

Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.

Here is an answer (not my own, but posting because once you see it the puzzle is significantly downgraded):

NSFW  :
Let E be a function that takes you from a question q to the question [If I asked you 'q' in your current mental state would you say 'ja'?]

If you ask any god E(q), a response of 'ja' indicates that the answer to q is affirmative. If they give a response of 'da' this indicates that the answer to q is negative.

Given this, the puzzle becomes incredibly simple. You just ask the first god E(are you random)? If they answer 'ja then you know they are random, if they answer 'da' then you know they are not random. If you know the first is random you then ask the second god E(are you true?). If you get a 'ja' you know the second is true, and therefore the final one is false. If you get a 'da' you know the second is false, and the final one is true. If the first god answers 'da' to the first question you know they are not random. So, you ask if they are true. If 'ja' then they are true, if 'da' they are false. You can then just proceed as before and do the others by process of elimination. Ask second if they are random. If 'ja' then they are random and final one is whatever is left. If 'da' then the final one is random, and middle one is whatever is left.

Here is why a response of 'ja' to E(q) always entails an affirmative answer:

Suppose the question is 'are you random?', now consider the possible responses we get from each god when asked E(q):

God = True:
Ja = yes.
The answer to q is 'da' (no), so true will answer q with 'da' (no). So true will answer E(q) 'da' (no).
Ja = no.
The answer to q is 'ja', so true will answer q with 'ja' (no). So, true will answer E(q) 'da' (yes)

God = False:
Ja = yes.
The answer to q is 'da' (no), so false will answer q with 'ja' (yes). So, false will answer E(q) with 'da' (no).
Da = yes.
The answer to q is 'ja' (no), so false will answer q with 'da' (yes). So, false will answer E(q) with 'da' (yes).

God = Random.
Random is telling the truth (T(random))
Ja = yes
The answer to q is 'ja' (yes), so T(random) will answer q with 'ja' (yes). So, T(random) will answer E(q) with 'ja' (yes).
Ja = no
The answer to q is 'da' (yes), so, T(random) will answer q with 'da' (yes). So, T(random) will answer E(q) with 'ja' (no).

Random is lying (F(random))
Ja = yes
The answer to q is 'ja' (yes), so F(random) will answer q with 'da' (no). So, F(random) will answer E(q) with 'ja' (yes).
Ja = no
The answer to q is 'da' (yes), so F(random) will answer q with 'ja' (no). So, F(random) will answer E(q) with 'ja' (no).


Will have to spend more time trying to understand that solution but having finally had a bit of time with nothing better to do then sit and gurn a lot over this puzzle, I think I arrived at a solution with the same (probably, maybe, I think) underlying logic:

NSFW  :
Hardest stage for me was designing an initial question so that sufficient permutations cancelled/duplicated nicely in the later stages.  The question I arrived at that seems to work:

Ask God A - "would another God here who's not random (and not you) say 'da' if I asked him 'is B random?' "
This gives you 2 sets of 4 permutations for 'da' = yes and 2 similar sets of 4 permutations for 'da'  = no

If answer to first question is 'da'' you ask God B, 'does previous answer mean yes?'

If answer to first question is 'ja' you ask God C, 'does previous answer mean yes?'

This gives some useful duplication/collapse of permutations so that if answers so far are:
'da' + 'da' ; B=true
'da' + 'ja' ; B=false
'ja' + 'ja' ; C=true
'ja' + 'da' ; C = false

from here, 3rd question is trivial to determine identities of remaining 2 gods.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal