Reduce Math in Formula Algebraically: BestCost

  • Context: High School 
  • Thread starter Thread starter 1plus1is10
  • Start date Start date
  • Tags Tags
    Formula
Click For Summary

Discussion Overview

The discussion revolves around the algebraic reduction of a formula used to calculate "BestCost," which is intended to filter costs based on a specific criterion related to the midrange of a set of values. The participants explore the mathematical formulation and its implications in a coding context.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents a formula for BestCost and seeks to reduce it algebraically while explaining its intended use for filtering costs.
  • Another participant questions the terminology used, specifically the phrase "low range of the average," suggesting that the average is a single number and clarifying that the calculation involves the midrange.
  • A third participant acknowledges confusion between terms like median, mean, and price range, ultimately deciding to abandon the original formula in favor of sorting costs to determine the lowest third.
  • Another participant suggests that the formula consists of linear operations and proposes that it can be simplified to a weighted average form, indicating that BestCost maintains a consistent relative position within the interval defined by lowest and highest values.

Areas of Agreement / Disagreement

Participants express differing views on the terminology and approach to the problem, with no consensus reached on the best method for calculating BestCost or the appropriateness of the original formula.

Contextual Notes

There is a lack of clarity regarding the definitions of terms like midrange, median, and mean, which may affect the understanding of the formula's intent. Additionally, the discussion does not resolve the mathematical steps involved in simplifying the formula.

1plus1is10
Messages
51
Reaction score
0
Is there a way to reduce the math in my formula algebraically:
BestCost = lowest+((((highest+lowest)/2)-lowest)*0.6667);

I want to use BestCost to filter out any Cost that is higher than 2/3 of the low range of the average. I hope that makes sense.

Thanks
 
Mathematics news on Phys.org
1plus1is10 said:
Is there a way to reduce the math in my formula algebraically:
BestCost = lowest+((((highest+lowest)/2)-lowest)*0.6667);

I want to use BestCost to filter out any Cost that is higher than 2/3 of the low range of the average. I hope that makes sense.
"Filter out" implies to me that you want to discard or ignore some values. Based on your use of a semicolon at the end of your formula, I suspect that this is part of some code, possibly C or a language derived from C. If that's the case, to filter out values, you need an if statement.

What do you mean by "low range of the average?" The average (or mean) is a single number. What you're calculating in your formula with (highest + lowest)/2 is called the midrange.

It would help if you provided a reasonably small list of numbers, and showed what your calculation is supposed to do.
 
  • Like
Likes   Reactions: 1plus1is10
You are very perceptive and bright - yes, it is code and after messing with it for quite some time now - I stopped to think about it. And "midrange" is exactly what I want. Unfortunately, I was getting confused in my head with median, mean, and price range. In the end, I will have to ditch my formula, and instead, simply sort my Costs to determine the correct 1/3 lowest.

Random costs after sorting: 1,2,3,4,5,6,7,8,9,10,11,12
BestCost = anything below the 4th one in the list;

Thanks for your help.
 
Your formula uses only linear operations. You can simplify it step by step until you get something like BestCost = a*lowest+b*highest with some coefficients a and b.
If a+b=1 (which is the case here) then you calculate a weighted average of the two numbers. BestCost is then always at the same relative place in the interval from lowest to highest.
 

Similar threads

  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 44 ·
2
Replies
44
Views
5K
  • · Replies 33 ·
2
Replies
33
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K