Logic Puzzles

Page 1 of 5 1, 2, 3, 4, 5  Next

View previous topic View next topic Go down

Logic Puzzles

Post  Sam on Thu 28 May 2015, 19:23

If, like me, you sometimes wonder if your brain doesn't get enough exercise every day, this might be a fun way to compensate. This site has got a bunch of good puzzles, both lateral and logical:

http://www.folj.com/

I'm working my way through the easy ones on my own, but let's see if we can can tackle a difficult one together:

http://www.folj.com/puzzles/difficult-logic-problems.htm

folj.com wrote:1. The Emperor

You are the ruler of a medieval empire and you are about to have a celebration tomorrow. The celebration is the most important party you have ever hosted. You've got 1000 bottles of wine you were planning to open for the celebration, but you find out that one of them is poisoned.

The poison exhibits no symptoms until death. Death occurs within ten to twenty hours after consuming even the minutest amount of poison.

You have over a thousand slaves at your disposal and just under 24 hours to determine which single bottle is poisoned.

You have a handful of prisoners about to be executed, and it would mar your celebration to have anyone else killed.

What is the smallest number of prisoners you must have to drink from the bottles to be absolutely sure to find the poisoned bottle within 24 hours?

I don't know the answer, though once I've had a think about it I'll post my thoughts, and anyone who is confident they have it solved can check the answer and give us hints when they know. I would put attempted answers in spoiler tags.
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Mattel on Thu 28 May 2015, 19:56


Is this like the balls question?

1000 bottles goes to 2 x 500 one prisoner drinks from all of 500 one from the other batch.

Keep halving the numbers and drinking by prisoners? No, that doesn't really give you a 'handful' of dead prisoners.

It'd certainly ID the poisoned bottle but given the time constraints it seems like you'd half to have someone drink each "half" of the total number of bottles in order to know in 10-20 hours if they were dead (and thus ID the bad 'half' of bottles) so you couldn't try half and wait for the results.

I think.


Mattel
Red Meeple
Red Meeple

Posts : 104
Join date : 2015-03-16
Location : Crookes

View user profile

Back to top Go down

Re: Logic Puzzles

Post  Sam on Thu 28 May 2015, 20:16

As with Blue Eyes It sounds like there is not enough information, but in Jamie's puzzle once you hit it at the right angle (what if there was only one blue eyed person?) the puzzle starts to give. They are called logical puzzles but a jump of lateral thinking is certainly required to see the "trick", I think. I can see that we only have time for one round of drinks, and that we can't give potentially poisonous drinks to the slaves but I perhaps we are supposed to use them in some way. Right now I just think that the Emperor could stand to realise that maybe he could do with one less slave.
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 20:30

Must be 1000?

There is only time for one test. If you give some wine to one or more slaves; you have to wait 20 hours (assuming worse case) to see the effects. If nobody dies, there isn't enough time to do another test, as you have less than 24 hours to discover the poison.

I have a feeling I'm missing something though; or didn't correctly understand the problem?

Or maybe 999?
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 20:35

If there was no time element, I would say 9 slaves.

Slave 1: drinks from 512 bottles (just a drop each).
Slave 2: drinks from 256 bottles (half of the set that slave 1 drank from, if slave 1 is dead; else, 256 untested bottles).
Slave 3: drinks from 128...
Slave 4: drinks from 64...
Slave 5: drinks from 32...
Slave 6: drinks from 16...
Slave 7: drinks from 8...
Slave 8: drinks from 4...
Slave 9: drinks from 2...

That can't work though, as there isn't enough time to wait around and see if a slave dies, before choosing which bottles to test next.
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 20:38

Ah, I think I get it now...
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Sam on Thu 28 May 2015, 20:39

My solution:
I think I'm on the right track. My idea is that all prisoners will drink different bottles, and which prisoners die will determine which bottle was the culprit ie. several prisoners will die, and the ones that die will reveal which bottle, being a code of sorts. So my first idea is that you number the prisoners 0 to 9 and the bottles 1 to 1000. Bottle 1 is drank by prisoner 1, two by 2, bottle 12 by 1 and 2. The problem is that the same prisoners die for bottle 39 and bottle 93 (and for many other numbers, of course!), and you can't do numbers with multiples of the same digit. But I think you could do it in binary...? If so you could do it with 10 prisoners (999 is 1111100111 in binary). I'm so tempted to look but I'm worried I'm way off and I'll spoil the puzzle for myself! Does the above make sense to you guys?


Last edited by Sam on Thu 28 May 2015, 20:49; edited 1 time in total
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Sam on Thu 28 May 2015, 20:49

Fucking aced it. Jamie's puzzles must have made me more intelligent. I thought more about Blue Eyes than I did about work today. I'll give hints to others still thinking about it if requested.

