Results 1 to 3 of 3

Math Help - computer science problem

  1. #1
    Member
    Joined
    Sep 2009
    Posts
    149

    computer science problem

    for my comp. sci. homework i need to create a function that takes the 2 following lines:

    y=ax + bx^2 +c
    y=ex+f

    and find their intercepts. Im thinking i put the 2 equations equal to each other and solve for x. I get

    x=sqrt((f-c)/b+a-e)

    when i try this however its not right, my calculator is giving me a different answer. Any ideas? thanks!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by Evan.Kimia View Post
    for my comp. sci. homework i need to create a function that takes the 2 following lines:

    y=ax + bx^2 +c
    y=ex+f

    and find their intercepts. Im thinking i put the 2 equations equal to each other and solve for x. I get

    x=sqrt((f-c)/b+a-e)

    when i try this however its not right, my calculator is giving me a different answer. Any ideas? thanks!
    ex + f = ax + bx^2 + c \Rightarrow bx^2 + (a - e)x + (c - f) = 0.

    The first thing your program needs to do is check the value of the discriminant of this quadratic equation for the given input values ....
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Sep 2009
    Posts
    149
    i think i MIGHT of got it. I did what you said, and i did get the x value as if i solved it for a quadradic equation through a quadradic equation calculator. reason i did that is because i think my calculator might be on the fritz. I get my value for x, input it back into the program and get a y value. just for kicks, i do it in the other equation to see if i get the same value, and i do. Im thinking the program works, but my calculator is giving me different values. Could anyone just try graphing these 2 equations and tell me what they get for the 2 intercepts?
    i used:
    a=2
    b=4
    c=6
    e=16
    f=10

    i get
    (3.7656, 70.2490) and (-0.2656,5.7510)
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Oracles in computer science
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: November 7th 2011, 05:05 PM
  2. Help with Computer Science Java
    Posted in the Advanced Math Topics Forum
    Replies: 1
    Last Post: October 1st 2009, 06:24 PM
  3. Computer Science
    Posted in the Advanced Math Topics Forum
    Replies: 2
    Last Post: August 7th 2009, 06:06 PM
  4. Probability-Computer Science problem
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: February 8th 2009, 07:35 AM
  5. Calculus on science computer
    Posted in the Calculus Forum
    Replies: 2
    Last Post: July 18th 2007, 08:10 PM

Search Tags


/mathhelpforum @mathhelpforum