Get the slope of a line in my example?

xeon123
Messages
90
Reaction score
0
Hi,

I've these values:

Code:
# x     y=f(x)
50      1957768251
100     3915542997
150     5873311096
500     19577709464
1000   39155455160
1500   58686574963
2000   78292255800
2500   97888617384
3000   117466340329
3500   137044056081
4000   156491263529
4500   176177759312

These values represents a straight line in a graph. Using the equation y=mx+b, and assuming b=0, I would like to know the slope of the straight line. Since, it's the m variable that gives me the slope, so,

m=\frac{y}{x}Applying this equation, I get the results:

Code:
39155365
39155429
39155407
39155418
39155455
39124383
39146127
39155446
39155446
39155444
39122815
39150613

With these results, the slope is around 39000000? Shouldn't I get a more reasonable value, like 3?

What is the slope?

Thanks,
 
Mathematics news on Phys.org
39000000 looks about right. The better way to do this is a least squares fit, but it won't give you a radically different result.
 
The slope is nowhere near 3. How did you get the y-values? Without knowing what you did to get these values, I would guess that it's roundoff error. But it looks like the slope is around 39000000 as you said.

Just out of curiousity, what's the context of this problem? It would be more helpful if we knew what you were trying to do.
 
Why do you expect the slope to be around 3? do you know something we don't?

First of all...if you think that slope values should be reasonable, you are mistaken...think about it, a line that is vertical has a slope of infinite!

Second, if you know ahead of time what you are looking for and know that the slope should be around 3...then, you may have a type-cast-ing problem or printing problem or something...what kind of environment/programming language are you using to do this work? are you performing a REAL calculation and assigning this to an INTEGER variable? or what?
 
f(x) is the time spent in executing the whole computer program.
To understand my problem, I must explain the program.

I've 2 versions of a program. The difference between them is that one of them execute 3 times more than one of them.

For example, in program one, it accepts the input 50 and returns the solution at a time t.
t=f(x)

The program two, it accepts the input 50, and execute the same instructions 3 times before return a result.
t'=3f(x)

Now I get it what's my problem. I'm just putting part of the results, I must put the rest of the results to get the value that I want, which is 3.

Thank you for your answers.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top