View previous topic :: View next topic |
Author |
Message |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
|
Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Oct 27, 2009 4:36 pm Post subject: |
|
|
Not hard...
Code: |
for(int i = 0; i<10; i++){
printf("%d %d\n", i, (7*i)+23);
}
|
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Tue Oct 27, 2009 4:38 pm Post subject: |
|
|
&Vage wrote: | Not hard...
Code: |
for(int i = 0; i<10; i++){
printf("%d %d\n", i, (7*i)+23);
}
|
|
Thanks for showing you don't even understand basic algebra, nor do you understand what the OP is even asking. Get out.
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Tue Oct 27, 2009 5:12 pm Post subject: |
|
|
Athaem wrote: | &Vage wrote: | Not hard...
Code: |
for(int i = 0; i<10; i++){
printf("%d %d\n", i, (7*i)+23);
}
|
|
Thanks for showing you don't even understand basic algebra, nor do you understand what the OP is even asking. Get out. |
Well, forget what I meant about Bruteforcing, it actually doesn't at all. For the linear part it find the slope & the Y intercept and creates the equation from there. But the Quadratic part solving method is much harder and BruteForcing isn't an option.
Edit: Idea. I'll just find the differences of the 2nd values example:
2y|4|10|20|34|52
x=1|2|3|4|5|
y=2|5|10|17|26|
diff1=3|5|7|9|
diff2=2|2|2|
diff3=0|0
2 * 2 = 4 Difference = 1
2 * 5 = 10 Difference = 3
2 * 10 = 20 Difference = 5
2 * 17 = 34 Difference = 7
2 * 26 = 52 Difference = 9
Solution: Y = X² + 1
This would be too insane for me to program if the equation was like this
Y = X² + aX + B
Any Ideas?
_________________
CEF will always stay alive. |
|
Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Oct 27, 2009 7:19 pm Post subject: |
|
|
Athaem wrote: | &Vage wrote: | Not hard...
Code: |
for(int i = 0; i<10; i++){
printf("%d %d\n", i, (7*i)+23);
}
|
|
Thanks for showing you don't even understand basic algebra, nor do you understand what the OP is even asking. Get out. | You're fucking ignorant in the worst way possible, I was showing what OP did, I never said it was right.
Correct way would be
0, 23
1, 30
2, 37... and so on.
Slope would be 7, so th so y would be for example if the value of y would increase +7 for every time x would increase by 1.
Y intercept would be 23 btw, that means that the location of y on the grid would be 27 when x is on 0. Get @ me.
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Tue Oct 27, 2009 7:30 pm Post subject: |
|
|
&Vage wrote: | You're fucking ignorant in the worst way possible, I was showing what OP did, I never said it was right.
Correct way would be
0, 23
1, 30
2, 37... and so on.
Slope would be 7, so th so y would be for example if the value of y would increase +7 for every time x would increase by 1.
Y intercept would be 23 btw, that means that the location of y on the grid would be 27 when x is on 0. Get @ me. |
I honestly can't believe people as retarded as you even exist on this earth, I would have thought natural selection would have killed you off by now.
You weren't even close to showing what the OP did. The code you posted simply looped through the variables to display the corresponding (hard-coded) function. That's the exact opposite of what he is asking; nice try covering up with a shitty explanation though.
|
|
Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Oct 27, 2009 7:38 pm Post subject: |
|
|
Athaem wrote: | &Vage wrote: | You're fucking ignorant in the worst way possible, I was showing what OP did, I never said it was right.
Correct way would be
0, 23
1, 30
2, 37... and so on.
Slope would be 7, so th so y would be for example if the value of y would increase +7 for every time x would increase by 1.
Y intercept would be 23 btw, that means that the location of y on the grid would be 27 when x is on 0. Get @ me. |
I honestly can't believe people as retarded as you even exist on this earth, I would have thought natural selection would have killed you off by now.
You weren't even close to showing what the OP did. The code you posted simply looped through the variables to display the corresponding (hard-coded) function. That's the exact opposite of what he is asking; nice try covering up with a shitty explanation though. | Compared to linking a freshman to equations that he hasn't even learn till he's a junior? Actually I take back you being ignorant, there's no word that can comprehend your stupidity. Thought idiots like you don't exist anymore.
OP: Maybe this will help; http://library.thinkquest.org/2647/algebra/ftpolyno.htm
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
|
Back to top |
|
 |
