# Homework Help: Matching two series

1. Jan 6, 2014

### bobie

1. The problem statement, all variables and given/known data
This is not homework, just an exploration
we have two rows of numbers
2 1.5
1.8 1.5555..
1.6 1.625
1.5 1.6666..
1 2
.8 2.25
.6 2.6666..
.5 3
.4 3.5
.2 6
.1 11
we want to find a general formula /operation that gets the second row
how do we proceed? only by trials and errors?is it better to multiply first row by 10?or the second so to get integers?

Is there anyone that can solve this problem?
Thanks

Last edited: Jan 6, 2014
2. Jan 6, 2014

### CompuChip

Although you can always find a function through any finite number of data points that will "predict" the next number, I fail to see a sensible pattern in these ones. Maybe you can plot them and advise what kind of relationship you are looking for... is it supposed to be a straight line, or an exponential, or a polynomial? Do you want an exact fit or a "close" fit? Depending on where you got the number from, is there any a priori expectation (of, for example, linearity)?

3. Jan 6, 2014

### Ray Vickson

The standard way to deal with such questions is to plot y (the second number) in terms of x (the first number), or to plot x in terms of y. The form of the graph should suggest a type of formula y = f(x) or x = f(y) that will give you what you want.

In this case it looks like a formula of the form
$$y = a + \frac{b}{x^c}$$
should work. Here, a, b and c are some unknown constants that need to be estimated from the data. There are a number of standard methods that can be used to find "good" values of a, b and c. In this case the use of a nonlinear least-squares package yields a good answer. I just used the Maple 'NonlinearFit" package, but I would bet that Wolfram Alpha also has a similar package available for free on-line use. Alternatively, you could use the EXCEL Solver to solve the nonlinear optimization problem that you get from the least-squares formulation.

I won't spoil your fun by giving you the answer; I think you will learn more by playing around with this problem yourself.

Added note: in this problem it is very useful to use exact rationals instead of decimals; for example, write 1.5555... as 1 + 5/9 = 14/9, etc. Do this for both x and y.

Last edited: Jan 6, 2014
4. Jan 7, 2014

### bobie

Thanks, Ray, I found the solution, it was rather easy but doesn't match your formula
mine is :$$y = \frac{x+1}{x}$$ , what is yours?
Can you suggest how to ask for a graph at Wolfram?

5. Jan 7, 2014

### haruspex

It does if you plug in the right values for Ray's a, b and c.

6. Jan 7, 2014

### Ray Vickson

I get y = 1 + (1/x), exactly the same as you. It is obvious once you convert the x,y data to rational numbers. As for graphing via Wolfram: I am the wrong person to ask.

7. Jan 7, 2014

### mafagafo

Wolfram... what?

Alpha can just get "(x+1)/x" and it will do some graphics.

Mathematica Code:
Plot[(x+1)/x, {x, .01, 3}]
DiscretePlot[(x + 1)/x, {x, 0.1, 10., 0.1}]

Simple Mathematica code, some lines run on alpha.
I am not good at asking Alpha things.

Last edited: Jan 7, 2014
8. Jan 7, 2014

### Ray Vickson

I think he probably wanted a way to do a plot of some given points (x1,y1), (x2,y2), ..., (xn,yn), rather than a plot of a specific formula. He could do it easily in EXCEL, for example, and of course, also in full-power Mathematica (or Maple or .... ), and he could also go out and buy some graph paper and do the whole thing by hand.

9. Jan 7, 2014

### mafagafo

Ray may be right.

In Alpha:
(2, 1.5) (1.8, 1.5555) (1.6, 1.625) (1.5, 1.6666) (1, 2) (.8, 2.25) ... (you can go a long way, I think)
Will give you a Cartesian coordinate system with the points on it.

10. Jan 8, 2014

### bobie

Last edited: Jan 8, 2014
11. Jan 8, 2014

### Ray Vickson

Show your work first, as required by PF rules.

12. Jan 8, 2014

### bobie

The nearest I found is 5 + .75/x^2 but works only for 1 and 1.5 and then makes a curve

13. Jan 8, 2014

### Ray Vickson

You need to show what you did; that is, not just the answer, but how you got it. That is important, because we need to know your thinking in order to be able to help.

14. Jan 8, 2014

### bobie

15. Jan 8, 2014

### Ray Vickson

Always start by plotting the points. You can do it easily in EXCEL or any other, comparable spreadsheet. A very good alternative is to go to a stationary store and buy some graph paper; then you can plot points manually, using nothing fancier than a pencil. I am 100% serious---that's my advice.

16. Jan 8, 2014

### mafagafo

I agree with Ray to some degree. Using Alpha for point plotting (if more than 3 or 4) is not wise. Use any spreadsheet graphing if you don't use Mathematica, Matlab or any other mathematical software.