You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

Try your favorite CAS out on this one.

With a = 77617.0 and b = 33096.0

Evaluate the above expression. You must use the numbers as you see them. In other words you must enter 77617.0 not 77617

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **A number by itself is useful, but it is far more useful to know how accurate or certain that number is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Nice one!

Is it a problem with floating point representation?

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

Hi gAr;

That is one of its problems. The guy who designed it wanted to prove there was a big hole in the way numerical people verify digits.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **A number by itself is useful, but it is far more useful to know how accurate or certain that number is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Oh, does he tell what kind of equations suffer like that?

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

That is the point. Sometimes you can tell that an equation is going to give a CAS ( or a calculator ) a lot of problems. But sometimes you cannot. That one came as a surprise to me too.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **A number by itself is useful, but it is far more useful to know how accurate or certain that number is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

So we do not know when to trust the answers and when not to!

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

You should always mistrust an answer a CAS gives. Same way you should mistrust anything a human says. There are basic guidelines and I will be posing them in the future.

There is a big difference between the way human mathematicians do math and the way a CAS does it. One of the funniest examples is

Human math: This is an identity:

Computer math: This is not!

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

I agree.

For that identity, yes, real numbers are always a problem!

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

You also do not use the quadratic formula to get roots.

Did you try that expression? What did you get?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Did you try that expression? What did you get?

Is it the identity you are asking about?

For numbers like a=1.1 and b=2.2, it displays correctly. When digits after decimal places are increased, it fails.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

Hi gAr;

With that identity as well as lots of others the best way is to plot (a+b)(a-b) - (a^2 - b^2 ). Instead of getting a flat line on the x axis ( y = 0 ) you should get a crazy graph of undulating spikes.

I meant the expression in post #1.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Ok.

For that expression I get:

-1.18059162071741e21

and 1.18059162071741e21 for those two numbers as integers.

I evaluated this expression and got

-4.38605752237005e29 for a = 77617.0 , b = 33096.0 ; and

-4.38605749875822e29 for a = 77617 , b = 33096

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

Hi gAr;

That expression is extremely difficult for a package to evaluate. We say it is ill conditioned. Adjust your digit command to get higher precision and try again.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Aha, now both the expressions work fine.

I increased the precision to 100 digits.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

What did you get, do not forget to hide it?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 104,288

Hi gAr;

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**

Offline

Pages: **1**