Isolating a variable gives me endless loop

  • Context: Undergrad 
  • Thread starter Thread starter HKragh
  • Start date Start date
  • Tags Tags
    Loop Variable
Click For Summary

Discussion Overview

The discussion revolves around the challenge of isolating a variable in a quadratic equation, specifically in the context of a game development scenario. Participants explore various methods to manipulate the equation and address the issue of encountering an endless loop during the process.

Discussion Character

  • Technical explanation
  • Exploratory
  • Homework-related

Main Points Raised

  • One participant describes their struggle with isolating the variable "a" in the equation a = b - ((c*d)/a) and expresses confusion over ending up in an endless loop.
  • Another participant identifies the equation as a second degree polynomial and provides the quadratic formula for solving it, noting the conditions for the number of solutions based on the discriminant D.
  • A third participant confirms the identification of the equation as a quadratic and explains how to rewrite it in standard form, relating it to the quadratic formula.
  • One participant reflects on their past experience with similar problems and expresses a desire to regain their mathematical skills.
  • Another participant empathizes with the feeling of forgetting learned material over time.
  • A participant points out that the endless loop resulted from multiplying and then dividing by "a," effectively undoing the initial operation.
  • The original poster acknowledges their understanding of the mistake and expresses a desire to find a different method to isolate the variable without falling into the loop again.

Areas of Agreement / Disagreement

Participants generally agree on the identification of the equation as a quadratic polynomial and the use of the quadratic formula. However, there remains no consensus on the best method to isolate the variable without encountering the endless loop, as the original poster seeks alternative approaches.

Contextual Notes

The discussion highlights the limitations of the original poster's approach, particularly the confusion arising from the inverse operations of multiplication and division. There is also an acknowledgment of the need for a different method to avoid the loop.

Who May Find This Useful

This discussion may be useful for individuals working on similar mathematical problems, particularly in game development or those looking to refresh their understanding of quadratic equations and variable isolation techniques.

HKragh
Messages
12
Reaction score
0
Coming in here with the following question, when I see what kind of stuff you normally tackle, is very embarrassing! But... I simply am too rusty for this stuff, it seems. This is NOT homework. This is something I need to do in a game I'm working on.

I end up in and endless loop when trying to isolate a variable of an equation. And I have no idea what approach to use to get out of it.

After lots of moving around in the original equation, I end up with this. Which is correct, if I plot in some values. But I need to have a completely isolated.

a=b-((c*d)/a)

Then I try to multiply by "a" on all

a^2 = b*a-c*d

So Now I need to divide by "a"

a = b-((c*d)/a)

Aaand. I'm back.

Please help me out with what seems to be VERY easy, if you know your stuff.
 
Mathematics news on Phys.org
One of my colleagues helped me out. This is, as you probably already know, a second degree polynomial. So just to make sure the solution is in here, even though none of you probably care:

The variable names are based on the equation above, and so the placement of each might seem out of place with the standard look of it.

D=b^2-4cd

a = (-b+-sqrt(D))/-2

D>0 : 2 solutions
D=0 : 1 solution
D<0 : 0 solutions
 
Yes, by identifying the equation as a quadratic polynomial then you know to use the quadratic formula:

http://en.wikipedia.org/wiki/Quadratic_formula

Its good you answered you own question and posted it as well.

----------------------------------------------------------------------------

So once you have the equation as a^2 = b*a-c*d and rewrite it as: a^2 - ba + cd = 0

then you can see it matches the Ax^2 + Bx + C = 0 format where in your case x=a, A = 1, B=b, C=cd

and the roots for x are (ie your a) are: x = -B/2A +- sqrt(B^2 - 4AC) / 2A

a = -b/2 +- sqrt(b^2 - 4cd)
 
Last edited:
thx for the extra info, jedishrfu! At some point in life (technical high school thingy) I knew more about this stuff, and solved many problems like this. Then time went by, and I forgot it all. I must say yesterdays experience has made it clear I need to rediscover this set of skills! It must be buried in there, somewhere... :)
 
The things we learn last are the things we forget first. I know the feeling.
 
Your "endless loop" came, of course, from your "multiplying by a" in the first step and them "dividing by a" in the second step! Multiplication and division are inverse operations so, in the second step, you just "undid" what you did in the first step.
 
I know :) The problem was that the only method I knew at the time to get rid of the "a" was by multiplying by it on all terms. And then I had the "a" still as a multiplication, and only knew division as a method to get rid of that. I very much aware how that got me into the loop. That is why I searched for a completely different method than simply multiplying and dividing my term.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
20
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K