There's a follow up:

folj.com:
Bonus points if you worked out a way to ensure than no more than 8 prisoners die.
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Sam on Thu 28 May 2015, 21:13

Did has anyone played the old Infocom text games? Zork, The Hitchhiker's Guide to the Galaxy, A Mind Forever Voyaging etc.? I went through a text adventure phase for awhile where I played a good ten or so of these antiquated classics. They have the interactivity of a videogame but that slightly unique type of immersion that a book does also. There was something of a sense of "anything could happen", because the limitations and predictability of the computers dictionary was far less than that of a controller in traditional games that puts a limit on your range of actions. Some of them had very cool stories and written atmosphere, too.





Of course they are stuffed with cool puzzles, lateral and logical. They had a clever system for giving hints, where you could buy a book of "Invisi-clues" and I think you would scratch off clues related to the part of the game you were in, ordered by level of spoilerness, so you could start by scratching off little hints and if you were really stumped you could go for the last one and reveal the solution.

Anyway, that's what this has reminded me of. Definitely worth trying out. I would recommend starting with Planetfall or A Mind Forever Voyaging if you want to give them a go.
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 21:16

Solution:
It's 10. I can only explain in programmer mode...

Each bottle should be numbered 0 to 999.

10 slaves represent bit 0 to 9 (as a programmer, we routinely think in binary and hexadecimal etc).

So...

