Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

gggmork

Members
  • Content count

    2856
  • Joined

  • Last visited

About gggmork

  • Rank
    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. Ribbiks

      Ribbiks

      I'm assuming the prices are per ounce?

      total $$ / total poop = sum_i(price[i]*ounces[i]) / sum_i(ounces[i])

    2. Zed

      Zed

      If you're talking about average (which I understand is synonyms with mean), then it's 1.365. Just sum up all your values (1.35+1.35+1.36+1.37+1.38+1.39) and then divide by 6.

      EDIT: @Ribbiks: As I understand it, he just wants the average (mean) value of the prices, but now I'm confused.

    3. Show next comments  3 more
×