# Equation help

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

*please see my new question below* [Edited by - hyn on August 18, 2005 5:39:21 PM]

##### Share on other sites
x = x / (2 - y^inf)

?

##### Share on other sites
I'm no mathematician, and i'm a bit unsure what you mean- but this may be the sort of thing you are talking about:

F(Xn) = Xn-1 * Y

where Y is a varying value and Xn-1 is the answer from the previous iteration

so if the intial value of x is 200 (the value for X0) and the value of Y is constantly at 0.5 - you should get the following results:

N____Xn-1______Y______Xn_____
1____200_______0.5____100____
2____100_______0.5____50_____
3____50________0.5____25_____
4____25________0.5____12.5___

...and so on

Hope this helps,
Darragh

##### Share on other sites

I don't think Xn-1 is neccesary, since I shouldn't need an input from a previous calculation.

I think I've messed up forming up my question, so I'll try again:

I want to find a number between 0.4 (or so) and 1, from a function, f(x).

EDIT: actually, x doesn't have to have limits..

f(1000) = 0.25
f(900) = 0.28
f(700) = 0.3
f(500) = 0.5
f(200) = 0.8
f(100) = 0.9
f(50) = 0.95
f(1) = 0.99
f(0.5) = 0.999

Then I can just multiply x by f(x) to get what I need.

Thanks,

hyn

##### Share on other sites
For the specific values you gave:
f(x) = 1 - (x / 500) * 0.6
will give a linear range of values intersecting 0.4 at 500 (f(500) = 0.4) and 1 at 1 (f(1) = 1). This doesn't necessarily satisfy f(200) = 0.8; if you definitely need that to be true, it becomes a quadratic function.

EDIT: Okay, so you changed the rules. This is more tricky, since you appear to have an asymptote as x approaches 0, and a something-else-for-which-I-can't-remember-the-term as x approaches infinity. A variation on
1 - Cx
maybe?

[Edited by - TDragon on August 18, 2005 5:28:41 PM]

##### Share on other sites
Ah yes, I think i understand what you mean now. You want to have 0.4 as the lowest possible number produced by this function and 1.0 as the highest possible number.

I think this would do the trick:

f(x) = 0.4 + (0.6 / x )

So the folowing values should be produced:

x_______f(x)
1.0_____1.0
2.0_____0.7
3.0_____0.6
5.0_____0.52
10.0____0.46
100.0___0.406

As x grows larger the answer will verge towards 0.4 but never reach it ( in pure maths terms of course, with the finite precision of computers it will ). So long as you keep x >= 1.0 this should work- if x falls below 1.0 however the answer will grow to infinity as you get closer to 0.0 , which is not what you want.

Regards,
Darragh

##### Share on other sites
Darragh, that's exactly what I needed.

Thanks you.

##### Share on other sites
Closed. Looks like homework with no justification. See Forum FAQ.

##### Share on other sites

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

This topic is now closed to further replies.

1. 1
2. 2
Rutin
15
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633269
• Total Posts
3011153
• ### Who's Online (See full list)

There are no registered users currently online

×