Formula for quadratic sequence

Aqualight

New member
Joined
Oct 9, 2014
Messages
3
Hello,

Firstly, I'm new here and sorry if this is the wrong place to be posting this specific question, but I don't know where else to post. I'm making a game and I want to use a formula that inputs a specific X value undergoes processing and outputs number Y. Now if this were to be put in sequence terms, nth term is input and value in sequence is output.

100th term = 0.2
50th term = 0.6
0th term = more than 1.0

I want to generate a formula testing different values as powers of input to get a sort of curve. How can I test different formulas that have the same output as I said with the 100th, 50th and 0th terms of a sequence?

Regards
Aqualight
 
Hello,

Firstly, I'm new here and sorry if this is the wrong place to be posting this specific question, but I don't know where else to post. I'm making a game and I want to use a formula that inputs a specific X value undergoes processing and outputs number Y. Now if this were to be put in sequence terms, nth term is input and value in sequence is output.

100th term = 0.2
50th term = 0.6
0th term = more than 1.0

I want to generate a formula testing different values as powers of input to get a sort of curve. How can I test different formulas that have the same output as I said with the 100th, 50th and 0th terms of a sequence?

Regards
Aqualight
I may not be understanding what you are saying because I don't see what this has to do with a "sequence". I think you are looking for a function, f, such that f(100)= 0.2, f(50)= 0.6, and f(0)= 1.0.

Yes, you can fit a unique quadratic to three points. Writing f(x)= ax^2+ bx+ c, then f(100)= 10000a+ 100b+ c= 0.2, f(50)= 2500a+ 50b+ c= 0.6, and f(0)= c= 1.0. Since c= 1.0, 10000a+ 100b+ 1= 0.2 or 10000a+ 100b= -0.8 and 2500a+ 50b+ 1= 0.6 so 2500a+ 50b= -0.4. Solve those two equations for a and b.
 
Aqualight,

what do you mean by "more than 1.0" for the 0th term?

Why isn't the 0th term just 1.0?

Because the difference isn't 0.4 divided by 50 (0.008), it's not a single difference, that's why I'm saying it's quadratic, Maybe 0th term is 1.2, that's probably not the term but just as an example, the first difference is always higher, I'm searching of a way to test different rules that apply to the terms of the sequence that I mentioned, the first difference starts off as small below (0.008) and it increase when it's at the 0th term the first difference is above (0.008). The second difference is what stays the same. I'm not here to solve a sequence I'm here to learn how to test for different formulas that create a sequence of my desire, then I can use this formula in where I'm making my game. So an example of a totally different sequence:

1st term = 2
3rd term = 8
5th term = more than 14

A possible rule that fits the description of THIS sequence is 2 to the power of n! I'm trying to find a way that if I have a description of a sequence as 0th term is more than 1, 50th term is 0.6, and 100th term is 0.2, what are all the possible rules that fit the description. I don't mind having fractional powers, so the rule might have a number to the power of a fraction, I'm just trying to find a way of all the possible rules that fit the sequence I described, where the 0th term is more than 1.

Regards
Aqualight
 
Last edited:
HallsofIvy provided a solution above but you can also go about it this way: Let the term number be given by x, i.e. 0th term is x=x0=0, 50th term is x=x50=50, x=x100=100.Also let fn = f(xn) be the nth term in a sequence, i.e. f0>1, f50=0.6, f100=0.2. Now let
\(\displaystyle a = \frac{f_0}{(x_0-x_{50}) * (x_0-x_{100})}\)
\(\displaystyle b = \frac{f_{50}}{(x_{50}-x_0) * (x_{50}-x_{100})}\)
\(\displaystyle c = \frac{f_{100}}{(x_{100}-x_0) * (x_{100}-x_{50})}\)
then you can define f as
f(x) = a (x-x50) (x-x100) + b (x-x0) (x-x100) + c (x-x0) (x-x50) + (x-x0) (x-x50) (x-x100) g(x)
where g is any (finite) function you would care to choose (including zero).
 
Top