in reply to Re: maximizing value from a set of objects
in thread maximizing value from a set of objects

You go to a lot of trouble.

  1. How many items to consider? 5 - A,B,C,D,E
  2. Highest value? Each of the items has an attribute called 'value'. Add 'em up. Which total is highest?
  3. Can we buy more than one? Legitimate question. A quick analysis of the data suggests values have been picked to make an obvious choice the wrong one (E C B adds up nicely to 25). One each seems to be indicated.

Perhaps you are making the larger point about the continual headache of the professional: insufficiently detailed specifications. Or maybe I am just lacking in imagination.

Dum Spiro Spero
  • Comment on Re^2: maximizing value from a set of objects

Replies are listed 'Best First'.
Re^3: maximizing value from a set of objects
by BrowserUk (Patriarch) on Nov 05, 2015 at 20:36 UTC
    1. From the OP:

      (JFYI, I'm actually trying to write a salary cap script but I thought I'd give a simpler example).

      I don't think its unreasonable to consider the possibility that the OPs real problem could have substantially more items to be considered.

    2. Highest value?

      And you've never seen a case of a sloppy description here.

    3. Can we buy more than one? Legitimate question. A quick analysis of the data ...

      Is meaningless given the quote in 1. above. Please read my final paragraph.

    Or maybe I am just lacking in imagination.

    Or maybe you just didn't real the full question.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

      If you're going to answer the question he should have asked instead of the one he did, you are of course free to include whatever complications your experience and imagination deem appropriate. And probably rightly so. As I said, I fault my own lack of imagination.

      Dum Spiro Spero
        If you're going to answer the question he should have asked instead of the one he did,

        The code I supplied answered the exact problem as asked.

        The reason the answer isn't your solution of "(E C B adds up nicely to 25)", is because that sums to a value of only $53; when there are other solutions that sum to higher values.

        The problem is not a "lack of imagination"; but ...


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.