TanLiHao Grandmaster Cheater Supreme
Reputation: 0
Joined: 26 Jan 2007 Posts: 1220 Location: Singapore
|
Posted: Fri Oct 30, 2009 10:04 pm Post subject: |
|
|
Jorg Hi so you managed to complete the quadratic equation right?
But anyway I will give you the formulaes for all three types you said.
For a linear equation, it is extremely simple
The equation can be gotten like this,
m is the gradient.
So you sub in a one x1 value and one y1 value into the general equation above. Then you find the gradient by using two coordinates.
As for a quadratic equation, it is a little more complicated, you form three equations to obtain the expression.
Because this is more complicated, I will give an example for this.
Say the equation is y = 2x² + - x - 6
So let's pick out some random coordinates, we need at least three coordinates, so say we x = 3, x = 5 and x = 6.
So the coordinates are (3, 9), (5,39) and (6,60)
We let f(x) = ax² + bx + c
So we do f(3) = a(3)² + b(3) + c = 9
9a + 3b + c = 9 - (1)
f(5) = a(5)² + b(5) + c = 39
25a + 5b + c = 39 - (2)
f(6) = a(6)² + b(6) + c = 60
36a + 6b + c = 60 - (3)
We minus equation (2) with equation (1), that will cancel out the constant c, this will always happen, so it's always done as the first step.
So now we get 16a + 2b = 30
Rearranging the formula, we get b = (30 - 16a) / 2 - (4)
Now we sub (4) into (1), you can sub it into (2) also but it's the same anyway.
We now get 9a + 45 - 24a + c = 9
Rearranging the formula, we get c = -36 + 15a - (5)
We now sub (4) and (5) into (3)
36a + 90 - 48a - 36 + 15a = 60
So we solve for a, and get a = 2
Now we sub a = 2 into (4)
b = (30 - 16(2)) / 2
= -1
Sub a = 2 into (5)
c = -36 + 15(2)
= -6
So now since we know a,b,c, y = ax² + bx + c
y = 2x² - x - 6
Did you see we just got back our equation.
Likewise this can be done for cubic equations, but you need four equations instead and it will be y = ax³ + bx² + c + d.
There may be other methods but this is the easiest to understand and implement I suppose.
|
|
Back to top |
|
 |
igoticecream Grandmaster Cheater Supreme
Reputation: 0
Joined: 23 Apr 2006 Posts: 1807 Location: 0x00400000
|
Posted: Sun Nov 08, 2009 9:36 am Post subject: |
|
|
The Jorg hi wrote: |
This would be too insane for me to program if the equation was like this
Y = X² + aX + B
Any Ideas? |
(-b ± (b² - 4ac)½)/2a
note: ½ <-> root
note2: this will throw 2 values, this is the way of resolving quadractic expressions
more info: http://en.wikipedia.org/wiki/Quadratic_equation
_________________
+~ |
|
Back to top |
|
 |
TanLiHao Grandmaster Cheater Supreme
Reputation: 0
Joined: 26 Jan 2007 Posts: 1220 Location: Singapore
|
Posted: Sun Nov 08, 2009 10:10 pm Post subject: |
|
|
He's not trying to solve an equation, he is trying to get an expression for an equation based on the values.
|
|
Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Mon Nov 09, 2009 4:45 pm Post subject: |
|
|
You should look into neuron networks. I have recently gotten very interested in them, and it seems like they could be used to easily solve any polynomial.
EDIT:
I don't know if you are still doing this, but I made a neuron network today that can effectively solve certain patterns.
|
|
Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Wed Nov 18, 2009 9:44 pm Post subject: |
|
|
Dim X1 as integer
Dim X2 as integer
Dim Y1 as integer
Dim Y2 as integer
Dim m as double = (Y2 - Y1) / (X2 - X1)
Dim y as String = m.ToString + "x" + (- m*x1 + y1).ToString
_________________
|
|
Back to top |
|
 |
WaffleMaster Grandmaster Cheater Supreme
Reputation: 0
Joined: 19 Oct 2006 Posts: 1237
|
Posted: Wed Nov 18, 2009 11:54 pm Post subject: |
|
|
Try looking at the source code for microsoft math 2007 if you want to know how to quickly solve for the equation. It's made in C#, so you can just use reflector to disassemble it (MS didn't even pack it or anything).
_________________
Problem, CEF?
Buying zhelms/leech in Windia. PM me. |
|
Back to top |
|
 |
|