Tech Interview

Screwy Pirates

A. first i would just like to say i am so glad jenna got voted off survivor. yuck, i couldn’t stand her ever since she accused that guy of eating beef jerky when he was chewing on grass.

B. recruit meyer on boot camp rocks. did you see how he made himself cry to get sympathy? and it worked! he is the funniest part of the show. i hope he wins.

C. i apologize for this site being soooooo slow. but that’s why you get what you pay for. (i didn’t pay anything so i shouldn’t really expect anything in return.)

D. those screwy pirates are at it again. this time there are 13 pirates and they need to protect their treasure chest. they decide that they should only be able to open the chest if the majority (at least 7) agree that it should be opened. they ask a locksmith to come and put a specific number of locks on the safe. every lock must be opened to open the chest. there can be multiple keys for each lock, but each key only opens one lock (i.e. no skeleton keys). the locksmith can give more than one key to each pirate. how many locks should the locksmith use and what strategy should he use to distribute the keys, such that only when a majority of the pirates agree can the chest be opened?

Solution

Problem: those screwy pirates are at it again. this time there are 13 pirates and they need to protect their treasure chest. they decide that they should only be able to open the chest if the majority (at least 7) agree that it should be opened. they ask a locksmith to come and put a specific number of locks on the safe. every lock must be opened to open the chest. there can be multiple keys for each lock, but each key only opens one lock (i.e. no skeleton keys). the locksmith can give more than one key to each pirate. how many locks should the locksmith use and what strategy should he use to distribute the keys, such that only when a majority of the pirates agree can the chest be opened?

a somewhat technical answer is here.

(un)fortunately that user left it up to me to explain why this solution works… but fortunately my brother did it here in a very understandable fashion. thanks big brother!

Exit mobile version