Results 1 to 8 of 8

Math Help - Solving Degenerate Quadratics

  1. #1
    Newbie
    Joined
    Sep 2010
    Posts
    5

    Solving Degenerate Quadratics

    Hi

    I am hoping for some help. I am reading and learning from an online programming text for scheme How to Design Programs: An Introduction to Computing and Programming

    However I am at a section an example where I need to solve for three coefficients a,b,c and test whether an equation is degenerate. I have no idea I haven't done math for 15 years, coefficients & quadratics ring a bell but I can't remember it at all, and less about degenerates.

    The top google searches aren't as they seem to assume we now what they are. Is there a good explanation or text online I can read.

    This is the question I am reading for reference in case I may misinterpret it.

    Develop what-kind. The function consumes the coefficients a, b, and c of a quadratic equation. It then determines whether the equation is degenerate and, if not, how many solutions the equation has. The function produces one of four symbols: 'degenerate, 'two, 'one, or 'none.
    PS I assume what I am asking is basic algebra and thats why I have posted to here
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,417
    Thanks
    718
    I believe the quadratic equation ax^2+bx+c=0 is called degenerate if a = 0.

    Code:
    (define no-of-solutions
      (lambda (a b c)
        (if (zero? a)
            'degenerate
    	(let ([discr ...])
              (cond
                [(zero? discr) 'one]
                [(negative? discr) 'none]
                [else 'two])))))
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    10,969
    Thanks
    1011
    Quote Originally Posted by emakarov View Post
    I believe the quadratic equation ax^2+bx+c=0 is called degenerate if a = 0.

    Code:
    (define no-of-solutions
      (lambda (a b c)
        (if (zero? a)
            'degenerate
    	(let ([discr ...])
              (cond
                [(zero? discr) 'one]
                [(negative? discr) 'none]
                [else 'two])))))
    And if that's the case, then the quadratic is actually a linear function.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member grgrsanjay's Avatar
    Joined
    May 2010
    From
    chennai,tamil nadu
    Posts
    143
    Thanks
    1
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Sep 2010
    Posts
    5
    Quote Originally Posted by Prove It View Post
    And if that's the case, then the quadratic is actually a linear function.
    OKay so if a quadratic equates to 0 its degenerate? Or specifically "a" of a quadratic?

    I am not really understanding because even if a = 0 then bx + c = 0 still provide function.

    Edit this page doesn't even think degenerate quadratics exist Products of degenerate quadratic forms, by Paul Balmer
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    10,969
    Thanks
    1011
    If the coefficient of \displaystyle x^2, i.e. \displaystyle a is \displaystyle 0, then the quadratic is degenerate.

    It's called degenerate because the quadratic function no longer "resembles" a quadratic, it now "resembles" a linear function.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Sep 2010
    Posts
    5
    Thanks. I managed to solve the problem.

    Code:
    ;Determine the state of a quadratic
    ;number number number -> string
    ;when a is 0 quadratic is degenerate
    ;determine when a not equal to 0 how many solutions to quadratic
    ;what kind
    (define (what-kind a b c)
      (cond
        ;if a is not zero then not degenerate, perform function
        [( = a 0) 'Degenerate]
        [(> (* b b )(* 4 a c)) 'TwoSolutions]
        [(= (* b b )(* 4 a c)) 'OneSolution]
        [(< (* b b )(* 4 a c)) 'None]))
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,417
    Thanks
    718
    I have several remarks about the program. Perhaps it is splitting hairs, but a couple of them are kind of important.

    First, the function returns symbols, not strings. These are different Scheme datatypes: see sections 6.8 and 6.11 in The Scheme Programming Language book.

    Second, the problem statement says to returns different symbols from the ones you are returning.

    Third, it is better to use "else" as the last condition in (cond ...). Using language-provided facilities and specifying fewer details makes is harder to introduce an error or a typo.

    Finally, is is a good idea to compute the (sign of the) discriminant only once using (let ...). Again, this helps avoid typos and is more efficient.

    Edit: It's commendable that you write comments with your code.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Quadratics further solving
    Posted in the Algebra Forum
    Replies: 13
    Last Post: November 11th 2010, 07:35 AM
  2. Quadratics problem solving
    Posted in the Algebra Forum
    Replies: 1
    Last Post: June 6th 2009, 07:55 PM
  3. solving quadratics by factoring
    Posted in the Algebra Forum
    Replies: 5
    Last Post: November 8th 2008, 04:40 PM
  4. Solving quadratics! help please
    Posted in the Algebra Forum
    Replies: 7
    Last Post: April 8th 2008, 04:09 AM
  5. Solving quadratics (mod p)
    Posted in the Number Theory Forum
    Replies: 12
    Last Post: April 14th 2007, 05:13 PM

Search Tags


/mathhelpforum @mathhelpforum