tag:blogger.com,1999:blog-11149365.post1005346900427667474..comments2024-03-23T04:34:59.089+00:00Comments on Go deh!: XKCD Simpler Knapsack SolutionPaddy3118http://www.blogger.com/profile/06899509753521482267noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-11149365.post-50016222222762477592009-06-22T09:23:47.062+01:002009-06-22T09:23:47.062+01:00Hi,
I'm not Hakan, I just knew he had a nice ...Hi,<br /><br />I'm not Hakan, I just knew he had a nice solution up.<br /><br />You can get all solutions by asking the system for them, given that you know the minimum number of items required. Thus two searches are needed, one to find the minimum (as is done in the example) and one to find all solutions with that minimum. Hakan has an example on his page solving the cryptarithmetic problem SEND?MOST=MONEY for all maximal values of money: http://www.hakank.org/gecode_r/send_most_money2.rbAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11149365.post-58507486163408752112009-06-20T10:07:43.688+01:002009-06-20T10:07:43.688+01:00Hi again Anon. Ruby CP solution guy (who turns out...Hi again Anon. Ruby CP solution guy (who turns out to be Hakan). Does your CP solution give all results? from the little I know, it probably will.<br /><br />I know some CP methodologies give you an easier way to state a problem, but was wondering, for this case, if you had to find *all* solutions, if CP does something extra that reduces the time complexity w.r.t. what I did? (Genuine question, I'm not trying to diss you).<br /><br />- Paddy.Paddy3118https://www.blogger.com/profile/06899509753521482267noreply@blogger.comtag:blogger.com,1999:blog-11149365.post-91782469462202761602009-06-19T17:47:29.888+01:002009-06-19T17:47:29.888+01:00Unfortunately, they never specified if that $15.05...Unfortunately, they never specified if that $15.05 was to be before or after tax...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11149365.post-8683438835000487192009-06-19T17:36:52.968+01:002009-06-19T17:36:52.968+01:00I realise that the community who reads this blog a...I realise that the community who reads this blog are generally programmers, but as one myself, could the anonymous programmers please help the entire world realise that we aren't all pedantic retarded fuckwits by taking all the fun out of what Paddy is trying to do?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11149365.post-15281148102321114382009-06-16T22:15:52.369+01:002009-06-16T22:15:52.369+01:00Thanks Anon, I did look at the CP solution.Thanks Anon, I did look at the CP solution.Paddy3118https://www.blogger.com/profile/06899509753521482267noreply@blogger.comtag:blogger.com,1999:blog-11149365.post-13665187791486235192009-06-16T14:09:40.730+01:002009-06-16T14:09:40.730+01:00As an FYI, a nice way of solving such a problem is...As an FYI, a nice way of solving such a problem is using constraint programming (CP). There is a solution to this instance written using a Ruby-interface to a CP library here (that it is in Ruby is in no way essential): http://www.hakank.org/gecode_r/xkcd.rbAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11149365.post-25318142390560124392009-06-15T18:57:43.562+01:002009-06-15T18:57:43.562+01:00Hi David,
I took a look at your Mathematica solut...Hi David,<br /><br />I took a look at your Mathematica solution, and although I don't know the language, I could not see where the exactcost of 15.05 is given? (I did like the formatting of the table though).<br /><br />- Paddy.Paddy3118https://www.blogger.com/profile/06899509753521482267noreply@blogger.comtag:blogger.com,1999:blog-11149365.post-87338259535426063532009-06-15T18:43:02.145+01:002009-06-15T18:43:02.145+01:00(Are Anon. posts always the most rude)?
@Anon: I...(Are Anon. posts always the most rude)? <br /><br />@Anon: I would suggest that my keeping of barbecue is much less of a retardation than your use of tone in a comment.Paddy3118https://www.blogger.com/profile/06899509753521482267noreply@blogger.comtag:blogger.com,1999:blog-11149365.post-16664977067519228932009-06-15T15:16:51.308+01:002009-06-15T15:16:51.308+01:00@Anonymous: I think that you are being extremely r...@Anonymous: I think that you are being extremely rude in your comment. If he likes to include a sandwich, why should you feel entitled to insult him, furthermore in such a harsh way? Go ahead, remove the Barbeque from the tuple and you will find your desidered solution and the world will be a better place. By the way, learn to spell.Francesconoreply@blogger.comtag:blogger.com,1999:blog-11149365.post-77463940311248074152009-06-15T13:58:04.151+01:002009-06-15T13:58:04.151+01:00Yet you still are including "barebecue" ...Yet you still are including "barebecue" in the list. I don't know if you are slightly retarded or what, but no restaurant ever includes a list of sandwiches in the "appetizer" section. The fact that the list of sandwiches was CUT OFF should make you realize that it's not supposed to be included.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11149365.post-32419401547311303852009-06-15T13:42:20.303+01:002009-06-15T13:42:20.303+01:00I got a minor nit to pick (in your data not your a...I got a minor nit to pick (in your data not your answer)<br />barbecue does not belong in the list <br />go back and read the comic it is 15.05 of appetizers the barbecue is a sandwich not an appetizer.<br />sorry i am done being picking nits nowgarylinuxhttps://www.blogger.com/profile/03682928140340344602noreply@blogger.comtag:blogger.com,1999:blog-11149365.post-10343253268918015242009-06-15T09:31:40.044+01:002009-06-15T09:31:40.044+01:00Short recursive mathematica program:
http://imgur...Short recursive mathematica program:<br /><br />http://imgur.com/0eCS1.gifUnknownhttps://www.blogger.com/profile/05997780637244886718noreply@blogger.com