An algebra question...
-
I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me:
Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1
all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie:n2 = c*(b-d-b*c+a*d)
. stumped. -c
-
I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me:
Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1
all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie:n2 = c*(b-d-b*c+a*d)
. stumped. -c
Being as I nearly failed algebra take my advice with this caution. Okay, I think what you are going to have to do is do some factoring. But my brain has stopped functioning tonight so beyond that I have no idea
-Matt Newman -Matt Newman
-
I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me:
Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1
all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie:n2 = c*(b-d-b*c+a*d)
. stumped. -c
Believe you are missing an equation. Generally solving for two variables, requires two equations. You have one and some other constaints. Note that as stated, a=0 and b=Q11/Q01 generally works. You can reverse the roles with b=0 and also get a solution. Ed
-
I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me:
Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1
all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie:n2 = c*(b-d-b*c+a*d)
. stumped. -c
If you want to find a unique solution, then you need two linearly independent equations. However, in this case, there are infinitely many solutions (you can find an "a" for every value of "b" and vice versa). If you have two linearly independent equations, then the solution is as follows: Suppose the equations are (the unknowns are x and y) ax + by = k cx + dy = l ==> x = (k - by)/a, substitute this in eq.2 ==> c(k - by)/a + dy = l ==> y = (al - ck)/(ad - cb) ==> and if you substitute this value in x = (k - by)/a, you can find x. Hope this helps. Kind regards Mustafa Demirhan Sonork ID 100.9935:zoltrix
-
I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me:
Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1
all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie:n2 = c*(b-d-b*c+a*d)
. stumped. -c
I didnt know profanity was allowed in the Lounge Nish :-D Sonork ID 100.9786 voidmain www.busterboy.org Nish is a BIG fan of Goran Ivanisevic
-
Believe you are missing an equation. Generally solving for two variables, requires two equations. You have one and some other constaints. Note that as stated, a=0 and b=Q11/Q01 generally works. You can reverse the roles with b=0 and also get a solution. Ed
Yep, you need a simultaneous equation. Simon Hey, it looks like you're writing a letter! Sonork ID 100.10024
-
I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me:
Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1
all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie:n2 = c*(b-d-b*c+a*d)
. stumped. -c
i contacted the author of the algorithm about the seemin impossibility of solving for two unknowns.... here's what he told me:
Q11, Q10, and Q01 are 2-tuples, so you get two equations, one per component of the vectors. If you define the scalar-valued function Kross((x0,y0),(x1,y1)) = x0*y1 - x1*y0, then a = Kross(Q11,Q01)/Kross(Q10,Q01) and b = Kross(Q11,Q10)/Kross(Q01,Q10)
and, he is indeed correct, Q11 and friends are coordinates, not simple values. i hate math. -c
-
i contacted the author of the algorithm about the seemin impossibility of solving for two unknowns.... here's what he told me:
Q11, Q10, and Q01 are 2-tuples, so you get two equations, one per component of the vectors. If you define the scalar-valued function Kross((x0,y0),(x1,y1)) = x0*y1 - x1*y0, then a = Kross(Q11,Q01)/Kross(Q10,Q01) and b = Kross(Q11,Q10)/Kross(Q01,Q10)
and, he is indeed correct, Q11 and friends are coordinates, not simple values. i hate math. -c
I Love Math. :-D :-D Seriously .. i wasn't a big fan of mathematics. Then i took up an undergrad. course in mathematics and for the first yr i really hated it..then slowly i began to ralize the "Beauty of mathematics"..if someone were to look beyond the rules of mathematics ie. ask Why? instead of How? i think they'll certainly learn a lot more... On another note have u ever wondered what really do we do in mathematics??..Well if you look at it is just a collection of abstract ideas that find implementations in every field..it's only when you realize the motivations for those abstractions and that u'll truly see the wonders of mathematics.. I know i am taking it too far..but i couldn't resist responding. :) :)
Warning: Do not execute #include "stdio.h" int main(void) { printf("12\t\b\b"); printf("12\t\b\b"); return 0; } Sonork ID 100.9997 sijinjoseph