Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #1 2011-04-10 20:20:44

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #2 2011-04-10 21:12:45

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

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

## #3 2011-04-10 21:15:46

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #4 2011-04-10 21:32:42

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

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

## #5 2011-04-10 21:37:23

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #6 2011-04-10 21:58:39

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

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

## #7 2011-04-10 22:06:54

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #8 2011-04-10 22:15:26

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

I agree.

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

"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

## #9 2011-04-10 22:19:48

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #10 2011-04-10 22:39:42

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

Hi bobbym,

Did you try that expression? What did you get?

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

"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

## #11 2011-04-10 22:45:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #12 2011-04-10 23:03:31

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

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

"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

## #13 2011-04-10 23:07:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #14 2011-04-10 23:21:28

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

Aha, now both the expressions work fine.
I increased the precision to 100 digits.

"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

## #15 2011-04-10 23:22:45

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #16 2011-04-10 23:43:26

gAr
Member
Registered: 2011-01-09
Posts: 3,481

### Re: CAS and numerics

Hi bobbym,

"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

## #17 2011-04-10 23:49:23

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: CAS and numerics

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.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline