# Thread: NeedFormula so results in decimal part < .25

1. ## NeedFormula so results in decimal part < .25

I hope I'm posting in the correct forum as I am not a mathematician and believe perhaps
this is where I should post this question:

This may not be possible but I'm looking for a mathematical formula
such that the sum of any set of numbers in any combination will always
produce a result in which the decimals are less than .25

The initial values of the numbers that are being summed are set, BUT
the formula can modify them to produce the necessary result.

Take for example a series of values in distances:

1.25 miles
14.80 miles
7.72 miles

the sum is now 23.77

I would like a formula that when applied against the numbers for miles,
modifies those numbers such that any combination of them will result in
a number whose decimal portion is always less than or equal to .25

So 1.25, 14.80 and 7.72 needs to be adjusted with the formula so that
when you add any combination, i.e., 1.25 + 7.72 the sum will have a
decimal part that is less than or equal to .25

FYI: the formula WILL adjust the mile number, again in the above
example (1.25 and 7.72) so that their sum will have a decimal part
that is less than or equal to .25, like 1.25 stays the same but 7.72
would change to 7.80 so that the decimal part now has a value of 9.05

Is this possible?

Thanks

2. Hmm... I understand if you are not a mathematician, but your question does need to be a bit more specific. Are 1.25, 14.80, 7.72 the only data you need this to work for? Can you substitute these three for different values? What about negative numbers? More than three?

Given an arbitrary finite list of numbers $x_1,x_2,x_3,...,x_n$, the following two formulas will guarantee a decimal part smaller than .25:

$f(\vec{x})=.05+\lfloor x_1\rfloor+\lfloor x_2\rfloor+...+\lfloor x_n\rfloor$ (add up the numbers each rounded to the nearest integer)

$g(\vec{x})=\frac14\sin(x_1+x_2+...+x_n)$ (sine is always between -1 and 1, so dividing by 4 gets you a number between -.25 and .25)

I cannot see the first possible use of these formulas in the "real" world, so I perhaps am misunderstanding your question.

3. Media_Man thank you so much for your help. Indeed, I am not a mathematician but thought about this some more and realize that it cannot be done in the following scenario but correct me if I'm wrong.

One real world application, if it could work, is to guarantee to a buyer that for any given purchase of something under, say \$10.00 would always give the purchaser at least .75 cents back. If I could price my 30 items at a certain number, then any combination of them would produce a result in which the change given back to a customer always results in at least .75 cents returned. But I see that it is just not possible unless the numbers could be changed during the purchase which I doubt any normal buyer would accept. But in a board game..... hmmm... that is something to think about!

But then again I see in your forumula that you are suggesting an arbitrary finite list of numbers. So then could it work?

Current Price list:

Soda: .75
Coffee: 1.75
Sandwich: 3.25