Announcement

Collapse
No announcement yet.

do you trust your calculations?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • do you trust your calculations?

    http://www.youtube.com/watch?v=HGPPwvhWOhQ

    [edit] a hoax, but rather well done. Should not have posted.
    Last edited by aostling; 10-06-2009, 02:51 AM.
    Allan Ostling

    Phoenix, Arizona

  • #2
    heh, I like it.. though yea, most likey a hoax since you can't really calculate a human body going down a slip and slide that accurately. small shift in body position = big change in friction. (Not to mention all the tiny lumps in the ground)
    Play Brutal Nature, Black Moons free to play highly realistic voxel sandbox game.

    Comment


    • #3
      More importantly the velocity required to make the distance shown is far higher than could be attained even with zero friction over that drop at that angle. Acceleration is equal to the cosine of the angle of the slope times 10 metres per second per second. Then subtract the velocity lost climbing the ramp.
      Free software for calculating bolt circles and similar: Click Here

      Comment


      • #4
        <Pedant> Im pretty sure that should be 9.80665 m/s^2 </Pedant>

        Its a fun video tho

        Dave
        Just south of Sudspumpwater UK

        Comment


        • #5
          On the subject of trusting calculations, should you trust your computer?

          Here is a very simple BASIC program:

          For k = 0 to 1 step .001
          next k

          print k

          It counts from zero to one in increments of .001. Once it reaches 1 (or more) it then stops and prints the value of the counter, in this instance the variable "k".

          The values zero, one and .001 are all rational numbers so no roundoff errors should be expected. However, the result produced is 1.000991 and the number of times the loop executes is 1001, not 1000.

          This happens in every version of basic I have ever encountered and is independent of the operating system or the platform used. It is an inherent error in how a computer deals with numbers.

          Can anyone explain why?
          Free software for calculating bolt circles and similar: Click Here

          Comment


          • #6
            Yes I could, but the first thing I thought of is that computers are metric

            Dave

            Ex Abstract Electron Flow control Engineer
            Just south of Sudspumpwater UK

            Comment


            • #7
              These guys aren't fake, maybe not the brightest bunch, but fun to watch anyways

              nitro circus-slip and bleed
              http://www.youtube.com/watch?v=J2uGopHIXTs

              Comment


              • #8
                Originally posted by Evan
                On the subject of trusting calculations, should you trust your computer?

                Here is a very simple BASIC program:

                For k = 0 to 1 step .001
                next k

                print k

                It counts from zero to one in increments of .001. Once it reaches 1 (or more) it then stops and prints the value of the counter, in this instance the variable "k".

                The values zero, one and .001 are all rational numbers so no roundoff errors should be expected. However, the result produced is 1.000991 and the number of times the loop executes is 1001, not 1000.

                This happens in every version of basic I have ever encountered and is independent of the operating system or the platform used. It is an inherent error in how a computer deals with numbers.

                Can anyone explain why?
                because you can't precisely represent .001 with a binary floating point number.

                Comment


                • #9
                  That's correct. Specifically, it can only be represented in binary as an endless repeating number in the same way that 1/3 = .33333333... in decimal.

                  The binary value for D0.001 is 1.000001100010010011011101001011110001101010011111 10111110011101101100100010110100001110010101100000 01000001100010010011011101001b*10b^-1010b

                  When you change number bases you change also what numbers can be exactly represented. This can lead to all sorts of problems if you aren't aware of it, especially if you are doing your own math instead of relying on a coprocessor.
                  Free software for calculating bolt circles and similar: Click Here

                  Comment


                  • #10
                    The OP video is a fairly well known fake, IIRC put together by some wags at Micro$oft to promote the new Office package.

                    Comment


                    • #11
                      Originally posted by Evan
                      Here is a very simple BASIC program:

                      For k = 0 to 1 step .001
                      next k

                      print k
                      That's the textbook example of what they teach the kids not to do in Computer Science 101: you can't directly compare floating point numbers.

                      The correct way to compare floating point numbers is with an absolute or relative error.

                      Absolute Error:

                      epsilon = 0.00001
                      if (fabs(result - expectedResult) < epsilon)

                      Relative Error:

                      relativeError = fabs((result - expectedResult) / expectedResult);
                      "Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did."

                      Comment


                      • #12
                        Even when using old BASIC implementations all you need to do is multiply by the precision factor, then do the math as integers, then divide again.
                        Free software for calculating bolt circles and similar: Click Here

                        Comment


                        • #13
                          Re: Evan's program error. It's not the fact that it is "floating point" that is the source of the error. If you built a floating point processor that operated in decimal numbers, and yes it could be done, then it would work OK as long as you had a decimal precision to at least three decimal places built into it.

                          The actual error comes about, as Evan says, due to the fact that all computers work with binary and the number 0.001 can not be expressed without using an infinite decimal. Because the computer's numbers can not be infinitely long, there is a rounding error at each iteration through the loop and it winds up a bit short after 1000 iterations. Thus, it needs one more or 1001 times to finally end the loop.

                          The easy way to avoid the problem is to change it to

                          For n = 1 to 1000 Step 1

                          If you don't specify the use of interer math, this will use the same floating point numbers, but it avoids the rounding error because binary numbers can represent the number 1 exactly, without any rounding error (1 decimal = 1 binary, exactly).

                          Also,

                          For n = 1 to 125 Step 0.125

                          should also work as binary numbers can represent 0.125 exactly, without using an infinite decimal (0.125 decimal = 0.001 binary, exactly). So there is no rounding error.

                          It's not the floating point math, it is the binary math that is the "problem".
                          Paul A.
                          SE Texas

                          Make it fit.
                          You can't win and there IS a penalty for trying!

                          Comment


                          • #14
                            The 6502 series processors actually have a decimal mode in which all operations are done in binary coded decimal.
                            Free software for calculating bolt circles and similar: Click Here

                            Comment


                            • #15
                              As do all of the IBM 360 - 390 series processors (Packed Format is a compressed signed BCD form). They are used precisely because of the inaccuracy of binary representation.

                              BCD has always been representable on Intel x86 hardware, but most if not all compiler and interpreter vendors don't use it because there were few native mathematical operations supported on the chip. Thus, everything had to be done in software and at 4.77 mhz, that was too slow.

                              Floats are usually represented internally in the exponent mantissa form of (I believe) IEEE-754 which states 80 bits total to hold the value. There are other forms (short floats - 64 bits, long floats - 128 bits) but they still suffer from the limitations of the representation.

                              Comment

                              Working...
                              X