I've always been a big fan of puzzle magazines. Dell/Penny Press/Games, you name it. I'd take them to school and do them in class because I'd get all the homework done in the time we had to work on it in class and then would otherwise sit around bored. Anyway, the magazine 'Math Puzzles & Logic Problems' was my favourite one, and of the puzzles that would show up in those Paint by Numbers was my favourite. It's also known as Picross I believe. You get a grid with a bunch of numbers on the top and left and need to use the process of elimination to work out what squares of the grid needed to be shaded in to make a picture. (It's the closest I'd ever get to 'art'.)
Anyway, the other day I started seeing Facebook spam for a game that looked like it might contain Paint by Numbers grids. I haven't given a Facebook game a try since the debacle that was Plants vs Zombies Adventures and I figured I'd give it a spin to see what was up. I've had a lot of fun with some Facebook games, after all, and I do like me some Paint by Numbers...
The game is called Riddle Stones and it is a bit of a debacle. I set it up to only post updates to myself, not to my friends, and went off to play it. I played through something like 12 levels in the first day, so probably 30 puzzles or so. It had posted 50 things to my feed. FIFTY! And that's all the junk it posts without asking me about it. It also prompted me at least once per puzzle, often more, to make posts on my own to my feed. Presumably those posts would be seen by my friends because it would be me posting them, not the app on its own. Every time I got a faster time than anyone who had played the game it wanted me to brag about it. Every 3 puzzles it wanted to brag about that too.
The UI was either very badly designed or deliberately terrible to be confusing. After having Who Wants To Be A Millionaire steal 5 cents by tricking me into clicking a button that changed meaning I'm leaning towards the latter. I'm actually not sure how alternating if I wanted to click green or orange or nothing was confusing me into paying them money but I'm sure it would have happened at some point. It kept asking me to make it full screen before every single puzzle. Why? Once, sure. That might be helpful? After I decline to do it? Leave me alone!
The game itself was pretty boring when it came right down to it. I'm used to doing 25x25 or bigger puzzles; these ones were all either 5x5 or 10x10 with most of the grid filled in for me in advance. You can't make a puzzle with all that much thought in a 5x5 grid, nor can you make a puzzle that looks really cool. The game seemed to be designed around doing things fast, not smart. You could click in the wrong spot several times before you'd 'die' so there wasn't much sense in using logic. I can spend a couple seconds to work out the right answer or I can just click a couple extra times and brute force it. Blah.
But what it did do was prompt me to go looking for some real Paint by Number puzzles. I found a cool site that looks to have a ton of puzzles of all shapes and sizes, including some with extra colours. I like it! Interesting, challenging, free, not annoying to me, and not annoying to my Facebook friends. Wins for everybody!
Showing posts with label puzzles. Show all posts
Showing posts with label puzzles. Show all posts
Thursday, May 22, 2014
Tuesday, May 06, 2014
ESC-IT
ESC-IT is a 'room escape' entertainment place a little north of Toronto. The basic idea is they lock you in a room and you need to figure out a way to get out in 45 minutes or less. The key to getting out is in the room somewhere and you need to solve puzzles and do things in order to escape. It's meant to be done in 45 minutes or less so the puzzles aren't super complicated things and they're not crosswords or anything like on a puzzle boat.
My mother and sister are in town this week and we decided to go give it a shot. An evil winemaker locked us in his cellar and was going to turn us into WINE if we didn't escape. 35 minutes later we'd unlocked the final box and broken free! Not dead!
The guy running the place seemed surprised that we'd won on our first try. They have a 'wall of shame' where they post the pictures of all the teams that failed and the 'wall of fame' seemed to have far fewer pictures on it so he probably wasn't just pumping our tires. We are pretty awesome, after all.
It was definitely an interesting idea, and I had fun. They have 6 different rooms to do so even if you win on your first try there's still a reason to go back for more. It definitely gets my stamp of approval.
My mother and sister are in town this week and we decided to go give it a shot. An evil winemaker locked us in his cellar and was going to turn us into WINE if we didn't escape. 35 minutes later we'd unlocked the final box and broken free! Not dead!
The guy running the place seemed surprised that we'd won on our first try. They have a 'wall of shame' where they post the pictures of all the teams that failed and the 'wall of fame' seemed to have far fewer pictures on it so he probably wasn't just pumping our tires. We are pretty awesome, after all.
It was definitely an interesting idea, and I had fun. They have 6 different rooms to do so even if you win on your first try there's still a reason to go back for more. It definitely gets my stamp of approval.
Monday, March 24, 2014
Toot Toot! Puzzle Boat!
This weekend I went on a bit of an adventure. I played board games at Sky's place on Saturday (fun, but not much of an adventure) but instead of going home I hitched a ride with Pounder and spent the night at his place. Then all day Sunday (where all day started at 2pm because Arizona sucks) we hung out in Snuggles' basement working on Puzzle Boat 2.
A Puzzle Boat is essentially a large bundle of puzzles that you solve by yourself or in a team of whatever size you want. You start off with a couple of presumably easy puzzles and each time you complete a puzzle you get a password to enter into the website which unlocks more puzzles! There are some 'meta' puzzles that use the answers to the base puzzles and then one big main puzzle that puts everything together. The ultimate goal is to solve that big puzzle first. There are over 100 individual puzzles and our team of 7 people solved 13 in 10 hours so it's not exactly a quick endeavour!
We have 13 more puzzles currently unlocked that are in various states of completion and like 80 or 90 more still to unlock after that. We have another day to puzzle away (next Saturday I think) but finishing it then seems pretty out there too. So we've decided we're allowed to work on the 13 we have now but not unlock any new ones until we meet up again which seems like a pretty fair way to do things when we're not trying to win. That way we won't meet back with all the really fun stuff done and a bunch of cryptic crosswords still to do. Not that there's anything wrong with cryptic crosswords... But the one that we unlocked so far had the cryptic crossword part completely ignored.
Winning seems like the sort of thing that could have been plausible in an alternate universe but it would have involved a larger team, with people who have done this before, and who didn't mostly have to work Monday morning. As far as I can tell no one is even close to being done yet so a team that could work continuously for a couple days in a row is a really important piece it seems. That isn't our team, and that's fine, because you don't have to play for first place every time. You can play for fun, and yesterday was tons of fun. Lots of little 'a-ha' moments that really make the person who saw the trick feel good without the people who were stuck feeling bad because we're all on the same team and there are SO MANY of those moments to go around. And while a bigger team would have a better chance of winning it also means each person gets to touch fewer puzzles and that's not necessarily more fun. One of the 13 we solved just sat there having people rotate in to look at it forever until Lino finally made the right leap of logic to get the ball rolling again so you do want a fair number of people, but not too many. One room of people seemed like a pretty good number, though I probably should have brought my laptop since I kept needing to borrow others.
What's also cool about this sort of thing is when you have 100+ puzzles there gets to be a little bit of everything. Some sudokus, a cryptic crossword, a diagramless crossword, anagrams, ciphers, some image lookups, maybe there'll be a book code at some point. Browser games! Song recognition! All kinds of logic puzzles! Woo!
It was a bit of an adventure getting back to Toronto this morning and I never sleep well away from home but it was all worthwhile. All aboard the puzzle boat! TOOT TOOT!
A Puzzle Boat is essentially a large bundle of puzzles that you solve by yourself or in a team of whatever size you want. You start off with a couple of presumably easy puzzles and each time you complete a puzzle you get a password to enter into the website which unlocks more puzzles! There are some 'meta' puzzles that use the answers to the base puzzles and then one big main puzzle that puts everything together. The ultimate goal is to solve that big puzzle first. There are over 100 individual puzzles and our team of 7 people solved 13 in 10 hours so it's not exactly a quick endeavour!
We have 13 more puzzles currently unlocked that are in various states of completion and like 80 or 90 more still to unlock after that. We have another day to puzzle away (next Saturday I think) but finishing it then seems pretty out there too. So we've decided we're allowed to work on the 13 we have now but not unlock any new ones until we meet up again which seems like a pretty fair way to do things when we're not trying to win. That way we won't meet back with all the really fun stuff done and a bunch of cryptic crosswords still to do. Not that there's anything wrong with cryptic crosswords... But the one that we unlocked so far had the cryptic crossword part completely ignored.
Winning seems like the sort of thing that could have been plausible in an alternate universe but it would have involved a larger team, with people who have done this before, and who didn't mostly have to work Monday morning. As far as I can tell no one is even close to being done yet so a team that could work continuously for a couple days in a row is a really important piece it seems. That isn't our team, and that's fine, because you don't have to play for first place every time. You can play for fun, and yesterday was tons of fun. Lots of little 'a-ha' moments that really make the person who saw the trick feel good without the people who were stuck feeling bad because we're all on the same team and there are SO MANY of those moments to go around. And while a bigger team would have a better chance of winning it also means each person gets to touch fewer puzzles and that's not necessarily more fun. One of the 13 we solved just sat there having people rotate in to look at it forever until Lino finally made the right leap of logic to get the ball rolling again so you do want a fair number of people, but not too many. One room of people seemed like a pretty good number, though I probably should have brought my laptop since I kept needing to borrow others.
What's also cool about this sort of thing is when you have 100+ puzzles there gets to be a little bit of everything. Some sudokus, a cryptic crossword, a diagramless crossword, anagrams, ciphers, some image lookups, maybe there'll be a book code at some point. Browser games! Song recognition! All kinds of logic puzzles! Woo!
It was a bit of an adventure getting back to Toronto this morning and I never sleep well away from home but it was all worthwhile. All aboard the puzzle boat! TOOT TOOT!
Thursday, November 10, 2011
Perfectly Logical Beings
The pirate puzzle that's been discussed here the last few days came from a book about preparing for a programming interview. After explaining the solution to the puzzle the author then goes on a little rant about 'perfectly logical beings'. The puzzle didn't explicitly state that's what the pirates were (one of the tricks the interviewer might throw at you is leaving that information to you to derive) but in puzzle terms it was pretty clear regardless. The whole greedy, logical thing and all.
Perfectly logical beings don't make sense in the real world. Their inputs and outputs can all be precisely determined in a relatively easy manner once you figure out the trick to the puzzle. Real people are much more complicated, though I must admit I am quite intrigued to learn more about what Danielle was talking about in the Facebook thread with regards to actually working those sorts of things out in a non-puzzle sense.
Daniel and Sthenno both brought up what would happen if pirate E broke ranks and voted against the solution 1-0-1-0-98 even though we 'proved' that it's in his best interest to vote yes. In the real world maybe E can do that. He may have some input that we didn't think to account for (maybe he truly thinks one is the loneliest number and would have voted for any split that got him a non-one number) which causes him to behave what we perceive to be 'irrationally'. I'm sure he has a good explanation for what he did. But that would make him a real, complicated person and not a perfectly logical being.
So what happens in the puzzle when E breaks rank? He doesn't. The puzzle world simply doesn't work that way. The puzzle is a little logic problem designed to be solved in a reasonably short period of time with very limited information. Especially in an interview situation you may win bonus points with the interview by thinking 'outside the box' and giving the pirates backstories that cause weird votes. Maybe you'll just make the interviewer annoyed and lose the job. Who knows!
Sthenno also said he'd better hope I'm not actually dividing pirate plunder with him in this way since I'm going to die if I do. Now, I like my friends from University and all but there's no way I'm ever going to let them vote on if I get to live or die. (Can you imagine betting your life that you know how Bung is going to act in any given situation?) But I do play a lot of board games where this sort of decision can come up... Take El Grande, for example. You draft actions in that game. Some actions really impact board position. Other actions moderately impact board position and score points. Often the situation comes up where you can take the point scoring action or you can 'move the king' and set up the point scoring action to be really good for you. The trick is convincing the next guy to score points for you! (He can take the action but not activate it if he thinks it's going to be 'too good' for you.) Is a 10-2-0-0-0 split good enough? 10-4-0-0-0? 6-8-4-0-0? It depends on who you're playing with and the state of the board. Games like that (Modern Art, Dominant Species, and even Carcassonne) are all about putting yourself in a position where other people will score you points but you can't make it so they're only scoring you points or they won't do it.
But I digress. I've put a lot of thought into what happens when E isn't actually a perfectly logical being so I might as well say what I'd do in B's shoes. Here's what I believe to be true...
Perfectly logical beings don't make sense in the real world. Their inputs and outputs can all be precisely determined in a relatively easy manner once you figure out the trick to the puzzle. Real people are much more complicated, though I must admit I am quite intrigued to learn more about what Danielle was talking about in the Facebook thread with regards to actually working those sorts of things out in a non-puzzle sense.
Daniel and Sthenno both brought up what would happen if pirate E broke ranks and voted against the solution 1-0-1-0-98 even though we 'proved' that it's in his best interest to vote yes. In the real world maybe E can do that. He may have some input that we didn't think to account for (maybe he truly thinks one is the loneliest number and would have voted for any split that got him a non-one number) which causes him to behave what we perceive to be 'irrationally'. I'm sure he has a good explanation for what he did. But that would make him a real, complicated person and not a perfectly logical being.
So what happens in the puzzle when E breaks rank? He doesn't. The puzzle world simply doesn't work that way. The puzzle is a little logic problem designed to be solved in a reasonably short period of time with very limited information. Especially in an interview situation you may win bonus points with the interview by thinking 'outside the box' and giving the pirates backstories that cause weird votes. Maybe you'll just make the interviewer annoyed and lose the job. Who knows!
Sthenno also said he'd better hope I'm not actually dividing pirate plunder with him in this way since I'm going to die if I do. Now, I like my friends from University and all but there's no way I'm ever going to let them vote on if I get to live or die. (Can you imagine betting your life that you know how Bung is going to act in any given situation?) But I do play a lot of board games where this sort of decision can come up... Take El Grande, for example. You draft actions in that game. Some actions really impact board position. Other actions moderately impact board position and score points. Often the situation comes up where you can take the point scoring action or you can 'move the king' and set up the point scoring action to be really good for you. The trick is convincing the next guy to score points for you! (He can take the action but not activate it if he thinks it's going to be 'too good' for you.) Is a 10-2-0-0-0 split good enough? 10-4-0-0-0? 6-8-4-0-0? It depends on who you're playing with and the state of the board. Games like that (Modern Art, Dominant Species, and even Carcassonne) are all about putting yourself in a position where other people will score you points but you can't make it so they're only scoring you points or they won't do it.
But I digress. I've put a lot of thought into what happens when E isn't actually a perfectly logical being so I might as well say what I'd do in B's shoes. Here's what I believe to be true...
- D wants to get down to 2 people at this point and likely thinks she can capitalize on E's apparent randomness to get all the loot. She's probably voting against anything I propose and is definitely voting against anything C proposes after I die.
- I don't trust E. For all I know he just likes to see people die and would even vote against a split giving him all the loot. Who needs cash when you can have blood?
- Death is now a very real option for me.
- Death is also a very real option for C. I probably need his vote to not die, but the trick is he probably needs my vote for him to not die as well. Unless he's willing to bargain with E he needs my split to pass.
I've gone back and forth in my head about what I'd actually do. My first guy feeling was actually to propose 0-0-0-100. That's right, all the loot to me. I'd be banking on the fact that C trusts E as much as I do and that he realizes voting against my split means he dies too.
Then I thought that the life of a pirate probably isn't what I want out of life and I just want to survive. The best way to do that is the 0-0-100-0 split. C can have all the loot and we both get to live. I'm guaranteed to survive this time! (I know C isn't a lunatic since he did actually vote for 1 coin when A offered it.)
But then I'm thinking of the ultimatum game... I don't really want to make C angry. It may well go against all that greed stands for, but E threw greed out the window when he killed off A. So rather than make C an offer he simply can't refuse (0-0-100-0) I'm going to make him one he shouldn't refuse. 0-0-50-50. And then we stop sailing around with E.
Tuesday, November 08, 2011
Monopoly, Ultimatums, and Logical Pirates
Yesterday's puzzle got a couple correct answers in the comments of both the blog and on the Facebook notes thread. (I should really search harder for a solution which would allow combining both sources of comments...) There was also some good discussion about what would happen if one of the pirates wasn't a "perfectly logical being" which is actually where I was planning on heading with tomorrow's post. So I'm going to essentially ignore that for now but will be returning soon. Today I'm going to provide a tangentially related anecdote, the game theory "game" that sparked my remembrance of that puzzle, and the solution for those who may not read comments.
Last month was Monopoly at McDonalds. I was out eating lunch there with Andrew and he pulled Park Place off of his drink. If you collect both Park Place and Boardwalk you win a cool million dollars. The conversation turned to what would happen if I had Boardwalk on my drink. Andrew seemed to assume it was a given that we'd just split it and take $500k each. But part of me is thinking that Boardwalk is more likely to be the rare one so my expected value in terms of sheer money would be to reject that offer and just buy some more drinks in the hopes of getting a Park Place of my own. (Or to haggle him down to a better split I guess.) But in reality the marginal utility of the extra $100k between $500k and $600k isn't all that much and certainly isn't worth any strife that might be caused by making such demands from a friend. So if I'd had Boardwalk I'm sure we would have just taken $500k each and been ecstatic.
I wanted to continue the thought experiment though, so I asked Andrew what he'd do if a random dude had walked up to him and offered to buy Park Place off of him. What values would he accept? (Clearly he'd sell it to me for $500k, so what about the random dude?) The conclusion Andrew came to was he simply wouldn't sell it to a random dude no matter what the price was. The thing is we don't know which piece is actually worth the million bucks. One of Boardwalk and Park Place is worth almost a million dollars and the other is practically worthless. (It has some value to the owner of the real piece but is worth nothing to everyone else.) So if some guy showed up and offered a large amount of money then the odds are he's trying to scam Andrew out of the real piece. $50k sounds great but there's no way a stranger with the real piece is paying that much for the common one was his argument. After all, the stranger could just go buy 30 drinks, get 60 pieces, and almost certainly get his million bucks. If the stranger was offering a low amount of money (say, $50) then Andrew still wouldn't take it. Even though the stranger is probably just trying to save himself from buying 30 drinks there's a small chance he'd be trying to pull a fast one and it wouldn't be worth the risk.
Personally I like the idea of getting $50 for my worthless piece of paper, though I think what I'd do is try to find a second person in the restaurant with a Park Place and try to haggle the stranger to buy them both for $100. I don't think the stranger is scamming me at all but I will admit it would be a huge blow to my sanity if I sold it to him and it turned out to be the real piece and I probably wouldn't be willing to take that risk either. (Mostly I don't think it would ever happen at all. I know if I thought I had the winner I wouldn't advertise it in a room full of strangers. I'd quietly go home, hide the winner, and then just eat at McDonalds for a while.)
Which brings us to the 'game' I only just found out about earlier this week in my reading... The Ultimatum Game. The basic idea of the game is a random dude (probably in a top hat with a handlebar moustache) is going around making the following proposal to two strangers (in this case referred to as Alice and Bob.):
Alice is given $100 dollars and is told to split that money up into two piles. One pile for herself and the other pile for Bob. Then Bob gets to vote on the split. He can either vote for the split in which case Alice and Bob walk away with some cash. Or he can vote against the split in which case our moustachioed hero takes his money back. Either way the game is over. Alice and Bob can't negotiate over the split or communicate in any way. Alice makes a split and then Bob decides whether to take it or not.
So the question is, if you're Alice what split do you propose? If you're Bob what splits do you accept?
Now, the solution to yesterday's puzzle.
The trick to this puzzle is to find the base case and figure out what happens. Then work your way backwards until you end up at the current case. Since you only need half of the votes to pass a proposal the base case is when there are two pirates left since whatever is proposed is guaranteed to pass. (Obviously you vote for your own split since otherwise you're dead.) I'm going to break form from how everyone else labeled the pirates and assert that the pirates are, in reverse order of seniority, E-D-C-B-A.
Two pirates alive (E & D): D knows that whatever he proposes will pass and she's greedy so she offers a 0-100 split. It passes and D is rich!
Three pirates alive (E, D, & C): C knows that if his proposal gets shot down that the split will be 0-100. He also knows that he just needs one other vote in order to have his proposal pass. He needs to bribe E or D to vote with him. Clearly he can't bribe D to vote with him since D is already going to get all the money if C loses. On the other hand E is going to get absolutely nothing if this vote fails. One coin is better than no coins, after all, so C proposes a 1-0-99 split. E is logical and greedy and knows it isn't getting any better so he has to accept.
Four pirates alive (E, D, C, & B): B knows that if his proposal gets shot down that the split will be 1-0-99. He also knows he needs just one vote in order to win. The big loser is the last split was D. She has visions of coming home with all the coins way back in the base case but she now knows that's a pipe dream. She's going to get nothing if B dies. B knows that D knows this and once again one coin is better than no coins. His proposed split is 0-1-0-99 and it passes.
Five pirates alive (E, D, C, B, & A): I hope the pattern is becoming clear. A knows she needs to get 2 more votes and she knows that if she dies the split will be 0-1-0-99. The two easiest people for her to bribe and going to be E and C since they'll be getting nothing if A dies. So A proposes a split of 1-0-1-0-98 and walks away with most of the loot.
As Snuggles might say, "It's good to be captain!"
Last month was Monopoly at McDonalds. I was out eating lunch there with Andrew and he pulled Park Place off of his drink. If you collect both Park Place and Boardwalk you win a cool million dollars. The conversation turned to what would happen if I had Boardwalk on my drink. Andrew seemed to assume it was a given that we'd just split it and take $500k each. But part of me is thinking that Boardwalk is more likely to be the rare one so my expected value in terms of sheer money would be to reject that offer and just buy some more drinks in the hopes of getting a Park Place of my own. (Or to haggle him down to a better split I guess.) But in reality the marginal utility of the extra $100k between $500k and $600k isn't all that much and certainly isn't worth any strife that might be caused by making such demands from a friend. So if I'd had Boardwalk I'm sure we would have just taken $500k each and been ecstatic.
I wanted to continue the thought experiment though, so I asked Andrew what he'd do if a random dude had walked up to him and offered to buy Park Place off of him. What values would he accept? (Clearly he'd sell it to me for $500k, so what about the random dude?) The conclusion Andrew came to was he simply wouldn't sell it to a random dude no matter what the price was. The thing is we don't know which piece is actually worth the million bucks. One of Boardwalk and Park Place is worth almost a million dollars and the other is practically worthless. (It has some value to the owner of the real piece but is worth nothing to everyone else.) So if some guy showed up and offered a large amount of money then the odds are he's trying to scam Andrew out of the real piece. $50k sounds great but there's no way a stranger with the real piece is paying that much for the common one was his argument. After all, the stranger could just go buy 30 drinks, get 60 pieces, and almost certainly get his million bucks. If the stranger was offering a low amount of money (say, $50) then Andrew still wouldn't take it. Even though the stranger is probably just trying to save himself from buying 30 drinks there's a small chance he'd be trying to pull a fast one and it wouldn't be worth the risk.
Personally I like the idea of getting $50 for my worthless piece of paper, though I think what I'd do is try to find a second person in the restaurant with a Park Place and try to haggle the stranger to buy them both for $100. I don't think the stranger is scamming me at all but I will admit it would be a huge blow to my sanity if I sold it to him and it turned out to be the real piece and I probably wouldn't be willing to take that risk either. (Mostly I don't think it would ever happen at all. I know if I thought I had the winner I wouldn't advertise it in a room full of strangers. I'd quietly go home, hide the winner, and then just eat at McDonalds for a while.)
Which brings us to the 'game' I only just found out about earlier this week in my reading... The Ultimatum Game. The basic idea of the game is a random dude (probably in a top hat with a handlebar moustache) is going around making the following proposal to two strangers (in this case referred to as Alice and Bob.):
Alice is given $100 dollars and is told to split that money up into two piles. One pile for herself and the other pile for Bob. Then Bob gets to vote on the split. He can either vote for the split in which case Alice and Bob walk away with some cash. Or he can vote against the split in which case our moustachioed hero takes his money back. Either way the game is over. Alice and Bob can't negotiate over the split or communicate in any way. Alice makes a split and then Bob decides whether to take it or not.
So the question is, if you're Alice what split do you propose? If you're Bob what splits do you accept?
Now, the solution to yesterday's puzzle.
The trick to this puzzle is to find the base case and figure out what happens. Then work your way backwards until you end up at the current case. Since you only need half of the votes to pass a proposal the base case is when there are two pirates left since whatever is proposed is guaranteed to pass. (Obviously you vote for your own split since otherwise you're dead.) I'm going to break form from how everyone else labeled the pirates and assert that the pirates are, in reverse order of seniority, E-D-C-B-A.
Two pirates alive (E & D): D knows that whatever he proposes will pass and she's greedy so she offers a 0-100 split. It passes and D is rich!
Three pirates alive (E, D, & C): C knows that if his proposal gets shot down that the split will be 0-100. He also knows that he just needs one other vote in order to have his proposal pass. He needs to bribe E or D to vote with him. Clearly he can't bribe D to vote with him since D is already going to get all the money if C loses. On the other hand E is going to get absolutely nothing if this vote fails. One coin is better than no coins, after all, so C proposes a 1-0-99 split. E is logical and greedy and knows it isn't getting any better so he has to accept.
Four pirates alive (E, D, C, & B): B knows that if his proposal gets shot down that the split will be 1-0-99. He also knows he needs just one vote in order to win. The big loser is the last split was D. She has visions of coming home with all the coins way back in the base case but she now knows that's a pipe dream. She's going to get nothing if B dies. B knows that D knows this and once again one coin is better than no coins. His proposed split is 0-1-0-99 and it passes.
Five pirates alive (E, D, C, B, & A): I hope the pattern is becoming clear. A knows she needs to get 2 more votes and she knows that if she dies the split will be 0-1-0-99. The two easiest people for her to bribe and going to be E and C since they'll be getting nothing if A dies. So A proposes a split of 1-0-1-0-98 and walks away with most of the loot.
As Snuggles might say, "It's good to be captain!"
Monday, November 07, 2011
Greedy Logical Pirates
Here's a little logic puzzle from a book my old roommate Blake gave me many years ago. I really liked this one when I read it (I believe I've told it to a few people over the years) and I've been doing some other reading recently that reminded me of it. Can you figure it out?
There are five pirates who discover some buried treasure on an island. There are 100 gold coins and they need to divide the coins up amongst themselves. The way their pirate code works is the lead pirate proposes a split of the coins and then all the pirates vote on that proposal. If at least half the pirates vote YEA then that split carries and they move on with their plundering lives with their new booty. Otherwise they execute the lead pirate and start over from the top with the next pirate in line making a proposal.
The pirates are all greedy, logical, and don't want to die. You're the lead pirate. What split do you propose? Why?
There are five pirates who discover some buried treasure on an island. There are 100 gold coins and they need to divide the coins up amongst themselves. The way their pirate code works is the lead pirate proposes a split of the coins and then all the pirates vote on that proposal. If at least half the pirates vote YEA then that split carries and they move on with their plundering lives with their new booty. Otherwise they execute the lead pirate and start over from the top with the next pirate in line making a proposal.
The pirates are all greedy, logical, and don't want to die. You're the lead pirate. What split do you propose? Why?
Thursday, December 30, 2010
Cracking a Playfair Cipher
When I was a kid I used to take code books out from the library. I'd spend days writing secret messages to myself and trying to get friends to play along but no one else is insane enough to spend too much time encrypting and decrypting inane messages. As part of my ongoing treasure hunt I now have an encrypted message to decrypt using one of those old ciphers I used to mess around with. It's a Playfair Cipher, where essentially you build a 5x5 matrix from a keyword followed by the rest of the alphabet in order. You take your plaintext that you want to encrypt, split it into pairs of letters, and then encrypt the letters using the matrix. (Note a 5x5 matrix has only 25 spaces so you need to drop a letter. Generally this is done by eliminating Q or combining I and J together.) In this way you have 600 different 'characters' (or digraphs) instead of just 26 with most normal ciphers. This really ramps up the complexity when it comes to decrypting it without the key. (A normal substitution cipher is easy enough it gets included in standard puzzle magazines as Cryptograms or Cryptoquotes.)
At any rate, I'm working on one of the chapters in The World's Greatest Treasure Hunt. Each chapter has 20 questions to answer and I've worked out 18 of them. The two that remain are "What is the password given in this chapter?" (the real crux of the treasure hunt is figuring out what in the world these passwords might be I think) and a Playfair Cipher where they've encrypted a trivia question about Pirates of the Caribbean. They didn't give me the key, unfortunately, though they did include the note "the password is the key". I'm operating under the assumption that the answer to the first question is therefore the key to the code in the second question. They have a website up where you can enter in answers and check if they're right (that's how I know I have the other 18) and there is a fixed number of blanks for each answer. So, I believe the password has 6 characters.
Now, the ciphertext of the trivia question is pretty short so a lot of common codebreaking tricks won't work. I can't check for commonly occuring digraphs, for example, since there are 600 possible digraphs and only 25 in the ciphertext. My first thought was I should just write a program to brute force it, but there are 244 million possible 6 letter keys with 25 letters in my alphabet. Assuming 2 seconds per test I'd be looking at more than 15 years of processing time. My guess for how long each test might take could be off, but I doubt it's off enough to make up that gap. I could narrow things down more by only using common words in the hope the key is a real word, but that's not going to save enough time.
So I got to thinking... This is a trivia question, right? Most questions start with one of 5 words: who, what, when, where, or why. All 5 of those words start with the same two letters. So, what if I restricted my matrixes to ones where the first digraph (Ye) decrypts to Wh. I messed around a bit on the bus this morning and established 19 possible ways to have a 6 letter key which results in Wh turning into Ye. (That there is only 1 letter between W and Y and 2 between E and H narrow things down a lot and also make it pretty plausible that this is the right decryption of Ye.) I'm going to quantify things a little more when I get a chance but I'm pretty sure this will drastically reduce my search space for the key.
On top of that, 4 of the letters in the ciphertext are capitalized. The first letter, of course, but then 3 more later on. Most likely these are refering to a name or place from the movie and I may be able to find more restrictions on my key if I work from the capital letters. A digraph actually repeats itself shortly after two of the capitals as well, so the capitalized words share letters. I have a hunch I need to flesh out more on the bus, but I think I may be able to lock down a couple more conversions. The second digraph of the whole ciphertext (which I suspect is o_, at, en, er, or y_ if the first one is really Wh) is reversed and found in one of the capitalized words which now that I'm looking at it more really gives me an idea. Time will tell!
At any rate, I'm working on one of the chapters in The World's Greatest Treasure Hunt. Each chapter has 20 questions to answer and I've worked out 18 of them. The two that remain are "What is the password given in this chapter?" (the real crux of the treasure hunt is figuring out what in the world these passwords might be I think) and a Playfair Cipher where they've encrypted a trivia question about Pirates of the Caribbean. They didn't give me the key, unfortunately, though they did include the note "the password is the key". I'm operating under the assumption that the answer to the first question is therefore the key to the code in the second question. They have a website up where you can enter in answers and check if they're right (that's how I know I have the other 18) and there is a fixed number of blanks for each answer. So, I believe the password has 6 characters.
Now, the ciphertext of the trivia question is pretty short so a lot of common codebreaking tricks won't work. I can't check for commonly occuring digraphs, for example, since there are 600 possible digraphs and only 25 in the ciphertext. My first thought was I should just write a program to brute force it, but there are 244 million possible 6 letter keys with 25 letters in my alphabet. Assuming 2 seconds per test I'd be looking at more than 15 years of processing time. My guess for how long each test might take could be off, but I doubt it's off enough to make up that gap. I could narrow things down more by only using common words in the hope the key is a real word, but that's not going to save enough time.
So I got to thinking... This is a trivia question, right? Most questions start with one of 5 words: who, what, when, where, or why. All 5 of those words start with the same two letters. So, what if I restricted my matrixes to ones where the first digraph (Ye) decrypts to Wh. I messed around a bit on the bus this morning and established 19 possible ways to have a 6 letter key which results in Wh turning into Ye. (That there is only 1 letter between W and Y and 2 between E and H narrow things down a lot and also make it pretty plausible that this is the right decryption of Ye.) I'm going to quantify things a little more when I get a chance but I'm pretty sure this will drastically reduce my search space for the key.
On top of that, 4 of the letters in the ciphertext are capitalized. The first letter, of course, but then 3 more later on. Most likely these are refering to a name or place from the movie and I may be able to find more restrictions on my key if I work from the capital letters. A digraph actually repeats itself shortly after two of the capitals as well, so the capitalized words share letters. I have a hunch I need to flesh out more on the bus, but I think I may be able to lock down a couple more conversions. The second digraph of the whole ciphertext (which I suspect is o_, at, en, er, or y_ if the first one is really Wh) is reversed and found in one of the capitalized words which now that I'm looking at it more really gives me an idea. Time will tell!
Subscribe to:
Posts (Atom)