Slave 1 represent binary 000000001 (1)
Slave 2 represent binary 000000010 (2)
Slave 3 represent binary 000000100 (4)
Slave 4 represent binary 000001000 (Cool
Slave 5 represent binary 000010000 (16)
Slave 6 represent binary 000100000 (32)
Slave 7 represent binary 001000000 (64)
Slave 8 represent binary 010000000 (128)
Slave 9 represent binary 100000000 (256)
Slave 10 represent binary 100000000 (512)

Each slave only drinks the bottles where the bit he represents is set.
Slave 1 drinks bottles 1,3,5,7...
Slave 2 drinks bottles 2,3,6,7,10,11,14,15,...
Slave 3 drinks bottles 4,5,6,7,12,13,14,15,...
Slave 10 drinks bottles 512,513,513,up to 999 (as we number the bottles 0 to 999)

Depending on which slaves die (or no slaves, if the bad bottle is number 0). We can tell exactly which bottle is the bad one.
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 21:22

Sam wrote:Fucking aced it. Jamie's puzzles must have made me more intelligent. I thought more about Blue Eyes than I did about work today. I'll give hints to others still thinking about it if requested.

There's a follow up:

folj.com:
Bonus points if you worked out a way to ensure than no more than 8 prisoners die.

That's an interesting one; but possible...

SOLUTION:
Because there are less than 1024 bottles; you can, instead of correlating directly between bottle number, and bits for each slave; use (what programmers call) a look up table! So the bottle number is first looked up in a table to give another number. These final numbers (will be roughly in the same range of 0 to 1023), but will omit any number that has more than 8 bits set for it.
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Sam on Thu 28 May 2015, 21:23

*high five*

For the follow up

Spoiler:
Any number that uses more 8 or more "1"s ie. sips, can be changed to another number that does not, correct? I realized you should not be using those numbers, and there weren't many of them, though it didn't occur to me we had some spares kicking about between 1000 and 1024.
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 21:46

Not checked for mistakes; but here's the numbers that need remapping...

Numbers 0 to 999 with 9 bits or more set. I've presented them <binary> = <hexadecimal> [<decimal>]

01 1111 1111 = 0x1ff [511]
10 1111 1111 = 0x2ff [767]
11 0111 1111 = 0x37f [895]
11 1011 1111 = 0x3bf [959]
11 1101 1111 = 0x3df [971]
[we do not need to remap the following as they're out of range; i.e. 1000+ in decimal]
11 1110 1111 = 0x3ef
11 1111 0111 = 0x3f7
11 1111 1011 = 0x3fb
11 1111 1101 = 0x3fd
11 1111 1110 = 0x3fe

There are 5 numbers we need to remap (using the look up table) to the numbers below...

These following numbers are binary for 1000 to 1023. I've marked the one's unsuitable for our requirements (have 8 bits or less) with an 'x'. There are 18 suitable numbers (probably we could squeeze in a few more bottles; but don't ask me how many!!)...

11 1110 1000 = 1000 [6]
11 1110 1001 = 1001 [7]
11 1110 1010 = 1002 [7]
11 1110 1011 = 1003 [8]

11 1110 1100 = 1004 [7]
11 1110 1101 = 1005 [8]
11 1110 1110 = 1006 [8]
11 1110 1111 = 1007 [9] x

11 1111 0000 = 1008 [6]
11 1111 0001 = 1009 [7]
11 1111 0010 = 1010 [7]
11 1111 0011 = 1011 [8]

11 1111 0100 = 1012 [7]
11 1111 0101 = 1013 [8]
11 1111 0110 = 1014 [8]
11 1111 0111 = 1015 [9] x

11 1111 1000 = 1016 [7]
11 1111 1001 = 1017 [8]
11 1111 1010 = 1018 [8]
11 1111 1011 = 1019 [9] x

11 1111 1100 = 1020 [8]
11 1111 1101 = 1021 [9] x
11 1111 1110 = 1022 [9] x
11 1111 1111 = 1023 [10] x
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 21:51

Okay, I'd say we could add another 6 bottles in to the mix...
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Sam on Thu 28 May 2015, 22:17

Here's another one.

100 Gold Coins

Five pirates have obtained 100 gold coins and have to divide up the loot. The pirates are all extremely intelligent, treacherous and selfish (especially the captain).

The captain always proposes a distribution of the loot. All pirates vote on the proposal, and if half the crew or more go "Aye", the loot is divided as proposed, as no pirate would be willing to take on the captain without superior force on their side.

If the captain fails to obtain support of at least half his crew (which includes himself), he faces a mutiny, and all pirates will turn against him and make him walk the plank. The pirates start over again with the next senior pirate as captain.

What is the maximum number of coins the captain can keep without risking his life?


I seen the answer to this and though it's a good one I think the way the puzzle is written is not very helpful, so I'd be interested to know if anyone can figure it out based on the text above alone. I would offer the below hints/clarifications:

Spoiler:
I would add to the description that the pirates are "coldly logical" ie. as in many puzzles, the characters are logical agents and will act as robots.

Pay special attention to what happens if there is a mutiny. The pirates will have to think about where they stand in that event, also. This may make it easier to understand why a pirate would vote nay or yea.
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 22:37

94?
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 22:42

Sorry, 98? (keep changing my mind)

Working in reverse...

If there are 2 pirates left; the captain will propose a 100/0 split, which will be approved, because the captain will vote yes (as tie means the gold is shared out).

If there are 3 pirates left; the captain will propose a 99/0/1 split, which will be approved by the captain and the last pirate (who will get 1 more than if he makes the captain walk the plank, leaving 2 pirates, see above).

With 4 pirates left; the split would be 98/0/0/2, getting approval by the captain and the last pirate.

With 5 pirates left; the split would be 98/1/1/0/0.
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 22:47

No, scrap that; all wrong. Pirate 2 would not accept the first proposal. This is more complex that it seems...
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  BeardyTom on Thu 28 May 2015, 22:52

Jamie wrote:Sorry, 98? (keep changing my mind)

Working in reverse...

If there are 2 pirates left; the captain will propose a 100/0 split, which will be approved, because the captain will vote yes (as tie means the gold is shared out).

If there are 3 pirates left; the captain will propose a 99/0/1 split, which will be approved by the captain and the last pirate (who will get 1 more than if he makes the captain walk the plank, leaving 2 pirates, see above).

With 4 pirates left; the split would be 98/0/0/2, getting approval by the captain and the last pirate.

With 5 pirates left; the split would be 98/1/1/0/0.

I make it:
If there are 2 pirates left; the captain will propose a 100/0 split, which will be approved, because the captain will vote yes (as tie means the gold is shared out).

If there are 3 pirates left; the captain will propose a 99/0/1 split, which will be approved by the captain and the last pirate (who will get 1 more than if he makes the captain walk the plank, leaving 2 pirates, see above).

With 4 pirates left; the split would be 99/0/1/0, getting approval by the captain and the second to last pirate.

With 5 pirates left; the split would be 98/0/1/0/1
avatar
BeardyTom
Yellow Warsun
Yellow Warsun

Posts : 444
Join date : 2014-09-02
Age : 41
Location : Nether Edge/Highfield

View user profile

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Thu 28 May 2015, 22:59

Would the last pirate accept 1 gold on the first proposal, when he knows he'll be offered 1 gold on the third proposal? I wouldn't; and I'd use that fact to force an offer of 2 gold for me on the first proposal ... or the captain is walking that plank!

Oh dear, no no no. That's wrong too. If the last pirate does not accept the first proposal; it won't get to the third proposal, because the second proposal would be accepted.

No, you're right Tom. Well done!
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  BeardyTom on Thu 28 May 2015, 23:48

I think the same pattern holds for any gold g dividing among up to 2g pirates. E.g for 10 pirates sgaring out 100 goldthe captain would propose 96 0 1 0 1 0 1 0 1 0. If you've got more than twice as many pirates as you've got gold then it gets a bit weirder. E.g. for 6 pirates dividing 2 gold, I think the captain should propose 0 0 0 1 0 1, because getting no gold is better than being thrown overboard. If you're the captain trying to divide 2 gold among 7 then I think you're screwed, and once you're thrown overboard it's back to 2 among 6. But then for 8 pirates, the second one will not want to get down to 7 so a 00000101 proposal will pass. My head is fuzzy now. Time for sleep.
avatar
BeardyTom
Yellow Warsun
Yellow Warsun

Posts : 444
Join date : 2014-09-02
Age : 41
Location : Nether Edge/Highfield

View user profile

Back to top Go down

Re: Logic Puzzles

Post  Sam on Fri 29 May 2015, 10:21

Tom wrote:for 6 pirates dividing 2 gold, I think the captain should propose 0 0 0 1 0 1, because getting no gold is better than being thrown overboard.

Laughing Well noticed

The Pirates one was a rated difficult, and you made short work of it, so let's stick to "Very Difficult".

The Stark Raving Mad King

A stark raving mad king tells his 100 wisest men he is about to line them up and that he will place either a red or blue hat on each of their heads. Once lined up, they must not communicate amongst themselves. Nor may they attempt to look behind them or remove their own hat.

The king tells the wise men that they will be able to see all the hats in front of them. They will not be able to see the color of their own hat or the hats behind them, although they will be able to hear the answers from all those behind them.

The king will then start with the wise man in the back and ask "what color is your hat?" The wise man will only be allowed to answer "red" or "blue," nothing more. If the answer is incorrect then the wise man will be silently killed. If the answer is correct then the wise man may live but must remain absolutely silent.

The king will then move on to the next wise man and repeat the question.

The king makes it clear that if anyone breaks the rules then all the wise men will die, then allows the wise men to consult before lining them up. The king listens in while the wise men consult each other to make sure they don't devise a plan to cheat. To communicate anything more than their guess of red or blue by coughing or shuffling would be breaking the rules.

What is the maximum number of men they can be guaranteed to save?
avatar
Sam
Dominant Species
Dominant Species

Posts : 970
Join date : 2013-07-17

View user profile http://sam-outlands.blogspot.co.uk/

Back to top Go down

Re: Logic Puzzles

Post  Jamie on Fri 29 May 2015, 10:54

Already took a peek at the answer to that one Sam. I would say, it's harder that the other very hard one we did with the 1000 bottles of wine.

Right, better get some work done! Unless we rename this thread "why bother working, lets just do logic puzzles all day". Wink
avatar
Jamie
Count of Carcassonne

Posts : 1163
Join date : 2014-08-03
Location : Camelot (nr Intake)

View user profile http://www.mrqwak.com

Back to top Go down

Re: Logic Puzzles

Post  BeardyTom on Fri 29 May 2015, 12:16

Sam wrote:
Tom wrote:for 6 pirates dividing 2 gold, I think the captain should propose 0 0 0 1 0 1, because getting no gold is better than being thrown overboard.

Laughing Well noticed

The Pirates one was a rated difficult, and you made short work of it, so let's stick to "Very Difficult".

The Stark Raving Mad King

A stark raving mad king tells his 100 wisest men he is about to line them up and that he will place either a red or blue hat on each of their heads. Once lined up, they must not communicate amongst themselves. Nor may they attempt to look behind them or remove their own hat.

The king tells the wise men that they will be able to see all the hats in front of them. They will not be able to see the color of their own hat or the hats behind them, although they will be able to hear the answers from all those behind them.

The king will then start with the wise man in the back and ask "what color is your hat?" The wise man will only be allowed to answer "red" or "blue," nothing more. If the answer is incorrect then the wise man will be silently killed. If the answer is correct then the wise man may live but must remain absolutely silent.

The king will then move on to the next wise man and repeat the question.

The king makes it clear that if anyone breaks the rules then all the wise men will die, then allows the wise men to consult before lining them up. The king listens in while the wise men consult each other to make sure they don't devise a plan to cheat. To communicate anything more than their guess of red or blue by coughing or shuffling would be breaking the rules.

What is the maximum number of men they can be guaranteed to save?

Gaah! It's easy enough to guarantee saving half of them but there's something I'm missing.
avatar
BeardyTom
Yellow Warsun
Yellow Warsun

Posts : 444
Join date : 2014-09-02
Age : 41
Location : Nether Edge/Highfield

View user profile

Back to top Go down

Re: Logic Puzzles

Post  Mattel on Fri 29 May 2015, 12:19


Is there an assumption it's a 50-50 split of hats like in the eye problem?

Mattel
Red Meeple
Red Meeple

Posts : 104
Join date : 2015-03-16
Location : Crookes

View user profile

Back to top Go down

Re: Logic Puzzles

Post  Sponsored content


Sponsored content


Back to top Go down

Page 1 of 5 1, 2, 3, 4, 5  Next

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum