# Thread: Simplify equation - help pls

1. ## Simplify equation - help pls

Hello all,

I've derived an equation in order to help model a physical system as part of a project I'm working on. I won't go into details as the part I need help with is only a small part of the project and really just involved simplify an equation. The equation as derived in its original form is:

Result = (V + Q - θY) - (1-θ)Y

Where θ is a coefficient that can vary between 0 and 1.

However I think this should simplify. For a start it can be re-written:

Result = V + Q - (θY + (1-θ)Y)

Then expanding out the (θY + (1-θ)Y) part gives θY + Y - θY, which equals just Y.

So bringing it all together I think the original equation should simplify:

Result = (V + Q - θY) - (1-θ)Y = V + Q - Y

Would it be possible for someone to check my maths and let me know if this is correct?

NOW - here comes the confusing bit. I programmed both the original equation and the simplifed equation into an Excel spreadsheet, then got the spreadsheet to generate random values for V, Q, Y and θ (with θ always between 0 and 1). The spreadsheet then compares the result from the original and simplifed equation. They should always be equal (if I've done the simplification right) but every now and again Excel reports a difference in the results. It's always small, for instance:

1) Result 1a = 80.6000000000000, Result 1b = 80.5999999999999

2) Result 2a = 88.8554000000001, Result 2b = 88.8554000000000

i.e. very small differences. However I can never figure out why there is a difference. Have I done something wrong or is it just Excel reporting a difference which isn't actually there?

Thanks very much
-Rob

2. I agree with your simplification.

As to the small errors you're seeing, they are attributable to round-off error. That is, you are dealing with the inherent difficulties of doing arithmetic on a computer.

3. Thanks Akbeet.

4. You're welcome. Have a good one!