{"id":340,"date":"2007-01-18T15:25:02","date_gmt":"2007-01-18T04:25:02","guid":{"rendered":"http:\/\/www.somethinkodd.com\/oddthinking\/2007\/01\/18\/wine-gum-selection-puzzle\/"},"modified":"2007-10-07T20:07:45","modified_gmt":"2007-10-07T10:07:45","slug":"wine-gum-selection-puzzle","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2007\/01\/18\/wine-gum-selection-puzzle\/","title":{"rendered":"Wine-gum Selection Puzzle"},"content":{"rendered":"<p>Here&#8217;s a real life puzzle that I haven&#8217;t solved yet; but nor have I put much time into it yet. It was originally a problem related to randomised podcast playlists, but I have disguised it as a problem with lollies (candy) for no particular reason.<\/p>\n<hr \/>\n<p>So, I opened a packet of wine gums, sorted them into piles by colour and counted the pile sizes. There were 3 x raspberry, 3 x lemon, 6 x orange and 2 x lime (I threw the black licorice ones straight in the bin. Ugh!)<\/p>\n<p>I started eating them in that order, but I found I got bored of raspberry flavour very quickly. To maximise my pleasure, I wanted to consume them in the order that maximises the distance between eating two of the same flavour.<\/p>\n<p>So I started eating one from each pile, rotating around the piles. It started out great, and I was happy with my simple algorithm, until I had consumed most of the lollies, and had nothing but orange ones left. Boring! My naive algorithm was suboptimal; it just took me a while to notice &#8211; it worked well enough when the pile sizes were roughly the same size, but when one pile is much bigger then the others, it fell over.<\/p>\n<p>So what selection algorithm will maximise my wine-gum consuming pleasure, no matter what the flavour distribution?<\/p>\n<hr \/>\n<p>My thoughts so far involve drawing a set of parallel horizontal line segments, one for each flavour, spreading each pile of wine gum equally across its corresponding line segment, and consuming them left-to-right, top-to-bottom. (Wait, wait! Do I mean top-to-bottom, left-to-right? The one that keeps skipping to the other horizontal lines, prioritising left-ness over top-ness.) <\/p>\n<p>It sounds like a reasonable solution, but I haven&#8217;t tried to prove it is optimal yet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a real life puzzle that I haven&#8217;t solved yet; how to choose lollies to maximise distance between flavour repetitions.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[33],"tags":[101,55],"class_list":["post-340","post","type-post","status-publish","format-standard","hentry","category-puzzle-solving","tag-ipod","tag-puzzle"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":0,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}