Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Average Price Algorithm

by Bloodnok (Vicar)
on Jan 28, 2009 at 09:00 UTC ( [id://739459]=note: print w/replies, xml ) Need Help??


in reply to Average Price Algorithm

Is it just me, or is there the distinct smell of homework in this node ??

There's no indication of any efforts on behalf of the poster thus far - apart from a calculation of the average price - a task which is, to say the least, trivial in the extreme.

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: Average Price Algorithm
by tilly (Archbishop) on Jan 29, 2009 at 02:16 UTC
    The problem as given is not well-defined, which is a pretty clear sign that it is not homework. It is not well-defined because it is unclear what the metric is for the "best" fit. Are we trying to minimize the maximum error? Are we trying to minimize the average error? Are we trying to minimize the sum of the squares of the errors? All three would fit the problem description, and all three can lead to different optimal answers.

    The fact that the problem looks NP complete is just icing on the "probably not homework" cake.

Re^2: Average Price Algorithm
by Anonymous Monk on Jan 30, 2009 at 01:10 UTC
    Sounds more like he's trying to hand out shares of Apple stock as awards. (I hope they're not back-dating them again) That's the only good reason I can think of to need to track the original prices. However, use of the term "commodity" is completely wrong as that denotes an asset that has no distinguishing characteristics from unit to unit. If it were truly a commodity, the answer would be "charge everyone the average price and it doesn't matter which units they get".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://739459]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-18 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found