{"id":6220,"date":"2011-08-08T14:00:51","date_gmt":"2011-08-08T21:00:51","guid":{"rendered":"http:\/\/www.ikillspies.com\/blog\/?p=6220"},"modified":"2011-08-08T14:00:51","modified_gmt":"2011-08-08T21:00:51","slug":"probabilistic-zelda","status":"publish","type":"post","link":"http:\/\/www.ikillspies.com\/?p=6220","title":{"rendered":"Probabilistic Zelda"},"content":{"rendered":"<p>Are you sick of the stupid &#8220;weighing 8 objects on a scale&#8221; interview question?  How about this one:<\/p>\n<p>In &#8220;The Legend of Zelda: The Minish Cap,&#8221; Link finds a vending machine which sells figurines of all the monsters in Hyrule &#8211; these machines are called <i>gashapon<\/i> in Japanese.  Link wants to collect all the monsters in the machine, which accepts the local currency, &#8220;shells.&#8221;<\/p>\n<ul>\n<li>There are figurines of 136 monsters<\/li>\n<li>a single figure costs 1 shell<\/li>\n<li>the machine will dispense a random figure for 1 shell<\/li>\n<li>&#8230;but the machine will only vend figures of monsters Link has seen before<\/li>\n<li>for an additional 1 shell per purchase, Link can increase the probability of getting a figure he doesn&#8217;t already have, at a rate of 1% per shell.  Link can spend an unlimited number of shells (up to 100%) per transaction.<\/li>\n<li>Link throws away any duplicate figurines he receives<\/li>\n<\/ul>\n<p>The question: describe a strategy to acquire every figure which economizes on the number of shells spent assuming there are 136 unique monsters and figures, and :<\/p>\n<ul>\n<li>Link has met every monster in Hyrule before he buys any figures<\/li>\n<li>Link has never met any monsters, but has the ability to do so in between purchases<\/li>\n<li>Link has met N monsters, and has bought no figures<\/li>\n<li>Link has met N monsters, and has bought M unique figures already<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Are you sick of the stupid &#8220;weighing 8 objects on a scale&#8221; interview question? How about this one: In &#8220;The Legend of Zelda: The Minish Cap,&#8221; Link finds a vending machine which sells figurines of all the monsters in Hyrule &#8211; these machines are called gashapon in Japanese. Link wants to collect all the monsters [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6220","post","type-post","status-publish","format-standard","hentry","category-looky"],"_links":{"self":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts\/6220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6220"}],"version-history":[{"count":1,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts\/6220\/revisions"}],"predecessor-version":[{"id":6221,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts\/6220\/revisions\/6221"}],"wp:attachment":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6220"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}