Log in

View Full Version : Challenge: find an approximation


durexlw
Feb 15, 2009, 05:28 AM
I'm looking for an approximation of the simple formula:

Result = (47-X)/X

For X = 1; result = 46
For X = 2; result = 22.5
For X = 3; result = 14.6
For X = 4; result = 10.75
For X = 5; result = 8.4
For X = 6; result = 6.8

I'd like to find an approximation that is easy and fast to calculate on the fly, it doesn't have to be accurate, the big ballpark is close enough.

Any idea is welcome and I do mean 'any'.

Thanks in advance,
Andy

galactus
Feb 15, 2009, 07:27 AM
An approximation? It's pretty simple as it is.

You could rewrite as y=\frac{47}{x}-1 \;\ or \;\ \frac{47}{x}-\frac{x}{x}

By plugging in the x value, it is easy to see the result.

Plug in x=6 and get \frac{47}{6}-\frac{6}{6}=\frac{41}{6} and so on.

Plug in 23 and get \frac{47}{23}-\frac{23}{23}=\frac{24}{23}

That appears to be easy enough and it is better than an approximation.

I suppose I am not clear on what sort of approximation you are looking for because it is

simplistic as is and fast to calculate 'on the fly'.

rwinterton
Feb 17, 2009, 07:45 AM
Result = (47-X)/X

Result = 47/X - X/X = 47/X - 1

if X is large, then 47/X becomes small and the approximation is
Result = -1

if X is small, then 47/X becomes large when compared to -1 and
Result = 47/X

if X is intermediate, you can't easily approximate.