You are not logged in.
regarding experience I was professor in engineering college in engineering subjects but I had more fancy towards mathematics. I had taught "Finite Element methods" for mechanical engineering students. Possibly this should have been in the introduction.
I already knew that.
eww. What was that?
Numerical instability due to subtractive cancellation and roundoff.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
That's interesting.
Turing machines, theoretically, can only handle integers. It takes an infinite amount of memory to deal with actual real numbers.
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
As we view them integers are just numbers where epsilon (e) is 0. All other floating point numbers are viewed as x + e.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Okay, what is epsilon?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Without the jargon, it means a little bit, the error.
For instance, 1 / 10 is not on M's number line. The number line for computer is not a line as it is represented in mathematics, instead it looks like a line with lots of holes in it. Sort of like Morse code,
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Sort of like the cantor set.
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Nothing so weird.
Run this pseudocode in your favorite language:
n = 10
While n != 0
Print n
n = n - .1
Do while
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Functionally?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Procedurally, just like the pseudocode will be fastest.
n = 10; While[n != 0, Print[n]; n = n - .1]
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Okay, it does not terminate. That was weird.
Maybe some typechecking will help?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
That was weird.
Not weird, perfectly natural. What I have been trying to say in the last 233 posts. FPmath and pure math they just ain't the same things. That is why that ugly graph that should have been x = 0 ( a horizontal line ) was not!
Maybe some typechecking will help?
Nothing will help! Do you know why?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
No, why?
I think comparing a float and an integer is bad. We need typechecking.
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Forget that!
1 / 10 does not exist on a computer number line. There is no finite binary representation for it. Most decimals do not have one. In math you are subtracting 1 / 10. For a computer he is subtracting .1000000000000000055511151231257827021181583404541015625
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
What about this code, then?
>>> 0.2 - 0.1 == 0
True
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
I do not understand it?
Anyway, the code I gave you is a very poor way of doing that. It is a well known trap. It was designed to show you some of the possible ways fp arithmetic can jump up and bite you.
That way I call representation error. See, there is no way to represent 1 / 10 in binary, so when you enter a = 1 / 10 the computer can not really do that. 1 / 3 is like that too and so are most other decimals. And there are other sources of error too. That is why when doing numerical work and anyone using a computer is, you must know how to get around those problems.
So far we have seen
1) Subtractive cancellation.
2) Representation errors.
Want to see more?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
To solve x^2-8x=0 If we iterate x=x^2/8 from any start (except 8) will you ever attain the value of 8? the higher power of x is always a suspect on R.H.S except when |x|<1.
{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}
Offline
That system, based on the derivative, can be attracted to the root x = 0 but it will repelled away from the other root of x = 8 unless 8 is entered exactly.
A better way to get the root of x = 8 is to use the form
which converges.Here it is seen converging when x0 = 5
Here it is seen converging when x0 = 10
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I do not understand it?
Anyway, the code I gave you is a very poor way of doing that. It is a well known trap. It was designed to show you some of the possible ways fp arithmetic can jump up and bite you.
That way I call representation error. See, there is no way to represent 1 / 10 in binary, so when you enter a = 1 / 10 the computer can not really do that. 1 / 3 is like that too and so are most other decimals. And there are other sources of error too. That is why when doing numerical work and anyone using a compute is you must know how to get around those problems.
So far we have seen
1) Subtractive cancellation.
2) Representation errors.
Want to see more?
Sure
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
No, why?
I think comparing a float and an integer is bad. We need typechecking.
Even comparing 2 floats also you have to take care. They can be considered equal if the difference in percentage is less than some low value say 0.001%
{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}
Offline
Yep, comparing floats using = is not a good idea.
Sure
Take this difference equation and get for me a[20].
Print out your a[0] to a[20], all 21 numbers.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
With M?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Nope, use something else that only has double precision.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Am I supposed to program the log function myself?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Use this value 0.1177830356563835
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Feels good to have everything ready cause you've already did it?
Offline