Results 1 to 6 of 6

Math Help - absolute and relative error

  1. #1
    Newbie
    Joined
    Aug 2008
    Posts
    3

    Unhappy absolute and relative error

    Hey just need some help with absolute and relative errors

    q) find the absolute and relative error when a computer stores 2/3 (two thirds)



    q2)then calculate the absolute and relative error when a computer adds
    2/3 + 2/3 + 2/3 (two thirds + two thirds + two thirds)

    Some direction to a tutorial or some help would be nice
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by syner View Post
    Hey just need some help with absolute and relative errors

    q) find the absolute and relative error when a computer stores 2/3 (two thirds)
    In binary:

    \frac{2}{3}=0b10101010101....

    Now how many bits do you have in the mantissa? If you are using normalized floating point you will have an extra bit of precision.

    So if we have a 23 bit mantissa we have 24 bits of precision so our floating point representation of 2/3 is:

    u=0b101010101010101010101010

    So the error is \varepsilon=(2/3) 2^{-24}

    (If the representation rounds rather than truncates then:

    u=0b101010101010101010101011

    and you will need to recompute the exact error)

    RonL
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2008
    Posts
    3
    Oh ok, what was the algorithm (method) that you used to get the binary result of 2/3 ? (two over three)
    and also the algorithm that you used to get the final results etc? sorry just trying to learn this stuff
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by syner View Post
    Oh ok, what was the algorithm (method) that you used to get the binary result of 2/3 ? (two over three)
    and also the algorithm that you used to get the final results etc? sorry just trying to learn this stuff
    No explicit algorithm I just expanded it using the definition of a binary fraction, whuich could be considered a/the greedy algorithm. Then truncating at the effective number of bits.

    RonL
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Aug 2008
    Posts
    3
    Lol surley there must be some sort of way that you worked out the binary.

    I know how to work from binary to hex, vice versa, floating point representation (now after abit of study)

    but this is the one bit that i am stumped at, what working did you use to get the binary value?

    Lol still abit lost to how i figure out the relative and absolute error, sorry i think i suffer from maths dislexia
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by syner View Post
    Lol surley there must be some sort of way that you worked out the binary.

    I know how to work from binary to hex, vice versa, floating point representation (now after abit of study)

    but this is the one bit that i am stumped at, what working did you use to get the binary value?

    Lol still abit lost to how i figure out the relative and absolute error, sorry i think i suffer from maths dislexia
    Greedy algorithm:

    Code:
    x: real <1   //input is a real less than 1
    max=24     //number of bits required
     
    out=""      //set output to null string
     
    for idx=1 to max
      if x>=1/2           //if x>=1/2 tag a 1 onto end of output string
        out=out|"1"     //and reduce x by 1/2
        x=x-1/2
      else
        out=out|"0"     //if x<1/2 tag a 0 onto end of output string 
      endif
    endfor
     
    return out
    RonL
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Relative error
    Posted in the Math Topics Forum
    Replies: 3
    Last Post: August 8th 2010, 10:35 AM
  2. Relative and absolute error
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 3rd 2010, 08:31 AM
  3. Relative Error & Maximum Error
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: March 10th 2010, 01:40 AM
  4. Round , absolute and relative error
    Posted in the Calculus Forum
    Replies: 1
    Last Post: January 24th 2010, 06:11 AM
  5. Absolute and Relative error of 3/11 (Binary form)
    Posted in the Math Topics Forum
    Replies: 0
    Last Post: March 8th 2009, 08:30 AM

Search Tags


/mathhelpforum @mathhelpforum