Jump to content

gggmork

Members
  • Posts

    2856
  • Joined

  • Last visited

About gggmork

  • Rank
    Forum Staple
    Forum Staple

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Single Status Update

See all updates by gggmork

  1. code:
    Array
    Say I'm in the poop buying business, because I need a lot of poop to fertilize my beautiful collection of carrion flowers. I buy 57.49 ounces at the price of 1.34, I buy 77.46 ounces at the price of 1.35, etc, as shown above.
    What is the average PRICE I bought them all at. Like it would probably be closer to 1.35ish in this case.
    My guess is like (57.49 * 1.34) + (77.46 * 1.35) etc... then divide that all by 1.365 (the halfway mark) or something???? Leik what do I do I don't know???

    1. Show previous comments  2 more
    2. gggmork

      gggmork

      I know how to do a normal average (sum say 13 numbers divided by 13).. but this is kind of like a 'weighted' average. Like 77.46 is a pretty high weight for 1.35, and 1.0 is a low weight for 1.38.
      The 'normal' average for the price should be 1.365... but that average would be slid more toward the 1.34 end because there's higher weights on that side.
      I tried ribbiks equation, but not sure if I'm doing it right without more explicit steps 'for dummies' instead of 'sum i' functions.

    3. geekmarine

      geekmarine

      I'm not entirely sure I interpreted this correctly, but I took the total sum of all prices * weights and divided by the total sum of the weights. In other words -

      (price1 * weight1 + price2 * weight2 + price3 * weight3...) / (weight1 + weight 2 + weight3..)

      The answer I got was $1.35 per ounce, rounded to the nearest penny (more like $1.349... when not rounded, but yeah).

      Or to put it more simply, I found the total price paid for all the manure divided by the total weight of the manure. I believe that's what the problem is looking for, but I could be mistaken. But yeah, I get the point - obviously if you buy a lot at a lower price and a little at a higher price, the average should tend to skew down towards the lower price, rather than having the average simply be halfway between the highest and lowest.

    4. gggmork

      gggmork

      Yeah, that's it I'm pretty sure (i think same thing ribbiks said... I tried his earlier then realized I was using a + instead of a * just now, derp), thanks! I'll put [solved] in the topic title now I guess. (this was actually for bitcoin bullcrap... and no I sure didn't buy btc at those prices, it was an altcoin)

×
×
  • Create New...